Maps That Size Themselves by the Data: Cartograms in CanvasXpress
▶ Dorling cartogram — US population▶ Non-contiguous cartogram — US population▶ Contiguous cartogram — US population
A choroplith map — regions shaded by value — has a built-in lie. Big, sparsely populated regions dominate the picture because they are physically large, while small, dense regions you actually care about shrink to specks. Your eye reads area, and area is geography, not data.
Cartograms fix that by distorting the map so that area means value. CanvasXpress now supports three kinds of them, all on the existing graphType:"Map" pipeline, controlled by a single mapType parameter. Everything you already know about CanvasXpress maps — coloring by value, hover identity, labels, legends — keeps working. You just change how the regions are sized and placed.
The three cartogram types
Dorling (mapType:"dorling"). Each region becomes a circle sized by its value, then the circles are nudged apart so none overlap while each stays as close as it can to its true home. Shapes are discarded entirely; what remains is a cloud of sized bubbles that preserves rough geography. This is the cleanest way to compare magnitudes when the exact borders do not matter.
Non-contiguous (mapType:"cartogram"). Each region keeps its real shape but is scaled up or down around its own center according to its value. Dense regions grow, sparse ones shrink, and the borders separate. A muted full-size silhouette can sit underneath each region so you can read the shrunken shape against its true footprint. This is the default cartogram style and the most intuitive — the shapes are still recognizable, just resized to tell the truth about the data.
Contiguous (mapType:"contiguous"). The hardest and most striking kind. The shared mesh of borders is warped so that every region's area becomes proportional to its value while the regions stay joined. It is the classic "melting map" look, where states or countries bulge and pinch but never pull apart. CanvasXpress computes this with a deterministic rubber-sheet method, iterating boundary vertices until the areas match the data.
A concrete example
Here is a US-states population cartogram, non-contiguous, with the proportional scaling and a silhouette underlay:
new CanvasXpress("chart", data, {
graphType: "Map",
topoJSON: "albersStates",
colorBy: "Population",
sizeBy: "Population",
mapType: "cartogram",
mapCartogramScale: "olson",
mapCartogramSilhouette: true
});
Switch mapType to "dorling" for the bubble version, or "contiguous" for the joined rubber-sheet version. The data and the rest of the config stay the same — you are choosing a lens, not rebuilding the chart.
The non-contiguous style offers two scaling modes through mapCartogramScale. The area mode scales each region relative to its own density; the olson mode keeps the densest region at full size and shrinks every other proportionally. Both are standard, well-understood cartogram normalizations, so the output matches what readers expect from the technique.
Why it runs on the map pipeline you already use
The important design choice here is that cartograms are not a separate chart type with their own rules. They are a transformation applied inside the same map renderer. That means your colorBy classed choropleth still colors the distorted regions; hovering a bubble or a warped state still identifies it correctly; labels still attach; the legend still reads. You do not relearn anything. A cartogram is one parameter away from the map you already built.
It also means the results are deterministic. The bubble relaxation and the contiguous warp both run a fixed number of passes with no randomness, so the same data always produces the same map. Your figures are reproducible, and a cartogram you generate today looks identical when you regenerate it next month.
Reaching them without writing JSON
If you would rather not hand-edit config, the cartogram types are reachable through the map's drag-and-drop authoring shelf. The Map Type selector lets you switch between region, Dorling, and the two cartogram styles with a click, and the Color and Size channels are drag targets for your choropleth and bubble variables. So the whole family — from a plain region map to a melting contiguous cartogram — is a few clicks apart, no code required.
When to reach for which
Use a Dorling when you want a fast, uncluttered comparison of magnitudes and exact borders are noise. Use a non-contiguous cartogram when you want the shapes to stay recognizable while their sizes tell the data story — it is the most self-explanatory to a general audience. Use a contiguous cartogram when the connectedness of regions is itself part of the message and you want the dramatic, borders-intact distortion.
All three turn the oldest problem with thematic maps — that geography shouts over data — into a solved one. Point mapType at the style you want, and let area finally mean something.