Commit 46ce3feb authored by S Anand's avatar S Anand

BUG: .aspect works on SVG with % size, viewBox

parent 37a48bc1
......@@ -398,9 +398,11 @@ _G_network.force = function() {
self.draw = function(svg) {
svg = d3.select(svg)
// TODO: find better way to get the SVG-space dimensions
var width = +svg.attr('width'),
height = +svg.attr('height'),
var svg_node = svg.node(),
viewbox = svg_node.viewBox.baseVal,
size = svg_node.getBoundingClientRect(),
width = viewbox.width || size.width,
height = viewbox.height || size.height,
enter
force.size([width, height])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment