Public
Edited
Mar 3, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dependencyHierarchy = d3.hierarchy(dependencyGraph, (d) => d.branches)
Insert cell
dependencyNodes = dependencyHierarchy.descendants()
Insert cell
mergeDependencyGrapInto = function(graph) {

const hier = d3.hierarchy(dependencyGraph, (d) => d.branches);

hier.descendants().forEach((n,i) => {
var nodeId = n.data.value;
var value = {...n.data}
value.label = nodeId;
value.rx = value.ry = 5;

graph.setNode(nodeId, value)

n.links().forEach( l => {
console.log(l.source.data.value, '-->', l.target.data.value);
graph.setEdge(l.source.data.value, l.target.data.value)
})
});

graph.nodes().forEach(function(v) {
console.log("v...", v, graph.node(v))
})

}

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