Acitivty6_Question2
This scatter plot of the Iris flower dataset compares petal length and petal width, representing each species with a distinct color and a legend for identification. Rendered as SVG circles, hovering over a point displays a tooltip with the species and the exact measurements. The visualization uses D3.js v7 to load data from a local CSV file, position the points via `d3.scaleLinear` and `d3.extent`, and add axes with `d3.axisBottom` and `d3.axisLeft`. An ordinal color scale via `d3.scaleOrdinal` maps species to colors, while D3's `transition` API animates the tooltip's opacity.
AI-generated descriptionIris Flower Measurements Visualization
Overview
This project visualizes the famous Iris flower dataset. It provides a scatter plot using D3.js to compare petal length to petal width, with data points color-coded by species. This visualization can help in understanding the relationship between these two features and how they differ among Iris species.
Files
index.html: The HTML file containing the D3.js script for rendering the scatter plot.data2.csv: The dataset file with iris flower measurements, including sepal length, sepal width, petal length, petal width, and species.
Usage
To view the visualization, simply open the index.html file
in a web browser. Make sure that data2.csv is located in
the same directory as the index.html file.
Visualization Details
- X-axis: Petal Width
- Y-axis: Petal Length
- Color Coding: Each species is represented by a different color.
Hovering over any point on the scatter plot will display a tooltip with the species name and the corresponding petal length and width.
Technologies Used
- HTML
- CSS
- JavaScript
- D3.js (v7)
Setup
Ensure you have a modern web browser installed. Clone the
repository, navigate to the directory containing
index.html, and open it in your browser to view the
scatter plot.
Contribution
Contributions to improve the visualization or expand the dataset are welcome. Please feel free to fork the repository and submit a pull request.
License
This project is open source and available under the MIT License.
Contact
If you have any questions or would like to contact the maintainers, please open an issue on this repository.