PHPackages                             osinet/grafizzi - 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. osinet/grafizzi

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

osinet/grafizzi
===============

A GraphViz generator for PHP. PEAR Image\_GraphViz rethought.

0.0.3(3y ago)26.2k↓46.2%1[1 issues](https://github.com/fgm/grafizzi/issues)LGPL-3.0+PHPPHP ^7.4 || ^8.1

Since Feb 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fgm/grafizzi)[ Packagist](https://packagist.org/packages/osinet/grafizzi)[ Docs](http://github.com/fgm/grafizzi)[ RSS](/packages/osinet-grafizzi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Grafizzi
========

[](#grafizzi)

Welcome to Grafizzi, a PHP wrapper for AT&amp;T GraphViz.

[![Build](https://github.com/fgm/grafizzi/actions/workflows/php.yml/badge.svg)](https://github.com/fgm/grafizzi/actions/workflows/php.yml)[![codecov](https://camo.githubusercontent.com/82239c36a1c26f2492c4a8833e42d177056071beb35c5f3c94e99e9596d3a0d0/68747470733a2f2f636f6465636f762e696f2f67682f66676d2f67726166697a7a692f67726170682f62616467652e7376673f746f6b656e3d415a534b38475a4d5038)](https://codecov.io/gh/fgm/grafizzi)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/f3dd14832643e2cfaaaa4fb1bc6d455e8e304b3972c396878ead9880bb02ee86/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66676d2f67726166697a7a692f6261646765732f7175616c6974792d73636f72652e706e673f733d39356365353762353238363131663166383938363836373266303465336166363562613733383031)](https://scrutinizer-ci.com/g/fgm/grafizzi/)[![FOSSA Status](https://camo.githubusercontent.com/911e8a4b8216ad2be3f597a65b54bfd313cf6e29002b1cb1eef8f1540540b6ad/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d25324666676d25324667726166697a7a692e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffgm%2Fgrafizzi?ref=badge_shield)

Using Grafizzi in your PHP GraphViz projects
--------------------------------------------

[](#using-grafizzi-in-your-php-graphviz-projects)

### Installing it in your project.

[](#installing-it-in-your-project)

```
$ composer require osinet/grafizzi
```

### Generating graphs with Grafizzi

[](#generating-graphs-with-grafizzi)

1. Create a Pimple instance, passing it an instance for your PSR/3 logger of choice (e.g. [Monolog](https://github.com/Seldaek/monolog)) in the `logger` key, and possibly other arguments like `directed` to specify if you want to build a directed graph.
2. Create a `Graph` instance, passing it the container.
3. Add `Subgraph`, `Node` and `Edge` instances to the graph using the `addChild()` method. Each of these take the container and an array of `Attribute` instances in their constructor, or you can add them using `setAttribute()` after construction. Attribute instances are reusable on multiple elements.
4. Invoke the `build()` method on the graph instance to obtain a string containing your Graphviz dot-file, which you can then output to a file or pipe to `dot`, `neato` or your Graphviz command of choice.
5. Optional: use a chain of `Filter` instances to filter the result, for example to run Graphviz from your PHP script (`DotFilter`), or "tee" it between a filter pipe and a string (`StringFilter`).

You can take inspiration from the examples provided in the `example/` directory:

- `example/hello_node.php` builds a minimal graph showing a lot of logging
- `example/grafizzi.php` builds a graph for the Grafizzi hierarchy of `Filter`classes.

Working on Grafizzi itself
--------------------------

[](#working-on-grafizzi-itself)

### Installing Grafizzi for development

[](#installing-grafizzi-for-development)

#### Obtain the Grafizzi sources

[](#obtain-the-grafizzi-sources)

The easiest way to get started is to clone the Git repository.

```
git clone https://github.com/fgm/grafizzi.git

```

#### Download the dependencies

[](#download-the-dependencies)

Once you have a clone of the Grafizzi repository, you need to install its development dependencies, using the Composer package dependency manager.

Download Composer following the instructions on

Then run:

```
php composer.phar install

```

Note that Grafizzi is available for PHP ≥ 8.2.

#### Check your System Configuration

[](#check-your-system-configuration)

Now make sure that your local system is properly configured for Grafizzi. To do this, execute:

```
php example/hello-node.php

```

You should see a detailed debug execution trace. On a POSIX system, you can get just the resulting GraphViz source by redirecting *stderr* to `/dev/null`:

```
php example/hello-node.php 2> /dev/null

```

You should see a very basic GraphViz source:

```
graph g {
  rankdir="TB";
  label="Some graph";

  n1 [ label="Some node" ];
  n2 [ label="Other node" ];
  n1 -- n2;
} /* /graph g */

```

If you get any warnings or recommendations, or nothing at all, check your PHP error log, and fix these now before moving on.

### Verifying the Grafizzi code

[](#verifying-the-grafizzi-code)

If your system includes the `make` command, after installing, run:

```
make lint

```

You should get a green bar with zero warnings.

### Generating documentation

[](#generating-documentation)

If your system includes the `make` and `doxygen' commands, and GraphViz itself, you can generate a fully indexed source documentation by running:

```
make docs

```

This will generate a HTML documentation with internal search engine in the doxygen/ directory. Use it by browsing to `doxygen/html/index.html`.

The documentation and search engine are even usable over `file:///` URLs, so you do not need a web server to access it.

### Running tests

[](#running-tests)

If you want to make sure that Grafizzi runs fine on your system, run:

```
make test

```

Note that the Composer installation in dev mode will have installed PHPunit in your `vendor` folder.

### Cleaning up

[](#cleaning-up)

You can remove `php_error.log`, the generated doxygen docs directory, the generated coverage reports, and many stray generated files by running:

```
make clean

```

This will not remove the `vendor/` directory.

Have fun!

License
-------

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/00d0493834048b017adbec1bdec8d734ce446dd21adfc220d1e5e8a203d5b01c/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d25324666676d25324667726166697a7a692e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffgm%2Fgrafizzi?ref=badge_large)

Changelog
---------

[](#changelog)

- 0.0.4:
    - Dropped all PHP ≤ 8.1 support, added PHP 8.3+ support
    - Upgraded to PHPUnit 11.2.x
    - examples renamed from `app/*` to `example/*`
    - Clean to PHPstan level 7
- 0.0.3:
    - Dropped PHP &lt; 7.4 support, added PHP 8.1+ support
    - Upgraded to PHPunit 9.5.x
    - Clean to PHPstan level 6
- 0.0.2:
    - Dropped PHP 5.x support, upgraded to PHP 7.2/7.3
    - Upgraded to PHPUnit 8.x
- 0.0.1:
    - Removed runtime dependency on Monolog
    - Upgraded to PHP/PHPunit 5.x.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~970 days

Total

3

Last Release

1446d ago

PHP version history (3 changes)0.0.1PHP &gt;=5.4.0

0.0.2PHP ^7.2

0.0.3PHP ^7.4 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/71aaa3a88679f828a7bc64acf1a235d392f38a97f5fe25dd6849813ef9306e33?d=identicon)[FGM](/maintainers/FGM)

---

Top Contributors

[![fgm](https://avatars.githubusercontent.com/u/143311?v=4)](https://github.com/fgm "fgm (111 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

graphvizgraphviz-sourcephpdotgraphvizforce-directed graphneatofdpsfdpcircotwopiImage-GraphViz

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/osinet-grafizzi/health.svg)

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

###  Alternatives

[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

720359.1M86](/packages/dflydev-dot-access-data)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[graphp/graphviz

GraphViz graph drawing for the mathematical graph/network library GraPHP.

3232.1M49](/packages/graphp-graphviz)[alom/graphviz

Graphviz generation for PHP

74651.4k9](/packages/alom-graphviz)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[innmind/object-graph

Extract object graph out of a root object

242.8k7](/packages/innmind-object-graph)

PHPackages © 2026

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