digiplan.map.views#
Views for map app.
As map app is SPA, this module contains main view and various API points.
DetailKeyResultsView
#
Bases: TemplateView
Return HTMX-partial for requested detail key results.
get_context_data(**kwargs)
#
Get detail key results for requested technology.
MapGLView
#
get_charts(request)
#
get_choropleth(request, lookup, layer_id)
#
Read scenario results from database, aggregate data and send back data.
Parameters#
request : HttpRequest Request can contain optional values (i.e. language) lookup : str which result/calculation shall be shown in choropleth? layer_id : str layer ID of given choropleth
Returns#
JsonResponse Containing key-value pairs of municipality_ids and values and related color style
get_popup(request, lookup, region)
#
Return popup as html and chart options to render chart on popup.
Parameters#
request : HttpRequest Request from app, can hold option for different language lookup: str Name is used to lookup data and chart functions region: int ID of region selected on map. Data and chart for popup is calculated for related region.
Returns#
JsonResponse containing HTML to render popup and chart options to be used in E-Chart.