Say I am embedding this visual from D3 Observable into my own application. We can embed these by downloading the tarball file:
But this downloads all the cells that are useful for running the notebook online but are no longer needed when showing the visual in an application. How can I remove these cells?
I can run:
$('span').remove()
...but there must be a better way.
Sure thing – to just display the chart
cell, you can change
const main = runtime.module(define, Inspector.into(document.body));
Which displays all the cells, with
const main = runtime.module(define, name => {
if (name == 'chart') {
return new Inspector(document.body)
}
});
Which looks just for the cell named 'chart'.