/** * Create output */ function render($mode, &$renderer, $data) { global $conf; global $gr_ext; $gr_ext='png'; $grf_ext='.'.$gr_ext; if($data[1] == 'map' && strlen($data[0]) > 1) { if ( !is_dir($conf['mediadir'] . '/graphviz') ) io_mkdir_p($conf['mediadir'] . '/graphviz'); //Using dokuwiki framework $hash = md5(serialize($data)); $filename = $conf['mediadir'] . '/graphviz/'.$hash.$grf_ext; $url = ml('graphviz:'.$hash.$grf_ext); //Using dokuwiki framework //$renderer->doc .= '
valor filename=['.$filename.']
'; //$renderer->doc .= 'valor url=['.$url .']
'; // if already exist render if ( is_readable($filename) ) { // cached. // generate the map to variable $kk1 = "sed '1d'|sed '\$d'"; $cmd = "echo '$data[0]' | /usr/bin/dot -Tcmapx | ".$kk1; //$renderer->doc .= 'DSP-graph value cmd=>['.$cmd.']
'; //Debug cmd exec( $cmd, $map); //$renderer->doc .= 'valor map=['.$map .']
'; $maphtml = implode("\n",$map); // add the target - cant do this with DOT $maphtml = str_replace("doc .= ''; // Link the Image below with the map above by hash $renderer->doc .= ''; return true; } if (!$this->createImageMap($filename, $data[0], $data[1])) { // generate the map $kk1 = "sed '1d'|sed '\$d'"; $cmd = "echo '$data[0]' | /usr/bin/dot -Tcmapx | ".$kk1; //$renderer->doc .= 'CR-graph value cmd=>['.$cmd.']
'; //Debug cmd exec( $cmd, $map); $maphtml= implode("\n",$map); // add the target - cant do this with DOT $maphtml=str_replace("doc .= ''; // Link the Image below with the map above by hash $renderer->doc .= ''; } else { $renderer->doc .= '**ERROR RENDERING GRAPHVIZ**'; } return true; }