Example: Formatting Tricks

The visualization capabilities of Manifold using the Style panel can be exploited to provide
many visual effects. This topic provides some examples of how
to use Style in unexpected ways
to create a range of more elaborate effects. By presenting
miscellaneous techniques we can stimulate creativity in using Style.

The key idea for most of these tricks is to make duplicates of data
so that multiple versions of the same data can be stacked as layers in
a map with each drawing formatted differently and, if necessary, offset
using the Shift template in the
Transform
panel.

Important: While there are effects that
can be achieved by using multiple drawings based on the same table with
each drawing formatted differently, when we use Shift
we must make sure to copy both the table and the drawing so that what
is shifted is a different data set from the original.

The examples below assume we are familiar with using the Style panel to change formatting in drawings.

Using Shift to Create a Drop Shadow

We will create a drop shadow effect to give the appearance of three
dimensionality to areas seen in a map. This is a limited
effect as it tends to look best in only a limited range of zoom levels,
but for that limited purpose it looks very good.

We begin with a drawing called Regions
of the regions of France shown as areas, seen in a map below. We
have used the Layers
panel to set the background color to a calm beige.

In the Project pane we ctrl-click on
the Regions drawing and we ctrl-click as well on the Regions Table 2 used by the
drawing to highlight both components.

We then press Ctrl-C to copy both.

We press Ctrl-V to paste
and two new components, copies of the ones we copied,
appear in the Project pane named Regions
2 and Regions Table 2.
The properties for the Regions
2 drawing have been automatically adjusted so it uses the
Regions Table 2 table.

We drop the new Regions 2 drawing
into the map. Since it is an exact copy, including formatting,
of the Regions drawing there is
no visual change in the map. With the Regions
2 the active layer, in the Contents pane we choose the Style panel.

We use the Style panel
to change the color and fill color for areas to black.

The Regions 2 layer now appears
as a completely black display. It exactly covers the Regions drawing underneath.

We drag the Regions 2 layer
tab to the right, so the Regions 2 layer
is rendered below the Regions
layer. The Regions 2
drawing is a copy of the data in the Regions drawing
so the two line up perfectly and the Regions
2 drawing cannot be seen since it is under the Regions drawing
layer.

We click the Regions
2 layer tab to ensure the Regions
2 drawing is the active drawing. In the Contents pane we choose the Transform
panel.

We choose the Shift template
and use Shift X and Shift
Y values of 10000 and -10000 respectively. This
moves the Regions 2 drawing
down and to the right relative to the Regions drawing
by the specified amount.

Manifold immediately shows a preview using blue preview
color to show how the Regions 2 objects
will be shifted. How do we know the right amount to use? We
can experiment and see what the previewlooks like in the map. We press Update
Field.

The map updates and we see that the lower drawing, the all-black Regions 2 drawing, has been shifted
to the right and down, thus providing a 3D-like effect of a drop shadow
or solid edge, as if the areas were cut out of some material with thickness.

We can see how the technique works by zooming far into the upper edge
of the areas. The lower, black layer has been shifted relative
to the upper layer. The effect breaks down when the display
is zoomed too far into the scene but it works remarkably well to generate
screen shots that can later be utilized in graphics editors.

We can also extend this technique by using additional layers.

In the illustration above, zoomed in slightly to show the effect better
in a small illustration, we have made two more copies of the Regions drawing
and in both we have deleted all areas but the area for the Centre region.
The lower Centre 2 drawing
has been formatted with black
fill color and gray outline
color. The upper Centre drawing
has been formatted a light green and then Shifted
upwards by 10000 Y units and to
the left by -10000 X units. The
result emphasizes the Centre region
as if it has popped out from the other regions.

We first create a custom point symbol by stacking two copies of the
same drawing but formatted with different point styles.

The Some Cities drawing
has points formatted as large, round, all-black symbols.

The Some Cities 2 drawing has
points formatted as smaller white squares.

When both layers are seen together the result is a symbol for points
that appears to be a square within a larger black circle.

We can do the same effect by stacking drawings with lines.

