Skip to main content
100%

Fork of Scatter Plot Simple

✓ Published0🌍 Public
Zzach b.
Last edited Jun 1, 2023
Created on Jun 1, 2023

This scatter plot visualizes the Iris Dataset, showing the relationship between sepal length and petal length across three species. The chart displays colored circles without axes, using D3 v7's `scaleLinear` and `extent` functions to map data values to SVG coordinates. The visualization is made responsive by applying a `viewBox` attribute instead of fixed width and height, while CSS `clamp` controls the SVG's displayed size. Data is loaded from a CSV file and parsed with `csvParse` before rendering.

AI-generated description

A scatter plot of the Iris Dataset with no axes.


fuffed around to make the SVG responsive. but running into problems with the content inside the iframe still reporting it's 960px wide.

changes

used:

.attr('viewBox', `0 0 ${width} ${height}`);

istead of:

.attr('width', width)
.attr('height', height);

in viz.js

&&

used:

width: clamp(350px, 50%, 800px);

in styles.css

MIT Licensed

Similar vizzes