2017 © Pedro Peláez
 

library php-graph

Create graphs

image

dono-sybrix/php-graph

Create graphs

  • Tuesday, October 13, 2015
  • by DonoSybrix
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,093 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

PHPGraph

PHPGraph allow you to create conditional graphs in PHP., (*1)

    // 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, '<', 1.90 )
        ->close()
        ->addConsequence('car_color', 'orange');

    $graph->link('Gender', 'Hall C')
        ->addCondition($user->size, '<', 1.60)
        ->addConsequence('car_color', 'yellow');

    // Get data (consequences executed, nodes visited, etc)
    $results = $graph->visit();

Installation

You need Composer installed :, (*2)

$ composer require dono-sybrix/php-graph

The Versions

13/10 2015

dev-master

9999999-dev

Create graphs

  Sources   Download

MIT

The Development Requires

by Avatar DonoSybrix

graph node condition consequence

13/10 2015

v0.0.2

0.0.2.0

Create graphs

  Sources   Download

MIT

The Development Requires

by Avatar DonoSybrix

graph node condition consequence

12/10 2015

v0.0.1

0.0.1.0

Create graphs

  Sources   Download

MIT

The Development Requires

by Avatar DonoSybrix

graph node condition consequence