Live data from Hacker News

Show HN: Observable Notebooks

beta.observablehq.com

91–100 of 136 posts

Re: Show HN: Observable Notebooks

#91
post #87
post #61

Earlier quoted context omitted.

> The user may want to control the state their notebook and variables are in manually. Can you share an example where you’d want that behavior? Spreadsheet cells don’t ask you when they update themselves.

There's an option for that. It's needed if your spreadsheet is too big / your calculations are too expensive.

Thanks; that’s good to know!

Re: Show HN: Observable Notebooks

#92

This is really cool and would be a great way to introduce programming concepts in an educational setting. Instant-feedback, inline documentation in a narrative style, and running on a browser really lowers the barrier for entry. I would have loved something like this when I was learning programming in middle-school decades ago. Since it comes from the guys behind D3 it's not surprising that much of the visuals come f…

I would have loved something like this while learning to program as well. I mean ... the Ruby REPL was fun, but this sort of thing is just so much more tactile and visual. We haven't had time to produce as many demo notebooks as we might have liked, but these notebooks really aren't D3-specific in the slightest. They're a reactive flavor of JavaScript, and anything that produces a value or can be rendered to the DOM…

The sliders on https://beta.observablehq.com/@mbostock/clifford-attractor-i... don't work for me, the sliders don't move. If I double-click a cell and edit the value, I get an updated graphic, but the sliders won't move.

Chrome 63.0.3239.132, OS X 10.13.3

Re: Show HN: Observable Notebooks

#93

I like the idea, I've even written something similar myself, but for me a few things were not clear. How would I load in data that is stored on my harddrive (not web addressable) without having to run my own server or go through the file selector popup box each time. User JS can't just read the harddisk (a requirement for web security). If I have to run my own server then a major selling point of this is gone. I work…

Good question! Mike wrote a notebook about getting data into Observable here: https://beta.observablehq.com/@mbostock/introduction-to-data - the gist is that right now any host that supports CORS does the trick, and the combination of GitHub Gist & RawGit is pretty good for the task. It'd be nice to drag & drop data right in the app, though, so... stay tuned.

And, yep - something like pandas for JavaScript would also be nice... also stay tuned.

Re: Show HN: Observable Notebooks

#94
post #33

Please, Observable, put something on the page that says what language this is! I figured this was like Colaboratory ( https://colab.research.google.com ) or Azure Notebooks ( https://notebooks.azure.com/ ) or some other hosted-jupyter variant. There was no information about how it should work when I went to the scratchpad, and I could barely tell it was Javascript when picking one of the sample notebooks.

Not only the language, but have at least one line that says what this is. I can guess that it’s a hosted notebook service, but I can’t tell how it’s different from Jupyter Notebook. Is the difference in the language it uses, or are there other differences?

[deleted]

Re: Show HN: Observable Notebooks

#95
post #75

Earlier quoted context omitted.

>Right now the html / presentation story for Jupyter notebooks is awful. How so? Ive found it pretty straightforward to convert matplotlib plots to gif/mp4 for presentation (note: this can be done automatically within the notebook), and plotly is pretty good for truly interactive stuff.

I'm specifically referring to the use case of creating explorable apps. Most data scientists I know would love a way of, say, building a map with a few input controls that alter the data or presentation (colors, layers, filtering, aggregation). I'm currently working on a JS-powered geospatial exploration app that is meant to be run either standalone or embedded into a Jupyter notebook. We often run into questions aro…

Have you looked at shiny (R) or dash (python)? I found it pretty easy to

    building a map with a few input controls that alter the data or presentation (colors, layers, filtering, aggregation)
with R + shiny + leaflet

Re: Show HN: Observable Notebooks

#96
Before this post fades from the front page, I just wanted to take a moment to link to some of the things folks have been publishing this morning:

Nick Strayer shows how t-SNE is similar (equivalent?) to a force-directed graph layout: https://beta.observablehq.com/@nstrayer/physics-based-t-sne

Jim Bumgardner published a tutorial that starts with drawing circles with canvas, then fibonacci spirals, then colorful sunflower seeds: https://beta.observablehq.com/@jbum/circles-spirals-and-sunf...

Kamil Slowikowski drew a lovely Barnsley Fern: https://beta.observablehq.com/@slowkow/barnsley-fern

Alan Palazzolo did a Mandelbrot fractal with randomized coloring: https://beta.observablehq.com/@zzolo/mandlebrot-set

Justin Palmer uses PROJ4JS to transform and scale a local map: https://beta.observablehq.com/@caged/local-map-projection-wi...

Re: Show HN: Observable Notebooks

#97
post #74

Any plans to make the notebooks embeddable in other sites?

Yes, and single interactive cells as well. A notebook already runs in a sandboxed iframe, and is able to load its dependencies there (libraries, data, values from other notebooks). So we're in quite good shape to be able to do that soon.

Fantastic.

One final question/request (for which I'd happily pay for!) : it would be awesome to have a path away from Observable's infra if desired. Say I _really_ want to host a particular notebook locally: is something like that planned? I know this is not a trivial feature since notebooks can call other notebooks, but I'd love to develop stuff on Observable knowing that should the worst happen and it doesn't exist anymore, I can run it all locally on my webpage.

Re: Show HN: Observable Notebooks

#98
post #97

Earlier quoted context omitted.

Yes, and single interactive cells as well. A notebook already runs in a sandboxed iframe, and is able to load its dependencies there (libraries, data, values from other notebooks). So we're in quite good shape to be able to do that soon.

Fantastic. One final question/request (for which I'd happily pay for!) : it would be awesome to have a path away from Observable's infra if desired. Say I _really_ want to host a particular notebook locally: is something like that planned? I know this is not a trivial feature since notebooks can call other notebooks, but I'd love to develop stuff on Observable knowing that should the worst happen and it doesn't exist…

Yes, something like that is in the roadmap.

We’ve been scrambling to get things ready enough for this initial launch, but Mike managed to get the Standard Library open sourced this morning: https://github.com/observablehq/notebook-stdlib

One of the next pieces we'd like to open-source is the Notebook Runtime — All of the JS that you need to take a blank webpage, and host a notebook within it.

After that, there's some file format details to figure out — hopefully a notebook can just be published and consumed as a standard ES Module. But then we'll be most of the way there.

Re: Show HN: Observable Notebooks

#99
This looks fantastic. The model appears very clean and different than Jupyter in many ways:

- cells can have names (it seems each cell can only export one name that is visible to the rest of the notebook)

- dependent cells auto-update when a source cell changes

- cells can be generators that auto update up to 60 times/sec

- cell values can be tied to UI elements easily

So instead of Jupyter's model where all cells execute in the same namespace, here you have named cells explicitly connected to each other in a graph and executed in topological order (not linear order).

The introduction covers these pretty well: https://beta.observablehq.com/@mbostock/five-minute-introduc...

Re: Show HN: Observable Notebooks

#100

Earlier quoted context omitted.

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; } }…

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…

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})
Post reply on HN