32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
<script>
|
|
|
|
// load all device connections into neighbors_data dictionary
|
|
$.getJSON('[% uri_for('/ajax/data/device/netmap') %]', function(data) {
|
|
function resizeGraphContainer() {
|
|
setTimeout(function(){
|
|
var graph = jQuery('#netmap_pane');
|
|
var toc = jQuery('#dw__toc');
|
|
netmap_pane.width(
|
|
parseInt(graph.parent().css('width')) -
|
|
( toc.css('float') === 'right' && parseInt(toc.css('height')) > 30 ? parseInt(toc.css('width')) : 0 )
|
|
).resume();
|
|
}, 500)
|
|
}
|
|
|
|
jQuery(document).ready(function() {
|
|
window.netmap_pane = netGobrechtsD3Force('netmap_pane')
|
|
.debug(true)
|
|
// .lassoMode(true)
|
|
.start(data);
|
|
jQuery(window).on("resize", resizeGraphContainer);
|
|
// jQuery('#dw__toc h3').on("click", resizeGraphContainer);
|
|
$('#nd_waiting').hide();
|
|
resizeGraphContainer();
|
|
});
|
|
}); // jquery getJSON for all connections
|
|
|
|
// vim: ft=javascript
|
|
</script>
|
|
|
|
<div id="nd_waiting" class="span2 alert"><i class="icon-spinner icon-spin"></i> Waiting for results...</div>
|