Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Latest commit

 

History

History

default_observable_export

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Method - Default Observable export

This method is the simplest way to "migrate" an Observable notebook to a standalone webpage.

Diagram for the "Default Observable export" method

Install

  • Go to the notebook, click on "…" and then on "Download tarball")
  • Uncompress the psr-b1919-21.tgz file
  • Serve the index.html file with a web server

Using cli:

mkdir joyplot
curl -o /tmp/package.tgz https://api.observablehq.com/@mbostock/psr-b1919-21.tgz?v=3
tar xf /tmp/package.tgz --directory joyplot
rm /tmp/package.tgz

and serve locally at http://localhost:8000 with:

python3 -m http.server --directory joyplot

or deploy on now.sh (see https://joyplot-10jbhd7e8.now.sh/) with:

echo '{"builds": [{ "src": "**/*.{js,html,css}", "use": "@now/static" }]}' > joyplot/now.json; npx now joyplot; rm joyplot/now.json

Pros

Cons

  • requires browser compatibility with ES modules
  • generates various HTTP requests at runtime to get the dependencies (here d3@5):
  • generates an HTTP request to get the data from an external location
  • does not work locally (offline) since it depends on requests to cdn.jsdeliver.net and to the data file