Skip to main content
100%

Diamonds II

✓ Published0🌍 Public
Mmbostock
Last edited Mar 1, 2019
Created on Dec 24, 2015

This scatterplot of 1,200 diamonds reveals the distribution of carat mass against price in US dollars, using two logarithmic axes to accommodate the data’s wide range. The code first draws a white-lined grid and labeled axes via `d3.axisLeft`, `d3.axisBottom`, and the `d3.scaleLog` scale. It then animates the points: `d3.shuffle` randomizes the data, and a `d3.timer` loop repeatedly pops 500 diamonds per frame, drawing each as a fixed-size rectangle on the Canvas via `context.fillRect` with a multiplicative blend mode.

AI-generated description
gpl-3.0 Licensed

Similar vizzes