D3: Removing values from a chart
✓ Published0🌍 Public
Nnikomc
Last edited Apr 3, 2020
Created on Apr 3, 2020
Forked from A bar chart that adds data with mouse-click
Twenty vertical bars show a dataset of twenty values, rendered as an SVG bar chart with numeric labels. Clicking the text above the chart removes the first value from the array and updates the chart, using `d3.scaleBand` and `d3.scaleLinear` to recompute domains, `dataset.shift()`, and `transition()` with `duration(500)` to animate the remaining bars and labels into their new positions. The bars exiting the chart slide off the right edge before being removed.
AI-generated descriptionLearning about scales with D3 (from Scott Murray's book).
MIT Licensed