Working in the new networkmap.

This commit is contained in:
mdtrooper 2016-02-17 18:31:46 +01:00
parent fb3b4d8a6f
commit 6dbf6e18f2
4 changed files with 18 additions and 3 deletions

View File

@ -128,10 +128,16 @@ abstract class Map {
}
public function writeJSContants() {
$contants = array();
$contants["ITEM_TYPE_AGENT_NETWORKMAP"] = ITEM_TYPE_AGENT_NETWORKMAP;
$contants["ITEM_TYPE_MODULE_NETWORKMAP"] = ITEM_TYPE_MODULE_NETWORKMAP;
$contants["ITEM_TYPE_EDGE_NETWORKMAP"] = ITEM_TYPE_EDGE_NETWORKMAP;
?>
<script type="text/javascript">
<?php
foreach ($contants as $name => $value) {
echo "var $name = $value \n";
}
?>
</script>
<?php

View File

@ -104,7 +104,7 @@ class Networkmap extends Map {
$type = ITEM_TYPE_AGENT_NETWORKMAP;
}
$nodes[$graphviz_id] = array('id' => $id);
$nodes[$graphviz_id] = array('id' => $id, 'type' => $type);
}
}

View File

@ -31,6 +31,8 @@ MapController.prototype._marginConstant = 0; //To be beauty
MapController.prototype.init_map = function() {
var svg = d3.select("#map svg");
svg.append("g").append("circle")
.attr("id", "node_10")
.attr("class", "node")

View File

@ -17,4 +17,11 @@ var NetworkmapController = function(target) {
}
NetworkmapController.prototype = Object.create(MapController.prototype);
NetworkmapController.prototype.constructor = NetworkmapController;
NetworkmapController.prototype.constructor = NetworkmapController;
NetworkmapController.prototype.init_map = function() {
MapController.prototype.init_map.call(this);
};