Modification to dc.leaflet.js to a) plot colorscale in choropleth in the right order and b) to accept colorbrewer.js scales
✓ Published0🌍 Public
KKatiRG
Last edited Sep 22, 2015
Created on Sep 22, 2015
This example modifies `dc.leaflet.js` to enhance its choropleth rendering. It adjusts the color calculation function to correctly order colors from a `colorbrewer.YlGn` palette, and it accepts min/max values from the chart’s `colorDomain()` to map data values to colors. The code defines a `_colorCalculator` that divides the value range by the palette length to select a color, and it integrates a custom `colorAccessor`. The visualization uses the `dc.colorChart` and `dc.leafletChart` APIs to render geographic features.
AI-generated description