Skip to main content
100%

Fork of Cars Scatter Plot for menu TEST

✓ Published1🌍 Public
Wweird_danger
Last edited Sep 8, 2024
Created on Sep 8, 2024
Forked from Cars Scatter Plot

This D3.js (v5) visualization renders the classic Iris flower dataset as a scatter plot, displaying sepal length against sepal width. A dropdown menu above the chart offers "Sepal" and "Petal" options, which currently only log selections to the console. The plot uses `d3.scaleLinear` for axes, which are rendered with `d3.axisLeft` and `d3.axisBottom`. Data is loaded from a local CSV file, and circles are appended directly to an SVG element, with the `d3.select` API managing the SVG and menu interactions.

AI-generated description

// // imported function axisLeft for namings // // maximum population number should map to maximum width of our svg // // mac is to compute maximum value where it takes 2 values = data and // // d 1 row of data, and returns population number max // // min and maximum value in our data for the width, first entry should be 0

// const xAxisTickFormat = (number) => // format('.3s')(number).replace('G', 'B'); // // // creating a function to customize big numbers wit G

// g.append('g').call(yAxis).selectAll('.domain').remove(); // // '' selector for string // // select elements we want to remove(to remove ticks/lines)

//   // The text-anchor attribute is used to align
//   // (start-, middle- or end-alignment) a string of pre-formatted text
//   // or auto-wrapped text where the wrapping area
//   // is determined from the inline-size property relative to a given point.
MIT Licensed

Similar vizzes