Skip to main content
100%

Directed cyclic dependency graph (POC)

✓ Published0🌍 Public
JJoris Schelfaut
Last edited Sep 10, 2023
Created on Sep 10, 2023

This visualization presents a directed cyclic dependency graph, using an application ecosystem as its sample dataset. Nodes are arranged in a circular layout, with arrows indicating dependencies between items, where the target node depends on the source. The graph is rendered as an SVG using D3 v5, leveraging the `d3.json` function to load the data and custom functions like `d3.linkVertical()` to draw curved, arrow-headed paths. Node positions and colors are computed from the data structure, and an interactive event object is prepared but not fully utilized in this proof of concept.

AI-generated description

Description

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);
});
MIT Licensed

Similar vizzes

Loading thumbnail…

D3 Bi-directional Drag and Zoom Tree on D3 development

This example visualizes the dependency structure of D3 development using a bi-directional tree: upward branches show D3's own dependencies (derived from package.json and bower.json files), while downward branches show projects that depend on D3. The visualization is built with D3 v3 and React, using SVG rendering with animation. The tree uses distinct styling for each direction—green upward links and nodes for D3's dependencies, and brown for dependent repos. Zooming is activated via mouse scrolling, and nodes can be dragged to explore the hierarchy. A "Click to unfold/expand all" label toggles all branches, and recurring nodes are highlighted with a thicker stroke. The data was generated by crawling package.json and bower.json files to map dependency relationships. _Generated by D3.js, MIT license_# D3 Bi-directional Drag and Zoom Tree on D3 Development This interactive tree visualization maps the complete dependency network surrounding D3.js, rendered with D3 v3 and React. The chart extends bidirectionally from a central D3 node: **upward branches** show libraries that D3 depends on (crawled from package.json and bower.json files), while **downward branches** display projects that depend on D3. Each node includes the repository path and creation year, with recurring dependencies highlighted with a thicker stroke and "Recurring" label. The tree supports mouse-wheel zooming, click-to-expand/collapse for all branches, and panning via drag. Color-coded links (green for upward dependencies, brown for downward dependents) visually separate the two directions from the central node. Node sizes and link lengths adapt to show the relationship hierarchy, with a 200ms animation for smooth transitions. The visualization was built with D3 v3 and is implemented as a reusable treeChart object. The dataset is obtained by crawling package.json and bower.json files from GitHub repos to find dependencies related to D3 development, with upward branches representing D3's direct and indirect dependencies, and downward branches showing dependent repos and their children. Each node displays the repository path and creation year; nodes labeled "Recurring" indicate a repo that appeared earlier in the hierarchy and will not generate further branches. The layout uses both upward and downward trees with distinct color coding: brown for downward dependents and green for upward dependencies, with the central node labeled "D3 Development Dependency". Interaction is designed with zooming on mouse scroll, dragging to pan, and right-click disabled for smooth dragging. forked from <a href='http://bl.ocks.org/mayblue9/'>mayblue9</a>'s block: <a href='http://bl.ocks.org/mayblue9/22cfd2147116bc18ccfec9f9615ca3d2'>D3 Bi-directional Drag and Zoom Tree on D3 development </a> Please write the caption for this entry. Format: **Title** Caption Note: Do not use the title in caption. Only one sentence. Must be short and concise. Must not have any markdowm formatting. Do not include any extra information.A bi-directional tree visualization of D3.js development dependencies, with upward branches showing upstream repos and downward branches showing dependent projects, featuring drag, zoom, and recurring-node highlighting.

663anp3ca
69% match