Published
Edited
Sep 1, 2020
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
yield html`<div id="graph" style="text-align: center; width: 900px; height: 200px;"></div>`,
d3.select("#graph")
.graphviz(useWorker)
.renderDot('digraph {a -> b}')
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
Insert cell
compareHeight = 230 * 4 / 3// * compareWidth / 290
Insert cell
compareWidth = width / 4
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
graphviz_init = d3.select(graph).graphviz(false)
Insert cell
graphviz = graphviz_init
.attributer(attributerFn)
.transition(transitionFactory)
Insert cell
Insert cell
attributerFn = function (d) {
if (d.tag == "svg") {
d3.select(this)
.attr("width", width)
.attr("height", height);
d.attributes.width = width;
d.attributes.height = height;
}
}
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
//import {adot, logoDots} from "@magjac/d3-graphviz"
import {adot, logoDots, logoDot} from "@magjac/d3-graphviz"
Insert cell
Insert cell
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