Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really like Observable and have used it quite a bit, but I absolutely hate that it is the default documentation form for D3, because D3 is a javascript library, and Observable is not javascript. At the very least it would be nice if there was a way to take an example and press a button to get the same thing in javascript.


Yeah I pulled out d3 for a project recently, having used it before–quite a bit at one point–but not for several years. I just wanted to browse some basic examples for the current version, to refresh my memory and familiarize myself with the current API, but the reliance on Observable drove me up the wall. Even a lot of the old examples from bl.ocks.org just redirect to Observable now.

The presentation is one more layer to understand between "here's the code" and "here's what the code produces". I do generally like the notebook format for exploratory data work, but it's not at all ideal as part of a workflow for writing code that will fit into a larger application, in my experience.


A lot of the code you can write does look like JS, though. You can use the libraries that may be common to a JS dev. It's not perfect, but there's enough overlap and the differences are understandable and documented[1].

Also having learned a lot of D3 by reading through Observable tutorials, I'm curious what you've seen that doesn't seem to work when you port it to JS?

One thing I'm aware of is that you have to move a lot of the plotting code into the .then() method of promise when you're loading data.

------

[1] Observable's not JavaScript: https://observablehq.com/@observablehq/observables-not-javas...




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: