# KPI for geographical Areas
Widget type: `opendash-widget-leaflet-district-kpi` · Plugin: `@opendash/plugin-mobility`

## Description
Displays key performance indicators aggregated per predefined geographical area (district). Useful for comparing areas and monitoring changes over time. The widget renders a Leaflet map alongside a list of districts. Historical geo positions are aggregated into daily samples and counted per area; each area is shaded by its average count relative to the busiest area, and hovering an entry in the side list highlights the corresponding area on the map. Points that fall outside all defined areas are collected under an "other" bucket.
## Data requirements
- Data selection: by dimension (`select: "dimension"`), minimum 1 item. Allowed value type: `Geo`.
- Data fetching: live and history are both supported. Internally the widget runs an aggregation pipeline that samples daily values and extracts coordinates from the geo dimension.
## Options
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `"json" \| "dimension" \| "zones"` | `"zones"` | How the districts are sourced. Selected in the settings panel via the geography selector. |
| `districtsFromZones` | `string[]` | `—` | IDs of predefined zones used as districts (when `type` is `zones`). Source: From Zones — "Choose a selection of zones from the predefined set of zones". |
| `districtFromDimension` | `DataItemDimensionIdentifier[]` | `—` | A geo data dimension whose value defines the areas (when `type` is `dimension`). Source: From Datasource — "Choose an geo data source, the value of which will be used as area". |
| `districts` | GeoJSON | `—` | A raw GeoJSON / ESRI shape definition (when `type` is `json`). Source: External Source — "Please specify a valid GeoJSON or ESRI shape string (JSON)". |
This widget has no display options beyond the geography (district) selection and the data dimensions.
## Presets
- KPI for geographical Areas — Displays key performance indicators aggregated per predefined geographical area (district). Useful for comparing areas and monitoring changes over time. Tags: `map`. Default config is empty; configure districts and data after adding.
## How to use
1. Add the "KPI for geographical Areas" widget to a dashboard.
2. Select at least one geo data dimension to be aggregated.
3. In the settings panel, define the districts via the geography selector: From Zones, From Datasource (a geo dimension), or External Source (GeoJSON).
4. Choose a history range; the widget aggregates daily counts per area and shades the map accordingly.
5. Use the side list to read per-district counts and hover an entry to highlight that area on the map.