4 ms·
Thanks, and great questions! I like having multiple tools that make different design trade-offs. There’s no “one ring to rule them all.” For analysis I like to
by mbostock 4y ago
Thanks, and great questions!
I like having multiple tools that make different design trade-offs. There’s no “one ring to rule them all.” For analysis I like to start with a high-level tool so that I can explore quickly and see if the data is interesting. I can then “eject” to a lower-level abstraction if I reach the limits of expressiveness in the higher-level tool and determine it’s worth the additional effort to drop down.
Observable Plot is optimized for fast visual exploration: it’s concise, with good defaults, and lots of built-in conveniences for transforming data. In this regard Plot is similar to Vega-Lite and other high-level tools based on the Grammar of Graphics. Whereas D3 is optimized for bespoke presentation, like the sort of work we were doing at The New York Times; D3 prioritizes expressiveness.
I recommend Plot for most people over D3 because it’s more efficient: more of your time can be spent deriving insight from your data rather than programming. But there are still plenty of things that Plot can’t do yet (without plugins), like brushing a scatterplot, panning and zooming, and animation. We’re working on those!
And yep, Plot is built on D3. It’s nice to not have to re-implement the low-level visualization primitives like scales and layouts. Plot generates SVG output, so you can readily manipulate what Plot generates using D3 selections. Also, Plot is highly extensible: you can implement custom mark types, custom symbols, custom transforms, etc. Here are two examples, the first to apply some custom clipping, and the second to design a custom symbol for a dot map:
https://observablehq.com/@fil/plot-difference-chart https://observablehq.com/@fil/plot-difference-chart
https://observablehq.com/@observablehq/plot-spike-map https://observablehq.com/@observablehq/plot-spike-map
We haven’t fully documented how to write custom marks in Plot yet, but we plan to do that (along with animation and interaction) prior to the 1.0 release. There’s a ton to do but it’s exciting and we love hearing feature requests!