Improves php demo.

This commit is contained in:
Henning Dieterichs
2020-02-22 13:40:24 +01:00
parent 8824fa2599
commit 218f670528

View File

@@ -14,10 +14,12 @@ $visualize = function () use (&$graph) {
};
for ($i = 2; $i < 100; $i++) {
$targetId = "" . random_int(1, $i - 1);
// add a node
$id = "" . $i;
array_push($graph["nodes"], ["id" => $id, "label" => $id]);
// connects the node to a random edge
$targetId = "" . random_int(1, $i - 1);
array_push($graph["edges"], ["from" => $id, "to" => "" . $targetId]);
xdebug_break();