-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy path11-uml-html.php
More file actions
30 lines (24 loc) · 885 Bytes
/
11-uml-html.php
File metadata and controls
30 lines (24 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Graphp\GraphViz\GraphViz;
require __DIR__ . '/../vendor/autoload.php';
$graph = new Graphp\Graph\Graph();
$a = $graph->createVertex()->setAttribute('id', 'Entity');
$a->setAttribute('graphviz.shape', 'none');
$a->setAttribute('graphviz.label_html', '
<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()->setAttribute('id', 'Block');
$graph->createEdgeDirected($b, $a);
$b->setAttribute('graphviz.shape', 'none');
$b->setAttribute('graphviz.label_html', '
<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);