Skip to content

carto_flow.voronoi_cartogram.history

Snapshot types for the Voronoi cartogram iteration history.

Classes:

  • VoronoiSnapshot –

    Snapshot of Voronoi cartogram state at one iteration.

VoronoiSnapshot dataclass

VoronoiSnapshot(
    iteration: int,
    positions: ndarray,
    area_cv: float,
    cells: ndarray | None = None,
)

Bases: BaseSnapshot

Snapshot of Voronoi cartogram state at one iteration.

Attributes:

  • iteration (int) –

    The iteration number this snapshot represents.

  • positions ((ndarray, shape(G, 2))) –

    Centroid positions after this iteration.

  • area_cv (float) –

    Coefficient of variation of Voronoi cell areas at this iteration (0 = perfect equal-area distribution).

  • cells (np.ndarray of shapely.Geometry or None) –

    Clipped Voronoi cell polygons, shape (G,). None when VoronoiOptions.record_cells=False (default) to save memory.