5 ms·
Some context: D3.js (https://d3js.org https://d3js.org) is a popular and influential JavaScript library for building data-driven visualizations. There are a zil
by rgovostes 4y ago
Some context: D3.js (https://d3js.org https://d3js.org) is a popular and influential JavaScript library for building data-driven visualizations. There are a zillion awesome examples of using it to create all variety of diagrams with animations, interactivity, and live data sources. Arguably, D3 doesn't know much about any specific type of visualization, but it's the toolkit to assemble whatever you want.
Observable Plot is a separate library that focuses on the higher level task of generating specific common plots and charts. Compare a bar chart in D3 (https://observablehq.com/@d3/bar-chart https://observablehq.com/@d3/bar-chart) with Observable Plot (https://observablehq.com/@observablehq/plot-bar https://observablehq.com/@observablehq/plot-bar). The former involves creating SVG elements, the latter is just a function call.
The APIs are worth studying because they've decomposed visualization into elemental components that can be recombined. Using D3 can be like writing React for the first time, requiring a new mindset.
Both libraries come from the same prolific author, Mike Bostock (@mbostock here), who previously worked on visualizations for the New York Times. Mike's new company, Observable (https://observablehq.com https://observablehq.com), a very thoughtful take on computational notebooks, is also worth a look.
I've been secretly hoping he'll take on Graphviz next.
- ivanvanderbyl 4y agoFor more context, Plot is largely based on the Grammer of Graphics by Leland Wilkinson, and can be seen as an implementation of this using D3. It's a very dense book, and there are plenty of write-ups on the core concepts that make approaching data visualisation problems more tractable.
- bobbylarrybobby 4y agoVegaLite is also a fantastic grammar of graphics tool (which Observable acknowledges) that uses d3.
- folli 4y agoSince you seem to know your D3.js: what happened to bl.ocks.org ? It's a great resource for examples, but down since several days.
- tunesmith 4y agoI believe observablehq is the new bl.ocks.org . Observablehq scratches such an itch for me. It's exactly what I wanted out of Jupyter, for the cells to be reactive. I just wish I could have it in a desktop app. I'd pay hundreds for that.
- maegul 4y agoHard agree! The reactivity is a killer feature. That it hasn’t come to jupyter is my largest criticism of that ecosystem and the developers behind it. It’s like they have never used excel and seen what it’s good at or something, or are too focused on competing with VS Code when thats a losing battle and they should focus on the actual notebook interface (with things like reactivity).
- graphviz 4y agoThis is such an excellent observation (about Graphviz); you can see some of the rough outlines of the primitives that might get the job done, and how they might be composed. This area is so ready for new work. There are also some problems that maybe don't arise the same way in stat graphics and charts for data journalism, like coping with nested layouts, stable dynamic layout, optimizing topological properties, and intricate combinatorial optimization problems, to name a few things.