Embedding a Starboard Notebook

Nov 23, 2021 · 1 min read
blog software

Starboard is an exciting open-source project I learned about from a blog post by Patrick Mineault. Basically, it allows the user to run and edit an interactive notebook, including both Python and Javascript, in their browser (not requiring a server like Jupyter!). It’s easy to embed a notebook stored (for free) on https://starboard.gg (you’ll see a Share or embed button at the top), but I wanted to have my notebook under my own source control. After some digging around I figured out how to embed a local Starboard notebook on my website. Let’s say I have a notebook stored as demo.nb. Then all I have to do is include this HTML snippet on my page (which should work for a Markdown-based website like this one):

<div id="mount-point"></div>

<script type="module">
    import {StarboardEmbed} from "https://unpkg.com/starboard-wrap/dist/index.js"
    const mount = document.querySelector("#mount-point");

    let response = await fetch("demo.nb");
    let notebook = await response.text();

    const el = new StarboardEmbed({
        notebookContent: notebook,
        src: "https://unpkg.com/starboard-notebook/dist/index.html"
    });

    mount.appendChild(el);
</script>

…and here’s the result!

Kyle Johnsen
Authors
PhD Candidate
Biomedical Engineering

I’m a PhD student advised by Chris Rozell at Georgia Tech, developing advanced closed-loop optogenetic control techniques for neuroscience. Specifically, I am applying optimal, model-based control to precisely perturb population dynamics.

I’m fascinated by the biological computational principles and how we can exploit them for next-generation AI/ML technologies. And vice-versa: how we can apply modern ML to neurotech/neuroscience, especially for building life- and time-saving brain-computer interfaces. I am looking for an industry research scientist role post-graduation.