2013-07-26 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/networkmap.dinamic.php: added default zoom buttom. * images/zoom_default.svg: the default buttom. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8584 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0c2f87b908
commit
56324735f2
|
@ -1,3 +1,10 @@
|
|||
2013-07-26 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/agentes/networkmap.dinamic.php: added default zoom
|
||||
buttom.
|
||||
|
||||
* images/zoom_default.svg: the default buttom.
|
||||
|
||||
2013-07-26 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_networkmap.php,
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<svg>
|
||||
<g
|
||||
id="zoom_default">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3031"
|
||||
d="m 46.42857,11.428571 a 23.214285,11.428571 0 0 1 -46.42857,0 23.214285,11.428571 0 1 1 46.42857,0 z" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:16px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
x="16.860435"
|
||||
y="17.624054"
|
||||
id="text3227"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3229"
|
||||
x="16.860435"
|
||||
y="17.624054">D</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 696 B |
|
@ -43,6 +43,14 @@ $graph = networkmap_generate_hash(__('Pandora FMS'), $group, $simple,
|
|||
html_debug_print($graph, true);
|
||||
networkmap_print_jsdata($graph);
|
||||
|
||||
$zoom_default = file($config['homedir'] . '/images/zoom_default.svg');
|
||||
?>
|
||||
<div style="display: none">
|
||||
<?php
|
||||
echo implode("\n", $zoom_default);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
//html_debug_print($graph);
|
||||
echo '<script type="text/javascript" src="' . $config['homeurl'] . 'include/javascript/d3.v3.js" charset="utf-8"></script>';
|
||||
|
@ -111,7 +119,23 @@ var svg = d3.select("#dinamic_networkmap").append("svg")
|
|||
.attr("height", height)
|
||||
.attr("pointer-events", "all")
|
||||
.call(zoom_obj)
|
||||
.append('svg:g');
|
||||
.append('svg:g')
|
||||
|
||||
|
||||
///Added default zoom buttom
|
||||
d3.select("#dinamic_networkmap svg")
|
||||
.append("g")
|
||||
.attr("id", "zoom_control");
|
||||
|
||||
zoom_default = $("#zoom_default").clone();
|
||||
$("#zoom_default").remove();
|
||||
|
||||
$("#zoom_control").append(zoom_default);
|
||||
|
||||
d3.select("#zoom_default")
|
||||
.on("click", click_zoom_default)
|
||||
.on("mouseover", over_zoom_default)
|
||||
.on("mouseout", out_zoom_default);
|
||||
|
||||
force
|
||||
.nodes(graph.nodes)
|
||||
|
@ -167,6 +191,14 @@ node.attr("cx", function(d) { return d.x; })
|
|||
.attr("cy", function(d) { return d.y; });
|
||||
});
|
||||
|
||||
function click_zoom_default() {
|
||||
zoom([0, 0], 1);
|
||||
}
|
||||
function over_zoom_default() {
|
||||
}
|
||||
function out_zoom_default() {
|
||||
}
|
||||
|
||||
function over(d) {
|
||||
$("#node_" + d.id).attr('class', 'select_node');
|
||||
$.each($(".source_" + d.id), function(i, line) {
|
||||
|
@ -222,6 +254,13 @@ function zoom(translate_param, scale_param) {
|
|||
scale = d3.event.scale;
|
||||
translate = d3.event.translate;
|
||||
}
|
||||
else {
|
||||
translate = translate_param;
|
||||
scale = scale_param;
|
||||
|
||||
zoom_obj.setScale(scale);
|
||||
zoom_obj.setTranslate(translate);
|
||||
}
|
||||
|
||||
svg.attr("transform", "translate(" + translate + ")scale(" + scale + ")");
|
||||
}
|
||||
|
@ -276,8 +315,6 @@ function show_tooltip(d) {
|
|||
|
||||
create_tooltip(d, x, y);
|
||||
|
||||
console.log(d.id);
|
||||
|
||||
graph.nodes[d.id].tooltip_content = data;
|
||||
graph.nodes[d.id].default_tooltip = 0;
|
||||
$("#tooltip_networkmap").html(data);
|
||||
|
|
Loading…
Reference in New Issue