PHPackages                             ray/object-visual-grapher - 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. ray/object-visual-grapher

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

ray/object-visual-grapher
=========================

A visual graph generator for Ray.Di object dependency graphs

1.0.0(6y ago)7463.3k↓16.7%1MITPHPPHP &gt;=7.1.0CI passing

Since Jan 17Pushed 3w ago1 watchersCompare

[ Source](https://github.com/ray-di/Ray.ObjectGrapher)[ Packagist](https://packagist.org/packages/ray/object-visual-grapher)[ RSS](/packages/ray-object-visual-grapher/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (8)Versions (5)Used By (1)

Ray.ObjectGrapher
=================

[](#rayobjectgrapher)

*Using ObjectGrapher to visualize Ray.Di applications*

[![fake](https://user-images.githubusercontent.com/529021/72650686-866ec100-39c4-11ea-8b49-2d86d991dc6d.png)](https://user-images.githubusercontent.com/529021/72650686-866ec100-39c4-11ea-8b49-2d86d991dc6d.png)

Grapher
-------

[](#grapher)

When you've written a sophisticated application, [Ray.Di](https://github.com/ray-di/Ray.Di)'s rich introspection API can describe the object graph in detail. This grapher exposes this data as an easily understandable visualization. It can show the bindings and dependencies from several classes in a complex application in a unified diagram.

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

[](#installation)

You can install the ObjectGrapher with composer:

```
composer --dev require ray/object-visual-grapher

```

### Generating a .dot file

[](#generating-a-dot-file)

Ray.Di's grapher leans heavily on [GraphViz](http://www.graphviz.org/), an open source graph visualization package. It cleanly separates graph specification from visualization and layout. To produce a graph `.dot` file for an `Injector`, you can use the following code:

```
use Ray\ObjectGrapher\ObjectGrapher;

$dot = (new ObjectGrapher)(new FooModule);
file_put_contents('path/to/file', $dot);
```

### The .dot file

[](#the-dot-file)

Executing the code above produces a `.dot` file that specifies a graph. Each entry in the file represents either a node or an edge in the graph. Here's a sample `.dot` file:

```
digraph injector {
graph [rankdir=TB];
dependency_BEAR_Resource_ResourceInterface_ [style=dashed, margin=0.02, label=BEAR\\Resource\\ResourceInterface>, shape=box]
dependency_BEAR_Resource_FactoryInterface_ [style=dashed, margin=0.02, label=BEAR\\Resource\\FactoryInterface>, shape=box]
dependency_BEAR_Resource_ResourceInterface_ -> class_BEAR_Resource_Resource [style=dashed, arrowtail=none, arrowhead=onormal]
dependency_BEAR_Resource_FactoryInterface_ -> class_BEAR_Resource_Factory [style=dashed, arrowtail=none, arrowhead=onormal]
```

### Rendering the .dot file

[](#rendering-the-dot-file)

Download a [Graphviz viewer](http://www.graphviz.org/) for your platform, and use it to render the `.dot` file.

On Linux, you can use the command-line `dot` tool to convert `.dot` files into images.

```
  dot -T png my_injector.dot > my_injector.png
```

#### Graph display

[](#graph-display)

Edges:

- **Solid edges** represent dependencies from implementations to the types they depend on.
- **Dashed edges** represent bindings from types to their implementations.
- **Double arrows** indicate that the binding or dependency is to a `Provider`.

Nodes:

- Implementation types are given *black backgrounds*.
- Implementation instances have *gray backgrounds*.

---

*This document is mostly taken from .*

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance62

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~153 days

Total

2

Last Release

2251d ago

Major Versions

0.1.0 → 1.0.02020-06-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/db4fc75ffc631168d0d7143b6f2c24b1534dfb921212bd851c026c5cbbb1344d?d=identicon)[koriym](/maintainers/koriym)

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (95 commits)")

---

Tags

dependency-injectionobject-graphobject-visualizerray-di

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ray-object-visual-grapher/health.svg)

```
[![Health](https://phpackages.com/badges/ray-object-visual-grapher/health.svg)](https://phpackages.com/packages/ray-object-visual-grapher)
```

###  Alternatives

[supervisorphp/configuration

Manage Supervisor configuration in PHP

39623.4k4](/packages/supervisorphp-configuration)[jfcherng-roundcube/show-folder-size

A Roundcube plugin which shows folder size.

2617.3k](/packages/jfcherng-roundcube-show-folder-size)[yireo/magento2-html-hints

N/A

191.3k](/packages/yireo-magento2-html-hints)

PHPackages © 2026

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