The Some Lines 2 drawing has
lines formatted as thick, solid all-white lines.

The Some Lines drawing
has lines formatted as thinner, dotted white and gray lines.

When both layers are seen together the result is a custom appearance
for a line that looks like a white roadway with a dotted center line.

By combining thicknesses, colors, line styles and two or even more layers
we can create a wide range of visual effects for lines.

The above example uses a lower layer with all-black thicker lines and
an upper layer with all-green thinner lines.

Offsetting Labels

The display will be more legible if labels are offset from points so
they do not cover or are not covered by the points. With a bit of
tinkering that is easy to accomplish. We first make a copy of both
the points drawing we will use and
also the table for that points drawing.

In the above illustration we have copied the Some
Cities drawing along with the Some
Cities Table that it uses. We then renamed the newly copied
drawing Cities Labels, formatted
the points so they are big circles with transparent Color,
background value and then using the Shift
technique from the first example in this topic we shifted
those points upwards to the distance seen in the illustration.

When we create labels using the Cities
Labels drawing those labels will be centered on the big transparent
circles and not on the original points. When we copied and pasted
the Some Cities drawing
along with the Some Cities Table
that drawing uses, we also carried along a copy of all the other fields,
such as the names of cities, in addition to the geom
field that gives the location of the points. So the names used to
create labels correspond perfectly to the points above which they have
been offset.

If after creating the labels we remove the Cities
Labels layer (or, just double-click
its tab to turn it off) we have the display we want, labels for each of
the Some Cities points
but offset from the points so that the label or the point icons do not
obscure each other.

Using Rotation to Create Diamonds and Inverted Triangles

We can use the Point
rotation property in the Style
panel to create custom effects for point symbols.

The three illustrations below show the same drawings as the illustration
above, but with default formatting altered by using the Style
panel and overall background color set using Contents - Layers.

In the above illustration thematic
formatting is used to control the Point
rotation of the point symbols, with thematic
formatting also used to specify the background color of areas.
Contents
- Layers was used to set black background color for the drawings.

In the above illustration points are all set to use the same icon and
color, with thematic formatting
also used to specify the background color of areas. Contents - Layers was used
to set light beige background color for the drawings. This illustrates
how the square icons look without rotation.

In the above illustration when square icons
are used for points but with a Point
rotation of 45 they appear
as diamonds. Area borders are set to use a dotted line style and
the same color is used for all areas. Contents - Layers was used
to set light blue background color for the drawings.

In the above illustration all points use a Point
rotation of 180 degrees
to flip the default triangle style used for points,

Notes

Historical regions - The
illustrations in this topic use data from the US government, which show
the regions of France as they were before 1 January 2016, when regions
in France were reduced from 22 to 13.

Wasteful
of Storage? - When copying drawing layers to create visual effects
if the drawing is large and involves many objects that can involve copying
a large drawing and thus requiring twice the data storage size. But
in many cases drawings used for visual effect are not large, perhaps a
few megabytes or a few tens of megabytes in size. Given the
virtually free cost of disk storage space in modern times there is little
downside to making and using copies of data if the upside is a much more
appealing display.

Example:
Format a Drawing using the Style Panel
- In this example we provide a first, step by step look at how to format
areas in a drawing using the Style panel. We can specify the same
formatting for all areas or use a field to automatically set formatting,
a process usually known as thematic
formatting.

Example:
Format the Size of City Points by Population - A common GIS
task is to format the size of points in a drawing based on some value.
For example, the size of points that represent cities might be formatted
based on the value of the city's population, with cities that have larger
populations being marked by larger point icons. This is an example
of thematic formatting and is easy to do using the Style panel.

Example:
Style Properties in the mfd_meta Table - Style properties for
drawings
such as colors for areas are stored in human readable JSON values as properties
in the mfd_meta system table.
This example shows how we can copy formatting from one drawing
to another by simply copying values between records in the mfd_meta
table.

Example:
How Not to Format a Drawing - When using Style to format
a drawing it is a really bad idea to use the same color for objects that
is used for the background color. It can also be a bad
idea to use transparent color. This topic illustrates why.