observable-jupyter on Google Colab

You can’t programmatically create notebooks, but I can think of a few options:

  1. Fork the template notebook and replace the data. While this approach isn’t very DRY, it’s a common strategy on Observable and grants you more freedom with regard to changes and iterations.
  2. Add a data input so that users can provide a custom data source (e.g. via a CORS enabled URL, a file field, or a textarea).
  3. Offer an importable API, like functions for data processing and widgets / views for data visualization. Views can be imported by referencing them with the viewof prefix, e.g. import {viewof num_enr_terms} from "...".
  4. Support import overrides. Chances are your notebook already does. Make sure that all your relevant cells have names. Then, even if all your cells are stateful (i.e., contain processed or generated data), authors can still replace cells while importing, via e.g. import {/*...*/} with {myData as data} from "...".

Does that answer your question?

1 Like