Published
Edited
Dec 28, 2020
Insert cell
Insert cell
Insert cell
md`### create some stitches`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`### Create simulation`
Insert cell
// create the simulation object with defined forces
simulation = d3
.forceSimulation()
.velocityDecay(0.05)
//.alphaMin(0.00000001)
.nodes(nds)
.force("charge", d3.forceManyBody().strength(-0.2))
//.force("center", d3.forceCenter(width /2, height / 2))
.force("link", d3.forceLink(lnks).distance(d=>d.getLen()))
Insert cell
Insert cell
svg_ticker = {
while(1) {
chart.update(nds, lnks);
await Promises.delay(50);
}
}
Insert cell
md`# Appendix`
Insert cell
import {stitchFactory} from "@trekker/stitches"
Insert cell
height = 400
Insert cell
d3 = require("d3@6")
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