[05] Interactivity - Using React Hooks with D3
This interactive bar chart demonstrates how React hooks and D3 v5 work together to create a dynamic, animated visualization. The example uses `useState` and `useEffect` to manage a mutable data array, while D3's `scaleBand`, `scaleLinear`, and `join` method handle the rendering of SVG bars and tooltips. On mouseenter, a tooltip text element appears with data binding, positioned using the band scale’s index value, and animates its opacity and y-position via `transition()`. Buttons trigger data updates—increment, decrement, filter, or append—which re-render the chart through the React state change. The code also demonstrates axis generation with `axisBottom` and `axisRight`, applying a color scale to bar fills based on value.