Commit a16b38a9 by Zachary Tong

Auto-scale svg with viewport

parent a3c8b095
...@@ -313,8 +313,9 @@ angular.module('kibana.map2', []) ...@@ -313,8 +313,9 @@ angular.module('kibana.map2', [])
//create the new svg //create the new svg
scope.svg = d3.select(elem[0]).append("svg") scope.svg = d3.select(elem[0]).append("svg")
.attr("width", width) .attr("width", "100%")
.attr("height", height) .attr("height", "100%")
.attr("viewBox", "0 0 " + width + " " + height)
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")") .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
.call(scope.zoom); .call(scope.zoom);
scope.g = scope.svg.append("g"); scope.g = scope.svg.append("g");
......
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