D3 Example
This example visualizes the classic Iris dataset as a scatter plot, mapping sepal length, petal length, and sepal width to the x-axis, y-axis, and circle radius, respectively, with species encoded by color. It demonstrates how to dynamically style D3.js axes via JavaScript by selecting SVG elements and applying font, size, and stroke properties. The approach enables axis styling without requiring external CSS, and is built on an earlier D3 tutorial example. The visualization uses D3’s linear scales and SVG rendering to draw the plot, with axes configured to use compact notation and custom tick counts.
AI-generated descriptionThis is a scatter plot of the Iris data set.
The purpose of this example is to show how to dynamically style D3 axes through JavaScript. This is a first step toward interactively configurable axis styles, and paves the way for creating fully stylized visualization modules that are purely JavaScript and require no addition of CSS tags on the page that will contain the visualization.
The code for this is derived from example 106 of the screencast Introduction to D3.js.