From a16b38a91b9055ba06f9df0dda45ad52c111a6cc Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Mon, 15 Apr 2013 16:56:02 -0400 Subject: [PATCH] Auto-scale svg with viewport --- panels/map2/module.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/map2/module.js b/panels/map2/module.js index 39f16214e32..09428dd81b8 100644 --- a/panels/map2/module.js +++ b/panels/map2/module.js @@ -313,8 +313,9 @@ angular.module('kibana.map2', []) //create the new svg scope.svg = d3.select(elem[0]).append("svg") - .attr("width", width) - .attr("height", height) + .attr("width", "100%") + .attr("height", "100%") + .attr("viewBox", "0 0 " + width + " " + height) .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")") .call(scope.zoom); scope.g = scope.svg.append("g");