Skip to content

carto_flow.symbol_cartogram.presets

Preset configurations for common cartogram styles.

Each preset returns a dict of keyword arguments for create_symbol_cartogram. Presets are the only place that references concrete layout and options types — this coupling is intentional and appropriate for a convenience layer.

Usage::

from carto_flow.symbol_cartogram import create_symbol_cartogram
from carto_flow.symbol_cartogram.presets import preset_dorling

result = create_symbol_cartogram(gdf, "population", **preset_dorling())

Functions:

preset_demers

preset_demers() -> dict[str, Any]

Demers-style cartogram: proportional squares on grid.

preset_dorling

preset_dorling() -> dict[str, Any]

Classic Dorling cartogram: proportional circles, free placement.

preset_fast

preset_fast() -> dict[str, Any]

Fast preview: fewer iterations, looser convergence.

preset_quality

preset_quality() -> dict[str, Any]

High quality: more iterations, tighter convergence.

preset_tile_map

preset_tile_map() -> dict[str, Any]

Tile map: uniform hexagons on grid.

Note: This preset does not include value_column, so symbols will be uniformly sized when used with create_symbol_cartogram.

preset_topology_preserving

preset_topology_preserving() -> dict[str, Any]

Topology-preserving cartogram with contact-constrained physics.

Uses a two-stage algorithm that better preserves the angular relationships between neighboring regions.