change markers in reusable D3 scatterplot
✓ Published0🌍 Public
This example demonstrates a reusable D3 scatterplot that renders the Iris dataset, mapping petal width and sepal length to x and y axes while encoding species through both color and symbol shapes. The visualization uses an ordinal color scale with `d3.schemeCategory10` and a symbol scale based on `d3.symbols` to differentiate categories. Built as a custom `scatterPlot` function with setters for width, height, data, and accessor functions, it employs `d3.scaleLinear`, `d3.axisLeft`, and `d3.axisBottom` within an SVG rendered by React. The code assigns path data via `symbolGenerator.type()` to create distinct markers.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed