Skip to main content
100%

Map - I

✓ Published0🌍 Public
11Cr18Ni9
Last edited Dec 9, 2018
Created on Dec 9, 2018

Clicking the SVG canvas toggles between a map of Wenzhou districts and a pie chart of their GDP values. Each shape morphs between its geographic boundary and pie slice using `transition.attrTween` with a custom `pathTween` interpolator. The code builds both geometries with `d3.geoPath` and `d3.pie`, coloring regions via a linear scale. Data comes from a local GeoJSON file and an inline GDP array, with SVG and animation rendering.

AI-generated description

Path animation is inspirated by Mike Bostock, the man behind the D3js.

路径动画取经于 D3js 创始人 Mike Bostock。

By cliking on svg canvas, chart will switch from map to pie chart, or vice versa.

单击图形,图形会在地图和饼图中切换。

mit Licensed

Similar vizzes