Skip to main content
100%

Idempotent Reusable Barchart 101

✓ Published1🌍 Public
AAlex
Last edited Apr 10, 2023
Created on Apr 10, 2023

This example presents an animated, reusable bar chart that visualizes the proportion of single-detached houses in Canada from 1986 to 2021. Built with D3.js (v7.8.4), it uses the `scaleBand` and `scaleLinear` functions to map census years and percentages, while `axisBottom` and `axisLeft` render the axes. The chart is implemented as an idempotent function, allowing it to be re-applied cleanly to an SVG canvas when parameters change, with bars rendered as SVG rectangles.

AI-generated description
MIT Licensed

Similar vizzes