Example: Format the Size of City Points by Population

A common way to make visual data easier to understand 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 what GIS people call thematic formatting.  It is easy to do in Manifold using the Style dialog.  

 

We open a map that has two drawings as layers, a Cities drawing showing cities as points using default formatting and a Regions drawing showing regions of France as areas that have been formatted using a process similar to that in the Example: Format a Drawing using the Style Dialog topic.

eg_format_point_size01_01.png

If we right-click on the Cities drawing in the Project pane and choose Properties we can see the properties of the drawing.

eg_format_point_size01_02.png

Since there has been no formatting applied with Style beyond default formatting, there are no Style properties as yet in the drawing's properties.   The properties do show that the drawing takes its data from the Cities Table.

 

We open the Cities Table to take a look.  It gives the Name of each city along with a Pop field that gives the population for each city.  

eg_format_point_size01_03.png

We will format the Cities drawing so the size of the point icon for each city is determined by the population of the city, with larger populations resulting in larger icons.

 

To do that we click on the Cities tab in the map to make the Cities drawing the active drawing.   We then choose Edit - Style to launch the Style dialog.

 

Our first move will be to replace the neutral, default, gray fill color for points with a brighter color so we can see the points better.

 

eg_format_point_size01_04.png

 

We click on Color, background to highlight it and then we click into the Value color well and choose a bright green color.  Press Apply.

 

eg_format_point_size01_05.png

 

There, that is better.  The points now have a bright green fill color and are more visible.  We now will specify the size of points so they automatically change size in accordance with the population.

 

eg_format_point_size01_06.png

 

We scroll down to Point size and then click on it to highlight that Style property.   In the Source box we click on the down arrow to pull down the menu of choices for Source.

 

eg_format_point_size01_07.png

 

The Source box pull down menu will be loaded with the fields in our table.   We will choose Field: Pop to specify the Pop field as the Source.

 

eg_format_point_size01_08.png

 

The Style dialog automatically opens up additional controls to allow us how we want the Pop field to control the thematic formatting of point size.    Since it is usually ugly and confusing to specify a different point size for each of hundreds of points, thematic formatting is normally arranged by grouping similarly valued points into ranges and then applying a point size to all points within each range.  A more limited number of sizes for points makes it easier to see when points are different sizes.

 

The first decision is how we want points grouped.  In the Method pull down menu we choose equal count, which means we would like to group points into ranges where each range has approximately the same number of points.

 

eg_format_point_size01_09.png

 

Next, we press the Full Range button to specify that we want the groups computed over the full range of values actually found in the data set.

 

eg_format_point_size01_10.png

 

That replaces the default 0 to 100 values for the Range to the actual values found in the data set.   In this case the range is from a population of 20000 to the biggest single population in the table, 2125200, for the central district of Paris.   We press the Tally button to group points into 5 ranges, called Breaks,  for formatting.   We could use more or less breaks than 5, but the default number of 5 gives reasonable results for a first try.

 

eg_format_point_size01_11.png

 

The dialog presents us with five ranges with the default point size of 5 in each.  (The default point size of 5 is just a coincidence and has nothing to do with our picking five ranges.)  

 

We can double-click into each point size value and change it to something else.   We start by double-clicking into the last entry to change it to 13 for the point size.  We can then press Enter and move on to the next range we would like to change.

 

eg_format_point_size01_12.png

 

In the illustration above we have assigned point sizes for the five ranges from 5 for the smallest populations to 13 for the largest.  A jump of two sizes between ranges is a good first try to see how that will look.  We press Apply.

 

eg_format_point_size01_13.png

The drawing immediately updates to use a different point size for points depending upon the size of the population for each city.

 

At this point we have fulfilled our primary objective for this example, to show how to format the size of points based on the value of a field.   However, we will keep going in the example to show additional features as we might utilize in real life when working with this data set.

Creating a Better Looking Display

If we do not like the uneven edges of the point icons used, we can change the style of points to something else, such as a square.

 

eg_format_point_size01_14.png

 

To do that we click on the Point style property to highlight it and then we click the Value graphic.

 

eg_format_point_size01_15.png

 

From the pull down menu we choose a square.   

 

 

eg_format_point_size01_16.png

 

We press Apply to apply our choice of a square icon for the point style.

 

eg_format_point_size01_17.png

Immediately, the map window updates to show points using the square icon, providing a cleaner look.  Not bad for a DBMS tool that is not a GIS!

Thematic Formatting Color by Population Value

It is often the case we can produce a more comprehensible display by simultaneously applying thematic formatting to two different style attributes at the same time, such as point size and point color.   When both color and size are used as visual cues that can help make complex data more understandable.

 

We will now thematically format the fill color of the points using the same pattern of ranges that we used to control the thematic formatting of point size.

 

eg_format_point_size01_18.png

 

