News for hackers. Stuff that matters.
Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @12:00PM (#16275323)
I wrote more about the motivation for Observable (formerly d3.express) last year: https://medium.com/@mbostock/a-better-way-to-code-2b1d2876a3...

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.

Re:Show HN: Observable Notebooks by arnioxux on Wednesday January 31, 2018 @02:19PM (#16276678)
Are the language/syntax differences documented somewhere? It's difficult to tell if something is an obscure early stage ecmascript proposal or a language feature specific to observablehq. For example in https://beta.observablehq.com/@mbostock/introduction-to-note...

  import {canvas as flood} with {height} from "@mbostock/randomized-flood-fill"
or how you define generators

  i = {
    let i = 0;
    while (true) {
      yield ++i;
    }
  }
etc
Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @02:29PM (#16276771)
We’re still writing more documentation, but there’s a bit more detail here (and I’ll be posting more soon): https://beta.observablehq.com/@mbostock/introduction-to-code

To 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.

Re:Show HN: Observable Notebooks by dunham on Wednesday January 31, 2018 @06:02PM (#16278357)
I got a little tripped up because I tried to assign a literal object to a name.

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})
Re:Show HN: Observable Notebooks by mbostock on Wednesday January 31, 2018 @06:35PM (#16278565)
Yep!
Re:Show HN: Observable Notebooks by d0mine on Wednesday January 31, 2018 @10:14PM (#16279417)
There is mybinder.org to run jupyter notebooks online . For example, https://github.com/norvig/pytudes
Re:Show HN: Observable Notebooks by Hex-3-En on Thursday February 01, 2018 @04:13AM (#16280501)
There's also some (currently) free cloud version by microsoft available on https://notebooks.azure.com in a preview state, but works great already. (Tested python3 only)