D3 Example
This example visualizes the classic Iris dataset as a scatter plot, encoding sepal length, petal length, and sepal width on the x-, y-, and radius scales, while color encodes species. It demonstrates a “popping effect” by using the CSS `currentColor` keyword so that each circle’s semi-transparent fill and opaque stroke share the same data-driven color, revealing overlaps between marks. Built with D3 v4 and rendered as SVG, the code uses `d3.scaleLinear`, `d3.scaleOrdinal`, `d3.axisBottom`, and `d3.csv` for data loading and scales.
AI-generated descriptionThis example shows a "popping effect" from having a semi-transparent fill color and an opaque stroke. This can be achieved using a little-known CSS keyword currentColor, which uses the value from the color attribute on visual marks. This is a convenient way to compute the data-driven color once, but use it as both the fill and stroke color of marks.
Another advantage of this technique is that you can see where there are overlapping circles (which would occlude each other if marks were opaque).
Related to d3-color - color.fade([delta=0.2]).
forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/134ed87c99257e3f2e31'>Standalone Scatter Plot</a>