# District analysis Widget type: `opendash-widget-leaflet-district-distribution` · Plugin: `@opendash/plugin-mobility` ![District analysis preview](../../../../../_attachments/opendash/widgets/assets/widget-previews/leaflet-district-distribution.png) ## Description Visualises the count or density of data points per district to highlight spatial distribution and hotspots. The widget renders a Leaflet map of the configured geographic areas and shades each area according to how many of the historical geo data points fall inside it (relative to the busiest area). Clicking an area opens a drawer showing the total count for that district, a 24-hour distribution bar chart, and a per-data-item breakdown — useful for analysing where and when activity concentrates. ## Data requirements - Data selection: by dimension (`select: "dimension"`), minimum 1 item. Allowed value type: `Geo`. - Data fetching: history only (`live: false`, `history: true`). The widget counts geo points over the selected history range. ## 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 - District analysis — Visualises the count or density of data points per district to highlight spatial distribution and hotspots. Tags: `map`. Default config is empty; configure districts and data after adding. ## How to use 1. Add the "District analysis" widget to a dashboard. 2. Select at least one geo data dimension whose historical positions should be counted. 3. In the settings panel, define the districts using one of the geography sources: From Zones (predefined zones), From Datasource (a geo dimension), or External Source (GeoJSON). 4. Pick a history time range; the map shades each district by relative point count. 5. Click any district on the map to open the detail drawer with the district total, the per-hour distribution, and a breakdown per selected data item.