Tutorial3.2
This example shows an interactive scatter plot of the Iris dataset, encoding species as symbol shapes and displaying a custom shape legend. It demonstrates modular D3 v7 code organization, with separate ES6 modules for axes, scatter plot rendering, and legend construction. The visualization uses D3 scales (scaleLinear, scaleOrdinal), symbol generators, and CSV data loading from a GitHub gist. The code also highlights VizHub’s pattern of state management and re-rendering through a setState function, alongside dynamic SVG resizing to the window.