Public
Edited
Mar 2, 2023
1 fork
Insert cell
Insert cell
Insert cell
mutable mutData = data
Insert cell
chart = chartLoop.wrapper
Insert cell
chartLoop = {
redraw;
const currentData = mutable mutData;
function mount() {
const wrapper = html`<div></div>`;
const forceGraph = ForceGraph()(wrapper);
return {
wrapper,
forceGraph,
data: currentData
};
}

const currentContext = this || mount();

currentContext.forceGraph.graphData(currentData);
currentContext.data = currentData;

return currentContext;
}
Insert cell
Insert cell
Insert cell
Insert cell
{
const t = setInterval(() => {
mutable redraw = Math.floor(Date.now() / 1000);
}, 1000);
invalidation.then(() => clearInterval(t));
}
Insert cell
Insert cell
ForceGraph = import("https://cdn.skypack.dev/force-graph@1.43.0").then(
(mod) => mod.default
)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more