":">")
.""
."". PHP_EOL;
}
}
function add_edge($from, $to, $color) {
global $format;
if ($format == "html") {
// echo "graph.newEdge(nodes[\"$from\"], nodes['$to'], {color: '$color'});" . PHP_EOL;
}
if ($format == "dot") {
echo "\"$from\" -> \"$to\" ".($color != ""? "[color=$color]":"").";". PHP_EOL;
}
if ($format == "gexf") {
echo "". PHP_EOL;
}
}
if ($format == "gexf") {
//header('Content-Type: text/xml');
header('Content-Type: application/gexf+xml');
echo '
Gexf.net
A hello world! file
'. PHP_EOL;
}
if ($format == "dot") {
echo 'digraph g {'. PHP_EOL;
}
$db = $server->get_db('disclosr-agencies');
add_node("fedg","Federal Government - Commonwealth of Australia");
try {
$rows = $db->get_view("app", "byCanonicalName", null, true)->rows;
//print_r($rows);
foreach ($rows as $row) {
add_node($row->id, $row->value->name);
}
} catch (SetteeRestClientException $e) {
setteErrorHandler($e);
}
if ($format == "gexf") {
echo '
'. PHP_EOL;
}
try {
$rows = $db->get_view("app", "byDeptStateName", null, true)->rows;
//print_r($rows);
foreach ($rows as $row) {
add_edge("fedg", $row->value, 'yellow');
}
} catch (SetteeRestClientException $e) {
setteErrorHandler($e);
}
try {
$rows = $db->get_view("app", "parentOrgs", null, true)->rows;
// print_r($rows);
foreach ($rows as $row) {
add_edge($row->key, $row->value, 'blue');
}
} catch (SetteeRestClientException $e) {
setteErrorHandler($e);
}
if ($format == "html") {
?>
'. PHP_EOL;
}
//include_footer();
?>