Public
Edited
May 11, 2023
Fork of Graphviz
Insert cell
Insert cell
Insert cell
dot`digraph {
rankdir = "LR"
a [shape=record label="<f1> field1 | <f2> field2 | <f3> field3"]
b [shape=record label="<f1> field1 | <f2> field2"]
"a":f3 -> "b":f1 [id=1]} `
Insert cell
Insert cell
Insert cell
graph = html`<div id="graph" style="width: 300px; height: 300px;"></div>`
Insert cell
dotSrc = `digraph
{ rankdir = "LR"
a [shape=none label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"><TR><TD PORT="f0">Query</TD></TR>
<TR><TD PORT="f1">Cars: [Car]</TD></TR>
</TABLE>>

]
b [shape=none label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"><TR><TD PORT="f0">Car</TD></TR>
<TR><TD PORT="f1">Make: String</TD></TR>
<TR><TD PORT="f2">Model: String</TD></TR></TABLE>>]
"a":f1 -> "b":f0 [id=1]}`
Insert cell
graphviz_init = d3.select(graph).graphviz(false)
Insert cell
graphviz = graphviz_init
.tweenPaths(false)
.attributer(attributerFn)
Insert cell
attributerFn = function (d) {
if (d.tag == "svg") {
d3.select(this)
.attr("width", width)
.attr("height", 300);
d.attributes.width = width;
d.attributes.height = 300;
}
}

Insert cell
renderEnd = new Promise(function(resolve, reject) {
graphviz.renderDot(dotSrc, function () {resolve(this)})})
Insert cell
d3 = require("d3-graphviz@2.1", "d3-selection@1", "d3-transition@1")

Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more