Skip to content

Commit 966b1ee

Browse files
committed
Update README code example.
1 parent 63a4e73 commit 966b1ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Blog post: [https://not-a-number.io/2018/phptree-a-fast-tree-implementation](htt
6565
declare(strict_types = 1);
6666

6767
use drupol\phptree\Exporter\Gv;
68-
use drupol\phptree\Exporter\GvConvert;
68+
use drupol\phptree\Exporter\Image;
6969
use drupol\phptree\Node\ValueNode;
7070
use drupol\phptree\Exporter\Text;
7171
use drupol\launcher\Launcher;
@@ -77,7 +77,7 @@ $tree = new ValueNode('root', 2);
7777

7878
$nodes = [];
7979
foreach (\range('A', 'Z') as $v) {
80-
$nodes[] = new ValueNode($v);
80+
$nodes[] = new ValueNode($v, 2);
8181
}
8282

8383
// Add children to the root node.
@@ -93,8 +93,8 @@ $dotScript = $exporter->export($tree);
9393
file_put_contents('graph.gv', $dotScript);
9494
// Then do "dot -Tsvg graph.gv -o graph.svg" to export the script to SVG.
9595

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();
9898
$imagePath = $exporter->setFormat('png')->export($tree);
9999

100100
// If you want to launch the image, you can use an optional package.

0 commit comments

Comments
 (0)