diff --git a/html/force.css b/html/force.css index 3e0f28c..0a82b3b 100644 --- a/html/force.css +++ b/html/force.css @@ -14,8 +14,3 @@ line.link { #chart { } - -body { - padding: 0; - margin: 0; -} diff --git a/html/force.js b/html/force.js index 149d1fc..dca2406 100644 --- a/html/force.js +++ b/html/force.js @@ -1,5 +1,18 @@ -var w = window.innerWidth, - h = window.innerHeight - 10, +function getOffset( el ) { + var _x = 0; + var _y = 0; + while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) { + _x += el.offsetLeft - el.scrollLeft; + _y += el.offsetTop - el.scrollTop; + el = el.offsetParent; + } + return { top: _y, left: _x }; +} + +var offset = getOffset(document.getElementById('chart')); + +var w = window.innerWidth - offset.left, + h = window.innerHeight - offset.top - 24, fill = d3.scale.category20(); var vis = d3.select("#chart").append("svg") diff --git a/html/geomap.html b/html/geomap.html index 51d97b7..7b54570 100644 --- a/html/geomap.html +++ b/html/geomap.html @@ -3,36 +3,12 @@ diff --git a/html/nodes.html b/html/nodes.html index e8cd737..618dbd3 100644 --- a/html/nodes.html +++ b/html/nodes.html @@ -11,8 +11,7 @@