The colors of points when using icons are set by the Color, which is the border of point icons that have border colors and a fill color, and the Color, background for the fill color used inside the icon.

 

We choose the Color, background attribute and then we pull down the Value menu.

 

eg_format_point_size01_19.png

 

Once again we choose Field: Pop as the controlling Value.

 

eg_format_point_size01_20.png

 

As before, we choose equal count as the Method, we press the Full Range button, we leave 5 as the default number of Breaks and then we press the Tally button.    The color wells for all ranges are filled with the green color we picked previously.  We can now click into each color well in turn to choose a color for that range.

 

eg_format_point_size01_21.png

 

When choosing a range of colors for values from small to large it is best to follow some sort of plan, such as colors of the spectrum from cool blue to hot red, or for increasing intensity and saturation within the same shade of color.   We will choose a spectrum-like set of colors from cool blue to hot red.   We press Apply.

 

eg_format_point_size01_22.png

Right away the map window updates so that cities are now marked not only by icons that vary in size by population but also that vary by color by population.   If we do not like the colors produced by our choices in the range color wells,  we can change those colors and then press Apply again to see if we like the new colors better.   Such tinkering and adjustment to taste is a key part of the creative process for producing an appealing and understandable display.

 

Looking at the illustration above we might that it is pretty but that we have too much going on.   If too many factors are varied at the same time it could be easy for viewers to miss the message we want to convey with a display.   In the above illustration the main message we would like to convey is the variation in populations in cities.  The main message we want to convey is not the colorful background of regions.  We could create a more understandable display that better conveys our desired message by changing the Regions drawing to use the same, less intrusive color for all regions.

 

To do that we click on the Regions drawing tab in the map to make it the active drawing.   We then press Edit - Style to open the Style dialog for the Regions  drawing.

 

eg_format_point_size01_23.png

 

We click on Color, background and right away the dialog shows us the thematic formatting that has been applied to the areas.   We pull down the Source menu.

 

eg_format_point_size01_24.png

 

Instead of choosing a field we choose Value.

 

eg_format_point_size01_25.png

 

That resets the formatting for Color, background to use a single Value that we specify.   We click into the color well to change the color.

 

eg_format_point_size01_26.png

 

We will use a calm, light brown color.   We press Apply.

 

eg_format_point_size01_27.png

The map window updates to show the new color.  That is less busy than before, but it still has a bit more contrast than we would like between the background color used for the areas and the black color used for area borders.

 

To done that down we will choose a lighter color than black for the color of the area borders.

 

eg_format_point_size01_28.png

 

We choose Color, the Style property that specifies the borders of areas, lines or point icons in the drawing and then we click into the color well to choose a color other than black.

 

eg_format_point_size01_29.png

 

We will choose a darker brown for Color, in the same general range of color tonality as the lighter brown used for the fill color for areas but darker and less saturated.   We press Apply.

 

eg_format_point_size01_30.png

 

There, that is better!   We can zoom in to take a closer look.

 

eg_format_point_size01_31.png

 

Zooming into the map we can see how the point icons show where cities are located.  At a glance we can see which cities are larger and which are smaller.   The cluster of cities in the top center shows the cities that are suburbs of Paris.  

 

 

eg_format_point_size01_32.png

Zooming into the Paris cluster we can see how there is one big, red icon (the biggest!) showing Paris, surrounded by numerous suburban cities which each in their own right have large populations.  

 

For extra credit we can use the Transform dialog's Center template to create centroid points for the areas in the  Regions drawing, using the Add Component button to save the centroid points into a drawing and table called Regions Table Center.   

eg_format_point_size01_40.png

We can then create labels from the Regions field of that new centroid points drawing and add it to the Map to create the display seen above, which positions the names of the regions at the centroid of each area.  We also have added offset labels for cities and have rotated square point icons into diamonds using the methods given in the Example: Formatting Tricks  topic.    Not bad at all for a database tool that is not a GIS.

 

eg_format_point_size01_41.png

Manifold can also handle Unicode in tables and to display labels.  The above labels are taken from a drawing created using the table below, where the Chinese field is nvarchar to handle Unicode characters.

eg_format_point_size01_42.png

The Chinese text in the above example is dummy text taken from the web and is not Chinese versions of the city names.  "Saumur" does not translate into Chinese as the character for "dragon."  But 弧度 as appears in the first line of the table does translate into 'Radian', the engine used in Manifold System..

 

One final move:  we right-click onto the Cities drawing in the Project pane and choose Properties.   Comparing this to the much shorter properties dialog at the beginning of this topic we see that adding formatting to the Cities drawing has added various Style properties.  These are all human-readable in JSON format.  They can be edited in the Properties dialog if we like or edited where they appear in the mfd_meta table of all properties, as shown in the Example: Style Properties in the mfd_meta Table  topic.

 

 

