D3 + Leaflet: Pie
✓ Published0🌍 Public
11Cr18Ni9
Last edited Oct 15, 2017
Created on Oct 15, 2017
This example shows six pie charts overlaid on a Leaflet map, each encoded at a geographic coordinate and sized with a red-and-gray split representing an `achieve` value between 0 and 1. The code uses Leaflet’s `latLngToLayerPoint` to convert geographic positions into SVG screen coordinates, and d3.v3’s `d3.svg.arc` and `d3.layout.pie` to generate the pie paths. The SVG layer is attached to the map via `map._initPathRoot()`, and the chart positions update on the map’s `viewreset` event. The source data is a hardcoded array of lat/lng pairs with achievement ratios.
AI-generated descriptionBuilt with blockbuilder.org
Inspired by Noob.
mit Licensed