Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:grapher-php [2020/10/09 15:15] – bab | dev:grapher-php [2020/11/01 15:59] (current) – bab | ||
---|---|---|---|
Line 256: | Line 256: | ||
fwrite($fh, " | fwrite($fh, " | ||
+ | fwrite($fh, " | ||
fwrite($fh, " | fwrite($fh, " | ||
node [shape = \" | node [shape = \" | ||
edge [arrowsize=2, | edge [arrowsize=2, | ||
+ | root=\" | ||
+ | |||
+ | subgraph corporations { | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | } | ||
+ | |||
+ | subgraph leaks { | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | } | ||
+ | |||
+ | subgraph countries { | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | \" | ||
+ | |||
+ | } | ||
\n"); | \n"); | ||
Line 395: | Line 419: | ||
$pages =& $data[' | $pages =& $data[' | ||
$media =& $data[' | $media =& $data[' | ||
- | $output = ''; | + | $root_name = array_values($pages)[0][" |
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
$i=0; | $i=0; | ||
// create all nodes first | // create all nodes first | ||
Line 406: | Line 434: | ||
$output .= '" | $output .= '" | ||
$output .= '" | $output .= '" | ||
- | $output .= '" | + | $output .= '" |
- | $output .= '" | + | |
+ | { | ||
+ | $path = explode (":", | ||
+ | $file = count($path ); | ||
+ | $folder=""; | ||
+ | for($n=0 ; $n < $file-1 ; $n++) | ||
+ | { | ||
+ | $folder = $folder . $path[$n] . "/"; | ||
+ | } | ||
+ | $output .= ',"img" : "'. DOKU_INC. " | ||
+ | } | ||
// $output .= '" | // $output .= '" | ||
// $output .= '" | // $output .= '" | ||
$output .= " | $output .= " | ||
- | if ($i < count($pages)) $output .= ','; | + | if ($i <= count($pages)-1) $output .= ','; |
| | ||
} | } | ||
Line 426: | Line 464: | ||
$output .= '{ | $output .= '{ | ||
- | "from": "' | + | "source": "' |
- | "to": "' | + | "target": "' |
- | " | + | " |
}'; | }'; | ||
$cnt++; | $cnt++; | ||
Line 434: | Line 472: | ||
} | } | ||
+ | |||
| | ||
$output .= " ] }"; | $output .= " ] }"; | ||
Line 444: | Line 483: | ||
$grapher = new Grapher(); | $grapher = new Grapher(); | ||
$grapher-> | $grapher-> | ||
+ | |||
</ | </ |