eg_format_point_size01_33.png

 

Using Multiple Style Dialogs with Multiple Windows

One of the most appealing aspects of Manifold is how multiple windows can show the same components at the same time with live views.  Change formatting for a drawing in one of the windows using Style, and all of the windows showing that drawing will update to use the new format.

 

That capability together with the capability of dialogs like Style to stay open and alive while we work with other windows and components makes it possible to have multiple Style dialogs open with multiple windows at the same time, allowing us to change in a highly interactive way various Style properties for different drawings that participate as layers in a map.  This greatly facilitates small adjustments as we tinker with the look of our displays.

 

eg_format_point_size01_34.png

 

Consider a Manifold desktop as seen above in a reduced view, showing windows like those used in the preceding sections of this topic.   On the left is a window for the Map component with the active layer being the Cities drawing.   A Style dialog has been opened for that window using that active drawing.  Changes to formatting made in that Style dialog will apply to the Cities drawing's Style properties.  

 

In the middle is the Regions drawing opened in its own window.  A Style dialog has been opened for that window as well.  Changes to formatting made in that Style dialog will apply to the Regions drawing's Style properties.

 

To the right we see an undocked Project pane and a map window showing a copy of Map that is called Map 2.   To create that copy we click on Map in the Project pane to highlight it, press Ctrl-C to copy it and then we press Ctrl-V to paste it under the new name, by default Map 2.   Open Map 2 and we have a copy of the map that we can pan and zoom independently of Map.

 

Formatting changes that we make to a drawing in either Style dialog will immediately apply to all windows that show that drawing.  We will start by changing the Color property of the Regions drawing.

eg_format_point_size01_35.png

 

In the Style dialog opened for the Regions drawing window we change the Value of Color to white.  We press Apply.     The Regions drawing immediately updates to use white color for area borders.

 

eg_format_point_size01_36.png

The Map 2 window also updates to show the new, white borders used in the Regions drawing.    Having a different map window open that shows the same drawings can be a very convenient way to see how formatting effects look at different pan and zoom levels.

 

eg_format_point_size01_37.png

The Map window also updates to show the new white borders used in the Regions drawing.   

 

We now will make a formatting change in the Cities drawing by using the Style dialog that is opened for the Map window and Cities drawing layer.

 

eg_format_point_size01_38.png

 

When we click into the Style dialog to make a change the focus automatically switches to that dialog.  We change the Point style to a triangle and press Apply.    The Map window immediately updates to show the new style used in the Cities drawing.

eg_format_point_size01_39.png

At the same time, the Map 2 window also updates to show the new, triangle point style used in the Cities drawing.   There is no change in the Regions drawing since that was not the subject of the formatting change. tech_yoshi_sm.png

 

Tech Tip:   Operations using multiple windows and multiple dialogs are a good reason to have more than one monitor.  We should have at least two monitors and, ideally, three monitors to have plenty of desktop real estate to spread out multiple windows and dialogs.  

 

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.

 

Selected Cities - Most populated places in France have populations much less than 20000 residents.  The table we used for this example was trimmed to exclude all populated places with populations less than 20000.

 

Tinker Time - The tinkering we did toward the end of this example, to adjust colors to taste, is a classic part of the creative process in GIS and data presentation.  The process is fun and addictive, so it is easy to spend more time tinkering with colors and formatting than on the data analysis.

 

3D Label text effect - In the illustration above that shows city and region labels there is a nice 3D effect to the region labels.  How can that be created?  Easy.  The key is to first save as a custom color the light brown fill color used for the Regions areas.   With the focus on the Regions Labels tab launch the Style dialog and choose that light brown custom color for the Color, background fill color for the labels but then use the color picker dialog to make it several shades darker.   That gives it the appearance of being a shadow on the same light brown color as the Regions fill color for areas.  Finally, choose the same light brown custom color for the Color for the labels but make it several shades lighter.  That gives the label text the appearance of being carved out of the same color or material as the Regions fill color for areas but highlighted by ambient lighting.

See also

Getting Started

 

User Interface Basics

 

Maps

 

Editing Tables

 

Drawings

 

Labels

 

Style

 

Example: Format a Drawing using the Style Dialog - In this example we provide a first, step by step look at how to format areas in a drawing using the Style dialog.  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: Add, Delete and Edit Thematic Formatting Intervals - This topic provides a step by step example of adding, deleting and editing intervals in the Style dialog that are used for thematic formatting.

 

Example: Multiple Primary and Fill Colors in a Drawing - At first glance that the same Color and Color, Fill values apply to areas, lines and points in a drawing may seem a limitation.   It is easy to use different Color and Color, Fill settings for different objects with different colors for areas, for lines and for points.   This example shows the simple procedure to use.

 

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: Formatting Tricks - The visualization capabilities of Manifold using Style 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.

 

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.