Function Repository Resource:

# DorlingCartogram

Create a non-overlapping cartogram type with visual equalization, partial topology preservation and no shape preservation

Contributed by: Björn Zimmermann
 ResourceFunction["DorlingCartogram"][loc→val] generates a graphic of non-overlapping circles for initial locations loc with areas corresponding to val. ResourceFunction["DorlingCartogram"][{loc1→val1 ,loc2→val2,…}] generates a graphic of non-overlapping circles with initial locations loci with areas corresponding to vali. ResourceFunction["DorlingCartogram"][spec,n] generates a graphic of non-overlapping regular n-sided polygons with initial locations and values as given by spec.

## Details and Options

ResourceFunction["DorlingCartogram"] returns Graphics.
The locations loc can be coordinate pairs, a GeoPosition, or Entity or EntityClass objects with geographic coordinates, such as cities or countries.
Numerical values associated to locations can be given either explicitly, or, for Entity or EntityClass objects, specified as a Property that evaluates to a number.
Regular polygons and circles are supported shapes.
ResourceFunction["DorlingCartogram"] creates an arrangement wherein the shapes do not overlap, while also moving them minimally from their true (initial) location.
In general, the initial topology is not preserved.
Location value pairs can be given in an Association.

## Examples

### Basic Examples (4)

Define an example dataset of random values:

 In[1]:=

Create a cartogram with circles:

 In[2]:=
 Out[2]=

Create a cartogram for the 250 most populous cities in the United States:

 In[3]:=
 Out[3]=

Create a non-overlapping cartogram for the 250 most populous cities in the United Kingdom:

 In[4]:=
 Out[4]=

Create a non-overlapping cartogram for the level-2 administrative division in the United Kingdom:

 In[5]:=
 In[6]:=
 In[7]:=
 Out[7]=

### Options (14)

#### ColorFunction (1)

Create a cartogram for the 250 most populous cities in India:

 In[8]:=
 Out[8]=

#### ColorFunctionScaling (1)

Create a cartogram for the 250 most populous cities in Poland:

 In[9]:=
 Out[9]=

#### ImageSize (2)

Define an example dataset:

 In[10]:=

The default method "FixedStepSize" employs a step size on the magnitude of scale, which enables a quick calculation of many iterations:

 In[11]:=
 Out[11]=

#### MaxIterations (2)

The default of the maximum number of potential iterations is coupled to the method. The computation can finish earlier if no shapes overlap anymore.

Define an example dataset:

 In[12]:=

returns the initial configuration:

 In[13]:=
 Out[13]=

#### Method (3)

Supported methods are "FixedStepSize" and "AdjustedStepSize".

Define an example dataset:

 In[14]:=

The default method "FixedStepSize" employs a step size on the magnitude of scale, which enables a quick calculation of many iterations:

 In[15]:=
 Out[15]=

In the "AdjustedStepSize" method, the step size is adjusted after each step, which leads to good visual results after just a few iterations, but often slows overall convergence:

 In[16]:=
 Out[16]=

#### Rotate (2)

Define an example dataset:

 In[17]:=

Rotate the regular triangle shape by 30 degrees counterclockwise:

 In[18]:=
 Out[18]=

#### Scale (3)

Define an example dataset:

 In[19]:=

The default scale is determined such that approximately a quarter of the available space is filled:

 In[20]:=
 Out[20]=

Use a custom scale:

 In[21]:=
 Out[21]=

## Version History

• 1.0.0 – 12 August 2020