Encircle Scatterplot with alpha shapes
This example displays a scatterplot matrix of the Iris flower dataset, with each cell showing pairwise relationships between sepal length, sepal width, petal length, and petal width, colored by species. It enhances the classic matrix by adding alpha shapes—computed via `d3.hexbin`, `d3.voronoi`, and a custom boundary function—to generate contours that encircle each species’ points in every plot. The visualization uses d3.v4 with SVG rendering, including brushing functionality from d3.brush. Data comes from Anderson’s Iris measurements and is loaded as a CSV file.
AI-generated descriptionUsing alpha shapes to group or "encircle" sets of points.
It's not fast, but it's fun.
DISCLAIMER: this code is quite hackish, don't copy it blindly.
TODO: buffer the shapes so that they nicely enclose dots as ggplot2's geom_encircle function does.
The scatterplot matrix visualizations pairwise correlations for multi-dimensional data; each cell in the matrix is a scatterplot. This example uses Anderson's data of iris flowers on the Gaspé Peninsula. Scatterplot matrix design invented by J. A. Hartigan; see also R and GGobi. Data on Iris flowers collected by Edgar Anderson and published by Ronald Fisher.
S Forked from mbostock’s <a href='http://bl.ocks.org/mbostock/4063663'>Scatterplot Matrix Brushing</a>.