Viz1
✓ Published1🌍 Public
This example uses a pie chart to display the distribution of COVID-19 cases across different countries, with each slice sized by the total number of cases. It is built with D3 v6, utilizing `d3.select`, `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to render the chart as an SVG. Hovering over a slice triggers a tooltip that shows the specific case count and percentage of the total, calculated with `d3.sum`. The data is loaded from a CSV file using `d3.csv`, and a legend is added with colored rectangles and country labels.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed