Skip to content

digiplan.map.choropleths#

Module to support choropleths in digiplan.

Choropleth #

Base class for choropleths.

__init__(lookup, map_state=None) #

Initialize choropleth.

Parameters#

lookup : str given lookup name map_state : dict current state of map (comes from mapengine)

get_fill_color(values) #

Return fill colors interpolation depending on given values and lookup.

Parameters#

values: dict[int, float] values per feature ID

Returns#

dict containing fill-color steps for given values

get_paint_properties() staticmethod #

Return paint properties for choropleth.

Can be overwritten by child class.

Returns#

dict containing paint properties for choropleth layer in maplibre

get_values_per_feature() abstractmethod #

Must be overwritten by child class.

render() #

Return values and paint properties to show choropleth layer with maplibre.

Returns#

JsonResponse containing values and related paint properties to show choropleth on map

EnergyShare2045Choropleth #

Bases: Choropleth

get_fill_color(values) #

Fix choropleth legend and colors to max value of 100%.

EnergyShareChoropleth #

Bases: Choropleth

get_fill_color(values) #

Fix choropleth legend and colors to max value of 100%.