Skip to main content
100%

Reusable D3 Scatter Plot (Different Plot shape)

✓ Published0🌍 Public
PPeiyang Li
Last edited Apr 20, 2023
Created on Apr 20, 2023

This example demonstrates a reusable D3 scatter plot that visualizes the Iris dataset, with different symbol shapes representing different species. The plot maps petal length to the x-axis and sepal length to the y-axis, using axes generated with d3.axisLeft and d3.axisBottom. The reusable component pattern, built with a custom scatterPlot() factory function, employs d3.scaleLinear for positioning, d3.scaleOrdinal with d3.symbols for shape encoding, and d3.symbol to generate SVG paths. Data is loaded asynchronously via d3.csv from a remote GitHub gist.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes