Exploring survey data interactively - both axes
This interactive bar chart lets users explore survey data by selecting a variable from a dropdown menu. Changing the selection updates both the y-axis and the heights of the bars, which display averages for variables like stress, health, and family size grouped by a fixed x-axis. The visualization uses D3 v5’s general update pattern with `d3.nest()` and `d3.rollup` to aggregate the dataset, which is loaded as JSON. Code defines scales, axes, and bar rendering with SVG, while the dropdown options are generated through a data join.