Directed dependency graph
This visualization displays a directed dependency graph of an application ecosystem, showing which modules depend on others through colored circles connected by arrowed links. The graph computes dependency paths from the JSON data and arranges nodes in a layered grid layout based on their dependency depth and relationships. It uses D3 v5’s `d3.json` function to load the data, and renders the visualization as SVG elements, including circles, text labels, and custom arrow markers defined with `markerBoxWidth`, `markerBoxHeight`, and `arrowPoints`. The layout calculates node positions using the dependency structure rather than a simulation.
AI-generated descriptionDescription
This visualization builds a dependency graph based on dependencies between nodes (here, using an application ecosystem as example dataset).
This POC is based on a demo by Harry Love.
Note that the visualization "Application dependencies POC (Chord Diagram)" uses the same data structure, and thus provides a different view on the same data.
Data structure
Each item has:
- an id value (here using incremental numbers, but can be anything, as long as it is unique),
- a label (which is ideally not too long),
- a color code (which can be empty),
- and finally a dependency list: each other item that depends on this specific item and the strength of the link.
{
"items" : [
{
"id" : "0",
"label" : "Authentication",
"color" : "#440154ff",
"client" : {
"1" : 1, "2" : 1, "3" : 1, "4" : 1
}
},
{
"id" : "1",
"label" : "Lab",
"color" : "#31668dff",
"client" : { "4" : 2 }
},
{
"id" : "2",
"label" : "Sales Inventory",
"color" : "#37b578ff",
"client" : { "4" : 2 }
},
{
"id" : "3",
"label" : "HR",
"color" : "#fde725ff",
"client" : { "1" : 1 , "2" : 1 , "4" : 4 }
},
{
"id" : "4",
"label" : "Accounting",
"color" : "#ed4044ff",
"client" : {}
}
]
}
Technical details
The data is loaded from a JSON file using D3's JSON function.
d3.json("data.json").then(function(data) {
console.log(data);
});