add help for netmap

This commit is contained in:
Oliver Gorwits
2012-12-04 23:50:17 +00:00
parent 9ebd1d1b7d
commit b83a5d055d
3 changed files with 22 additions and 9 deletions

View File

@@ -5,12 +5,6 @@ body {
padding-top: 50px;
}
/* TODO
::selection {
background: transparent;
}
*/
/* magnifying glass icon for search box */
.navbar_icon {
vertical-align: sub;

View File

@@ -1,7 +1,25 @@
<div id="netmaphelp" style="text-align: center;">
<button
class="btn btn-small btn-info" rel="popover"
data-title="Neighbor Map Controls"
data-html="true"
data-content="
<ul>
<li>Click and drag to pan</li>
<li>Mouse-wheel scroll to zoom</li>
<li>Hover to hightlight neighbors</li>
<li>Click to view device's map</li>
</ul>"
data-placement='top' data-trigger='click'>
Help
</button>
</div>
<script>
var winHeight = window.innerHeight;
var winWidth = window.innerWidth;
var helpHeight = document.getElementById("netmaphelp").getBoundingClientRect().height;
var tree = d3.layout.tree()
.size([360, winHeight])
@@ -20,9 +38,9 @@ var loc = {};
var neighbors_data = {};
// main SVG background, with support for pan/zoom
var svg = d3.select("#netmap_pane").append("svg")
var svg = d3.select("#netmap_pane").insert("svg", "#netmaphelp")
.attr("width", winWidth - 50)
.attr("height", winHeight - 100)
.attr("height", winHeight - (110 + helpHeight))
.attr("pointer-events", "all")
.append('g')
.call(d3.behavior.zoom().on("zoom", redraw))

View File

@@ -72,8 +72,9 @@
}
});
// activate tooltips
// activate tooltips and popovers
$("[rel=tooltip]").tooltip({live: true});
$("[rel=popover]").popover({live: true});
}
$(document).ready(function() {