Hi! I’m exploring Observable Framework and it’s really interesting!
There is one thing however that i don’t understand, and probably I’m missing something.
How can I export/import a project from the observablehq platform into a Framework project?
I tried by using “export/download code” but it seems to create a package useful to be self-hosted but not relaly compatible with Framework.
So, which is the best way for doing that? In my practice would be very useful since you can draft and collaborate on a project using observableHq and then refine it using Framework.
furthermore, is there a way to import cells from Other observable projects? (e.g. swatches from Color legend / D3 | Observable)?
Good question! There are 2 ways to support that workflow.
There is a Framework convert command (not documented yet) that converts a public notebook to a .md file that you can use in Framework. yarn observable convert <url>
You can also copy and paste the cells into a .md file (you can copy and paste multiple cells…) and do some minor editing.
In both cases, if you are using notebooks contributed by others, please ensure that it has an open-source license and include proper attribution.
For the d3 color legend question, it may just be easier to use Observable Plot
I appreciate the response and the hidden command; I have been wondering about maintaining workflow continuity between ObservableHQ and Framework.
furthermore, is there a way to import cells from Other observable projects? (e.g. swatches from Color legend?
@Cobus: I would also appreciate it if you could consider this a general inquiry about the import cell functionality rather than focusing on the color legend example. Ideally, I would (fetch,) pre-process, and pre-visualize my datasets on ObservableHQ, then import the processed datasets into Framework using data loaders. Is there any way to utilize the existing import cell functionality from ObservableHQ within the Framework?
Update: I have read that importing entire notebooks into Framework isn’t supported in other posts here and on GitHub, but I’m curious about importing specific cells. If there were a way to fetch preprocessed (live*) data from Observable, it would significantly enhance the feasibility of a Framework-based main workflow for me.
You can import and display the output of a cell from a notebook through the normal embed functionality in notebooks. You can simply grab the JavaScript embed code and paste it into your Framework markdown file. See the documentation.
In terms of your workflow… I am not sure what advantage you get by inserting the notebook (‘ObservableHQ Preprocessing’) into this flow, vs. writing the same code as you would have in the notebook in your markdown file. Could you expand on that a bit? You can write the same code in Framework as in notebooks, so I would think you can prototype in the notebook, and then just copy the code into JavaScript blocks (cell-by-cell) in your markdown file.