@@ -65,7 +65,7 @@ Blog post: [https://not-a-number.io/2018/phptree-a-fast-tree-implementation](htt
65
65
declare(strict_types = 1);
66
66
67
67
use drupol\phptree\Exporter\Gv;
68
- use drupol\phptree\Exporter\GvConvert ;
68
+ use drupol\phptree\Exporter\Image ;
69
69
use drupol\phptree\Node\ValueNode;
70
70
use drupol\phptree\Exporter\Text;
71
71
use drupol\launcher\Launcher;
@@ -77,7 +77,7 @@ $tree = new ValueNode('root', 2);
77
77
78
78
$nodes = [];
79
79
foreach (\range('A', 'Z') as $v) {
80
- $nodes[] = new ValueNode($v);
80
+ $nodes[] = new ValueNode($v, 2 );
81
81
}
82
82
83
83
// Add children to the root node.
@@ -93,8 +93,8 @@ $dotScript = $exporter->export($tree);
93
93
file_put_contents('graph.gv', $dotScript);
94
94
// Then do "dot -Tsvg graph.gv -o graph.svg" to export the script to SVG.
95
95
96
- // Or use GvConvert() that does it for you.
97
- $exporter = new GvConvert ();
96
+ // Or use the image converter that does it for you.
97
+ $exporter = new Image ();
98
98
$imagePath = $exporter->setFormat('png')->export($tree);
99
99
100
100
// If you want to launch the image, you can use an optional package.
0 commit comments