PHPackages                             dono-sybrix/php-graph - 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. dono-sybrix/php-graph

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

dono-sybrix/php-graph
=====================

Create graphs

v0.0.2(10y ago)13.1kMITPHP

Since Oct 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/DonoSybrix/PHPGraph)[ Packagist](https://packagist.org/packages/dono-sybrix/php-graph)[ RSS](/packages/dono-sybrix-php-graph/feed)WikiDiscussions master Synced 2d ago

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

PHPGraph
========

[](#phpgraph)

PHPGraph allow you to create conditional graphs in PHP.

```
    // Init a graph
    $graph = new \PHPGraph\Graph();

    // Create nodes
    $graph->createNode('Gender');
    $graph->createNode('Hall A');
    $graph->createNode('Hall B');
    $graph->createNode('Hall C');

    // Create links.
    $graph->link('Gender', 'Hall A')
        ->addCondition($user->size, '>=', 1.90)
        ->addConsequence('car_color', 'red');

    $graph->link('Gender', 'Hall B')
        ->createConditionGroup('&&')
            ->addCondition($user->size, '>', 1.60)
            ->addCondition($user->size, '
