Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
$graph = new Fhaculty\Graph\Graph();
$blue = $graph->createVertex('blue');
$blue->setAttribute('graphviz.color', 'blue');
$red = $graph->createVertex('red');
$red->setAttribute('graphviz.color', 'red');
$edge = $blue->createEdgeTo($red);
$edge->setAttribute('graphviz.color', 'grey');
$graphviz = new Graphp\GraphViz\GraphViz();
$graphviz->display($graph);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,25 @@
<?php
// $ php -S localhost:8080 examples/02-html.php
require __DIR__ . '/../vendor/autoload.php';
$graph = new Fhaculty\Graph\Graph();
$graph->setAttribute('graphviz.graph.rankdir', 'LR');
$hello = $graph->createVertex('hello');
$world = $graph->createVertex('wörld');
$hello->createEdgeTo($world);
$graphviz = new Graphp\GraphViz\GraphViz();
$graphviz->setFormat('svg');
echo '<!DOCTYPE html>
<html>
<head>
<title>hello wörld</title>
<body>
' . $graphviz->createImageHtml($graph) . '
</body>
</html>
';

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,30 @@
<?php
use Graphp\GraphViz\GraphViz;
require __DIR__ . '/../vendor/autoload.php';
$graph = new Fhaculty\Graph\Graph();
$a = $graph->createVertex('Entity');
$a->setAttribute('graphviz.shape', 'none');
$a->setAttribute('graphviz.label', GraphViz::raw('<
<table cellspacing="0" border="0" cellborder="1">
<tr><td bgcolor="#eeeeee"><b>\N</b></td></tr>
<tr><td></td></tr><tr>
<td>+ touch()</td></tr>
</table>>'));
$b = $graph->createVertex('Block');
$b->createEdgeTo($a);
$b->setAttribute('graphviz.shape', 'none');
$b->setAttribute('graphviz.label', GraphViz::raw('<
<table cellspacing="0" border="0" cellborder="1">
<tr><td bgcolor="#eeeeee"><b>\N</b></td></tr>
<tr><td>- size:int</td></tr>
<tr><td>+ touch()</td></tr>
</table>>'));
$graphviz = new GraphViz();
echo $graphviz->createScript($graph);
$graphviz->display($graph);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,20 @@
<?php
use Graphp\GraphViz\GraphViz;
require __DIR__ . '/../vendor/autoload.php';
$graph = new Fhaculty\Graph\Graph();
$a = $graph->createVertex('Entity');
$a->setAttribute('graphviz.shape', 'record');
$a->setAttribute('graphviz.label', GraphViz::raw('"{\N||+ touch()}"'));
$b = $graph->createVertex('Block');
$b->createEdgeTo($a);
$b->setAttribute('graphviz.shape', 'record');
$b->setAttribute('graphviz.label', GraphViz::raw('"{\N|- size:int|+ touch()}"'));
$graphviz = new GraphViz();
echo $graphviz->createScript($graph);
$graphviz->display($graph);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -0,0 +1,24 @@
<?php
use Graphp\GraphViz\GraphViz;
require __DIR__ . '/../vendor/autoload.php';
$graph = new Fhaculty\Graph\Graph();
$a = $graph->createVertex();
$a->setAttribute('graphviz.shape', 'Mrecord');
$a->setAttribute('graphviz.label', GraphViz::raw('"<f0> left |<middle> middle |<f2> right"'));
$b = $graph->createVertex();
$b->setAttribute('graphviz.shape', 'Mrecord');
$b->setAttribute('graphviz.label', GraphViz::raw('"<f0> left |<f1> middle |<right> right"'));
// a:middle -> b:right
$edge = $a->createEdgeTo($b);
$edge->setAttribute('graphviz.tailport', 'middle');
$edge->setAttribute('graphviz.headport', 'right');
$graphviz = new GraphViz();
echo $graphviz->createScript($graph);
$graphviz->display($graph);

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB