PHPackages                             innmind/graphviz - 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. innmind/graphviz

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

innmind/graphviz
================

Graphviz abstraction

5.0.0(4mo ago)259.5k↓59.7%14MITPHPPHP ~8.4CI passing

Since Nov 26Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Graphviz)[ Packagist](https://packagist.org/packages/innmind/graphviz)[ Docs](http://github.com/Innmind/Graphviz)[ RSS](/packages/innmind-graphviz/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (5)Dependencies (7)Versions (22)Used By (4)

Graphviz
========

[](#graphviz)

[![CI](https://github.com/Innmind/Graphviz/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Innmind/Graphviz/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/c48d7f91545c60ab265dfbd03d90d1f2aafa6bffaad9b905469df0557c70258e/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f677261706876697a2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/graphviz)[![Type Coverage](https://camo.githubusercontent.com/123e90efc712274c9fb810d55897a7de1cd37092859ea47e7b4558936675aca5/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f677261706876697a2f636f7665726167652e737667)](https://shepherd.dev/github/innmind/graphviz)

Graphviz model to help build graphs. This model goal is to express the possibilities offered by Graphviz (though note that all features are not implemented).

All objects of this package are immutable.

Important

You must use [`vimeo/psalm`](https://packagist.org/packages/vimeo/psalm) to make sure you use this library correctly.

Installation
------------

[](#installation)

```
composer require innmind/graphviz
```

Usage
-----

[](#usage)

```
use Innmind\Graphviz\{
    Layout\Dot,
    Graph,
    Node,
    Node\Shape,
};
use Innmind\Url\Url;
use Innmind\Colour\Colour;
use Innmind\OperatingSystem\Factory;
use Innmind\Server\Control\Server\Command;

$dot = Dot::of();
$clusterOne = Graph::directed('one')
    ->target(Url::of('http://example.com'))
    ->displayAs('One')
    ->fillWithColor(Colour::blue->toRGBA())
    ->add($one = Node::named('one'));
$clusterTwo = Graph::directed('two')
    ->fillWithColor(Colour::red->toRGBA())
    ->add($two = Node::named('two'));
$clusterThree = Graph::directed('three')
    ->add($three = Node::named('three'));

$root = Node::named('root')
    ->shaped(Shape::house())
    ->linkedTo($one->name())
    ->linkedTo($two->name());

$graph = Graph::directed()
    ->add($root)
    ->add($one->linkedTo($three->name()))
    ->add($two->linkedTo($three->name()))
    ->cluster($clusterOne)
    ->cluster($clusterTwo)
    ->cluster($clusterThree);

$output = $dot($graph);

Factory::build()
    ->control()
    ->processes()
    ->execute(
        Command::foreground('dot')
            ->withShortOption('Tsvg')
            ->withShortOption('o', 'graph.svg')
            ->withInput($output),
    )
    ->unwrap()
    ->wait();
```

This example will produce the given svg file: ([source](graph.dot))

[![](graph.svg)](graph.svg)

Note

This example uses [`innmind/operating-system`](https://packagist.org/packages/innmind/operating-system).

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.3% 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 ~187 days

Recently: every ~286 days

Total

17

Last Release

146d ago

Major Versions

1.2.3 → 2.0.02020-01-07

2.1.0 → 3.0.02022-03-20

3.4.0 → 4.0.02025-04-18

4.0.0 → 5.0.02026-02-07

PHP version history (6 changes)1.0.0PHP ~7.1

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

3.3.0PHP ~8.2

5.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (170 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")

---

Tags

graphvizgraphviz-dot

### Embed Badge

![Health badge](/badges/innmind-graphviz/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-graphviz/health.svg)](https://phpackages.com/packages/innmind-graphviz)
```

PHPackages © 2026

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