It’s easy to use D3 within Observable, but it’s not pre-loaded or specifically built-in. Any browser library published to npm can be loaded via require (for AMD) or dynamic import (for ES modules). I’ve published a bunch of notebooks with D3 but you’ll find other ones with THREE.js, Vega-Lite, Leaflet and other libraries.
import {canvas as flood} with {height} from "@mbostock/randomized-flood-fill"
or how you define generators i = {
let i = 0;
while (true) {
yield ++i;
}
}
etcTo summarize, the body of a cell is typically either an expression or a block statement, akin to the body of an arrow function. If a cell starts with name = …, then it has a name and can be referenced by other cells. So, the name = part is specific to Observable, but the expression and block statement is normal JavaScript.
The import declaration is similar to a normal static ES import, but the with clause allows you to inject local definitions into the imported notebook.
e.g.
name = { foo: 1 }
doesn't work. I ended up doing: name = { return { foo: 1} }
but after your explanation, I guessed that this would also work: name = ({ foo: 1})I fully expect plenty of people to do some of the data-crunching in Python, Julia, R, and so on, and bring it into Observable to explore and experiment. And I also expect JavaScript's ecosystem to blossom, especially with WebAssembly & WebGL hitting the mainstream.
I’d expect more python users to bring d3 in that bring python to JavaScript.
And then it occurred to me that CRAN and NPM have a fair bit in common. Both have a package for anything you might imagine, and both have a mix of amazing and less-than-amazing quality.
So USA-centric. My second biggest university in Ukraine (50k students) doesn't have any .edu domains and certainly didn't supply them to the students. Same as first biggest university and just about every other in the country, they all use regional or other general domains.
https://aws.amazon.com/sagemaker/
https://cloud.google.com/datalab/
https://kyso.io (disclaimer - I'm a founder)
Do you want it to be so easy that you jump into the notebook immediately upon logging in, the hard part is that javascript will run in your browser - but python or R need a kernel running somewhere?
I guess an oversimplified description would be that this is like a Jupyter Notebook specifically for JavaScript. Libraries like D3 are pre-loaded and immediately accessible. Am definitely interested in hearing the details about what it is built with and medium to long-term plans for the service.
Note that the Jupyter Notebook service generally requires you to be installing and running Python etc. on your own computer. Jumping into an Observable notebook is as easy as opening your browser and signing in via GIthub