Hacker News new | ask | show | jobs
by tophtucker 1279 days ago
Re 1), I like Mike's talk from the 10th anniversary of D3. It came while working on Plot but before it was officially released; a few of the points relate to the high/low-level thing and anticipate Plot:

Video: https://www.youtube.com/watch?v=Sqeymt1mqAw Essay: https://observablehq.com/@mbostock/10-years-of-open-source-v...

Re 2), Plot returns a regular DOM node, so you can select any part of it and do anything you’d otherwise do with D3. Plots also expose their scales: assuming the DOM node of a generated Plot is named myPlot, you can call myPlot.scale("x"), and then feed that domain and range into a D3 scale. I can find some examples later if you’re interested.

1 comments

Thanks! And examples would be appreciated!
Here’s an example using D3 to add interactive tooltips to Plot:

https://observablehq.com/@mkfreeman/plot-tooltip

Here’s one that lets you click on a region in a line chart to select it:

https://observablehq.com/@skybrian/select-from-predefined-re...

Here’s using rough.js to stylize a plot:

https://observablehq.com/@fil/rough-plot

Also, tangentially ... I just went on to https://bl.ocks.org/mbostock for old time's sake, knowing full well that Observable is your new home, and got a Heroku error. Presuming it's because the bl.ocks are no longer maintained, I figured I'd let you know.
Nice! Thank you!

The tooltip example in particular strikes me as a convincing demonstration that there's a fairly coherent vertical stack of tools in D3->Plot around which a useful and flexible ecosystem of plugins and extensions can be built, all in SVG too (of course!)