Live data from Hacker News

Show HN: Observable Notebooks

beta.observablehq.com

61–70 of 136 posts

Re: Show HN: Observable Notebooks

#61

Earlier quoted context omitted.

basically if you have a bunch of code blocks that depend on each others' results - you don't have to remember which ones to update if you changed one, it will update automatically. especially useful with data visualization/exploration, but also helps a lot if you have a complex sequence where it's easy to get lost and forget to recompute something. there's a youtube link in the comments here which explains a lot.

> you don't have to remember which ones to update if you changed one, it will update automatically. Although I see how that would enable rapid iteration and make e.g. creating nice visualizations much easier, I don't think it should be mandatory. The user may want to control the state their notebook and variables are in manually.

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

Re: Show HN: Observable Notebooks

#62

This couldn't have come at a more convenient time for me. After years of telling myself I'd learn D3 I have finally started to as well as use it at work. I was using an extension in Jupyter but it was behaving unpredictably, and not being a frontend engineer by trade I found the process of sublime + browser foreign and cumbersome. As a big fan of jupyter and zeppelin I am stoked to see notebooks entering the js data…

The BeakerX extension to Jupyter has good support for D3 visualization of data prepared in Python and other languages. http://BeakerX.com/

Re: Show HN: Observable Notebooks

#63
post #40

Earlier quoted context omitted.

Absolutely! We all quite like Python, and there's no denying that JavaScript doesn't have the same caliber and range of scientific code (yet!). 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.

No doubt you're right, but I don't think JS is well suited for scientific computing. At least Python gives you operator overloading. Julia and R are designed for this field. It's better for JS to remain on the presentation side for anything sophisticated.

Forgive me if I read the response wrong but that seems like exactly what the author is saying? Do your computing in Python/R, export a generated CSV, and then present it in Observable?

Re: Show HN: Observable Notebooks

#64
I'd love to see a notebook environment that could somehow combine Python data science tools with DOM/JavaScript interactive visualization tools like D3. Jupyter and crew do former and this does the latter. What we really want is both. Would obviously be tricky to both implement technically and to design a good experience that lets you swap between the two languages and paradigms. Like you might have run webserver behind the scenes to expose the Python produced data to the D3? Stuff like that. Sounds like an interesting challenge. Because I'm generous though, I'd like to give this idea away for free to anyone willing to execute on it. Just joking! Devil in the details. More accurately, I'd just be pumped if someone had the energy to tackle this beast. Also, I'd definitely pay for a hybrid tool like this.

Re: Show HN: Observable Notebooks

#65
This works by executing Javascript code written by the user. Since these notebooks are shareable, and there is also a log-in feature, do any security features need to be put in place to prevent, say, someone linking me to a notebook that sends my login credentials for observablehq.com to a malicious host? That is, is the javascript inside the notebook sandboxed in any way?

I don't fully understand how modern web security works. But "executing arbitrary javascript written by user A on website B viewed by user C" seems worrying.

Re: Show HN: Observable Notebooks

#66

Earlier quoted context omitted.

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…

Oh that's cool I thought there were special hooks with D3. The native inputs demo seems really compelling especially in a learning environment. I'll definitely play with this and bring it into my next mentoring group meeting. (They'll be so glad to get away from scratch!) One cool thing that Swift playgrounds let you do is advance program state through loops and other flow-control line-by-line using a slider. I think…

Yes, it's absolutely worth exploring further — and we definitely have notions for ways to further expose and make interactive the running state of the notebook.

But for starters: You can do something similar to expose the internal state of loops and flow-control constructs by just using JavaScript's generators.

Here's an extremely simple example that slowly yields the value of a loop's `i` variable:

https://beta.observablehq.com/@jashkenas/flow-control-demo-w...

If you remove the delay, it'll instead yield `i` at 60fps.

Re: Show HN: Observable Notebooks

#67

Earlier quoted context omitted.

basically if you have a bunch of code blocks that depend on each others' results - you don't have to remember which ones to update if you changed one, it will update automatically. especially useful with data visualization/exploration, but also helps a lot if you have a complex sequence where it's easy to get lost and forget to recompute something. there's a youtube link in the comments here which explains a lot.

> you don't have to remember which ones to update if you changed one, it will update automatically. Although I see how that would enable rapid iteration and make e.g. creating nice visualizations much easier, I don't think it should be mandatory. The user may want to control the state their notebook and variables are in manually.

Isn't that like saying you want to control your execution manually? Basically, this just get rids of the manual refresh button that would be required to sync pieces of dependent computations after code or data changes somewhere. It is as if the graphics were running in immediate mode being refreshed completely on every frame (a common goal for live programming systems).

Re: Show HN: Observable Notebooks

#68
post #62

This couldn't have come at a more convenient time for me. After years of telling myself I'd learn D3 I have finally started to as well as use it at work. I was using an extension in Jupyter but it was behaving unpredictably, and not being a frontend engineer by trade I found the process of sublime + browser foreign and cumbersome. As a big fan of jupyter and zeppelin I am stoked to see notebooks entering the js data…

The BeakerX extension to Jupyter has good support for D3 visualization of data prepared in Python and other languages. http://BeakerX.com/

Here's a live demo on MyBinder:

https://mybinder.org/v2/gh/twosigma/beakerx/0.12.0?filepath=...

Re: Show HN: Observable Notebooks

#69
post #63

Earlier quoted context omitted.

No doubt you're right, but I don't think JS is well suited for scientific computing. At least Python gives you operator overloading. Julia and R are designed for this field. It's better for JS to remain on the presentation side for anything sophisticated.

Forgive me if I read the response wrong but that seems like exactly what the author is saying? Do your computing in Python/R, export a generated CSV, and then present it in Observable?

With the possibility that WebAssembly and WebGL will make the libraries in Python/R available to JS. Which might be alright. You probably won't be able to utilize vectorization with operators.

Re: Show HN: Observable Notebooks

#70
post #65

This works by executing Javascript code written by the user. Since these notebooks are shareable, and there is also a log-in feature, do any security features need to be put in place to prevent, say, someone linking me to a notebook that sends my login credentials for observablehq.com to a malicious host? That is, is the javascript inside the notebook sandboxed in any way? I don't fully understand how modern web secu…

Sure, happy to share a few of the gory details.

Yep, Observable runs user JavaScript code, but that code has no access to your login credentials or anything from the 'application': user code runs in a sandboxed iframe on a separate host - host that doesn't have any cookies or user information. The application communicates with that iframe host through serialized postMessage information only. That's the gist of the 'user code' portion - the rest of the application has additional layers of best-practice security like very strict content security policies and so on that defend from other kinds of attacks.

Post reply on HN