PHPackages                             markfullmer/dependency\_tree - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. markfullmer/dependency\_tree

ActiveProject[Utility &amp; Helpers](/categories/utility)

markfullmer/dependency\_tree
============================

Generate a Composer dependency tree visualization

1.0.1(5y ago)08.2kMITJavaScript

Since Mar 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/markfullmer/dependency_tree)[ Packagist](https://packagist.org/packages/markfullmer/dependency_tree)[ RSS](/packages/markfullmer-dependency-tree/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Composer dependency tree visualization
======================================

[](#composer-dependency-tree-visualization)

This is a simple PHP library that will take a standard `composer.json` file and `composer.lock` file and generate a dependency tree, using the [D3JS](https://d3js.org/) visualization known as the [collapsible tree](https://observablehq.com/@d3/collapsible-tree).

Contents
--------

[](#contents)

- [Demonstration](#demo)
- [Simple tree](#simple-tree)
- [Complex tree](#complex-tree)
- [Basic usage](#basic-usage)
- [Similar libraries](#similar-libraries)
- [Drupal integration](#drupal-integration)

Demo
----

[](#demo)

Full demo at

Simple tree
-----------

[](#simple-tree)

[![Screenshot of dependency tree](composer-dependency-tree.png)](composer-dependency-tree.png)

Complex tree
------------

[](#complex-tree)

[![Screenshot of complex dependency tree](complex-composer-dependency-tree.jpg)](complex-composer-dependency-tree.jpg)

Basic usage
-----------

[](#basic-usage)

1. Require this library to your PHP project:

```
composer require markfullmer/dependency_tree
```

2. Ensure the library is autoloaded in your PHP file:

```
use markfullmer\DependencyTree;
```

3. Copy or reference the `d3.dependencyTree.js` file from this library into your project and load it into a web page, along with the underlying [D3JS](https://d3js.org/) API library.

```

```

3. Supply the contents of `composer.json` and `composer.lock` files as arguments and generate the tree. (Change the third parameter to `TRUE` to print version information.)

```
  $data = DependencyTree::generateTree($root, $lock, FALSE);
```

4. Render the resulting data via Javascript, supplying the data and an HTML target ID.

```
  echo '

      dependencyTree('. $data .');

  ';
```

Similar libraries
-----------------

[](#similar-libraries)

-  : "This experiment visualizes package dependencies using an interactive disc. Each disc section represents a dependency, and links between arcs materialize these dependencies."
-  : "Graph visualization for your project's `composer.json` and its dependencies"

Drupal integration
------------------

[](#drupal-integration)

A Drupal module that provides this functionality to sites directly is available at [https://drupal.org/project/composer\_dependency\_tree](https://drupal.org/project/composer_dependency_tree)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1900d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97841a43aa432072be5449d3a5a32869c123982b174cb8c1b7eb2010181e8949?d=identicon)[markfullmer](/maintainers/markfullmer)

---

Top Contributors

[![markfullmer](https://avatars.githubusercontent.com/u/4305692?v=4)](https://github.com/markfullmer "markfullmer (12 commits)")[![jmf3658](https://avatars.githubusercontent.com/u/34824280?v=4)](https://github.com/jmf3658 "jmf3658 (4 commits)")

---

Tags

composerd3jsdependency-graphphp

### Embed Badge

![Health badge](/badges/markfullmer-dependency-tree/health.svg)

```
[![Health](https://phpackages.com/badges/markfullmer-dependency-tree/health.svg)](https://phpackages.com/packages/markfullmer-dependency-tree)
```

###  Alternatives

[zhelyabuzhsky/yii2-sitemap

A Yii2 tool to generate sitemap.xml.

3439.7k](/packages/zhelyabuzhsky-yii2-sitemap)[amplifier/yii-amqp

AMQP adapter for Yii

2237.0k](/packages/amplifier-yii-amqp)[bigfork/htmleditorsrcset

Simple srcset integration with SilverStripe’s HTMLEditorField

1025.4k4](/packages/bigfork-htmleditorsrcset)[anasstouaticoder/magento2-module-instantconfigurationcopy

The InstantConfigurationCopy module provides easy way to copy configuration field information for admin in back office Magento 2.

163.8k](/packages/anasstouaticoder-magento2-module-instantconfigurationcopy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
