dono-sybrix/php-graph
最新稳定版本:v0.0.2
Composer 安装命令:
composer require dono-sybrix/php-graph
包简介
Create graphs
README 文档
README
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, '<', 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 :
$ composer require dono-sybrix/php-graph
统计信息
- 总下载量: 3.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-09