🏠 back to Observable

My Questions & Wanted to say "Hello" (in a fun special way..)

Hello Guys, I just wanted to introduce myself,
by saying “Hello …”, maybe you want to have a look at it: …

I appreciate this exiting innovative development platform,
their creators/authors and “BOSSes”,
and I like their friendly forum community members, aren’t they… ?

I finally managed it tonight to complete my very first Observable …
while developing some concerns came to my mind:

(1) How to Download Observables to my local filesystem ?
The only way I found out, is forking, going into ‘View in safe mode’.
I select the textual source content, and then copy/paste to a local file.
I wonder, if there’s a more conveniant method … ?

(2) How to Upload Observables from my local filesystem ?
Say, I want to convert an existing (bigger) d3js app to an Observable.
I could do syntactical + semantical transforms to convert it to
a hopefully functional (local) Observable.
Now it would consist of many cells … - how do I manage to upload it … ?
Second: Say, I want to convert all/some examples of a converted d3js book/tutorial …
how to upload these many files conveniantly … ?

(3) Does an API for Observable exist ?
I would like to have an overview (titles, preview images)
from e.g. Mike Bostocks Repositories, or even from all e.g. 500 high rated repos
how can I get it properly … ?

(4) … Wait, let’s stop it for now!

I really would enjoy, if you would drop me some handy advices …
Best regards, Wolfgang from Ludwigsburg, Germany

BTW:
(a1)How to modify the delay in a running Promise/setInterval,
without killing/renew the whole Promise setup … ?
(a2)I tried the CSS as a FileAttachment, I’ll report this issue later …

Welcome Wolfgang!

For (1), have you seen this page?

That explains how you can download a version of the notebooks that you can run directly with the Observable runtime library. This will provide you with ES module files that are “compiled” from the code you write in each of the cells.

The above is as far as “officially supported” methods go. As far as I know there is no officially supported way to do (2) + (3).

BTW, I suggest you post (a1) and (a2) as separate threads with more details (e.g. links to example notebooks).

Now, read on if you’re feeling adventurous!

In case you want to download the original source in each of the cells of your notebook, it is possible (though not very convenient yet) to get them by making authenticated requests to Observable’s internal API (see the unofficial scripts below). You can then run the resulting JSON files using the compile.notebook method of @asg017’s “unofficial-observablehq-compiler”:

(2)+(3) are very related. It is possible to upload and download notebooks by talking to the Observable API. See the scripts linked in this thread: backup method?, particularly @mootari’s observable-client library:

and my script (based on an earlier version of @mootari’s code).

Warning: as mentioned above, these rely on Observable’s internal API, so are subject to breakage at any time and without notice. In fact, I haven’t tested my script in a long time so it may already be broken and require some tweaking. (Though feel free to post here or in the other thread and I or others can try to help out.)

2 Likes