Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert D3 Observable to standalone webpage - like blocks.org?

I would like to run this D3 visualization

https://beta.observablehq.com/@mbostock/d3-zoomable-sunburst

as a standalone webpage, like this one here

https://bl.ocks.org/maybelinot/5552606564ef37b5de7e47ed2b7dc099

Does Observable have a function to export to a .html file? Or what would I need to change to make it standalone?

like image 521
max Avatar asked Nov 05 '18 14:11

max


1 Answers

Sadly, it's not that easy any more.

They have "archived" bl.ocks.org and are pushing the adoption of ObservableHQ notebooks. You can actually embed notebooks with a little effort, but they are served from https://api.observablehq.com. There are other options, but nothing that lets you easily pull out the html, javascript and css and host it yourself, as bl.ocks.org did. At best, you'll have to cobble a bunch more stuff together now. One method is to click the top-right context menu on some notebooks and select Export > Download code. Another possible option is this tool.

< relevant-humble-opinion > I don't know if d3 bl.ock.org examples just got so good that the suits moved in... or if Mike Bostock (our story's hero) really believed we needed "dataflow"... but things look bad from here... nothing good seems to last... < /relevant-humble-opinion >

like image 170
moodboom Avatar answered Sep 23 '22 09:09

moodboom