From 8fcc0f363989afebb691f97c65c2df87a21f5562 Mon Sep 17 00:00:00 2001 From: luigser Date: Fri, 6 Nov 2015 17:19:52 +0100 Subject: [PATCH] treeview bug fixing --- datalets/treemap-datalet/js/buildtreemap.js | 8 +++----- datalets/treemap-datalet/treemap-datalet.html | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/datalets/treemap-datalet/js/buildtreemap.js b/datalets/treemap-datalet/js/buildtreemap.js index c7dcd83..6f522ca 100755 --- a/datalets/treemap-datalet/js/buildtreemap.js +++ b/datalets/treemap-datalet/js/buildtreemap.js @@ -3,12 +3,10 @@ */ function build(root, place_holder) { - var plwidth = $("#" + place_holder).width(), - plheight = $("#" + place_holder).height(); + var plwidth = $(place_holder).width(); + var plheight = $(place_holder).height(); var margin = {top: 20, right: 0, bottom: 0, left: 0}, - //width = 960, - //height = 500 - margin.top - margin.bottom, width = plwidth, height = plheight - margin.top - margin.bottom, formatNumber = d3.format(",d"), @@ -28,7 +26,7 @@ function build(root, place_holder) { .ratio(height / width * 0.5 * (1 + Math.sqrt(5))) .round(false); - var svg = d3.select("#" + place_holder).append("svg") + var svg = d3.select(place_holder).append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.bottom + margin.top) .style("margin-left", -margin.left + "px") diff --git a/datalets/treemap-datalet/treemap-datalet.html b/datalets/treemap-datalet/treemap-datalet.html index 6013287..14434bb 100755 --- a/datalets/treemap-datalet/treemap-datalet.html +++ b/datalets/treemap-datalet/treemap-datalet.html @@ -178,7 +178,8 @@ Example: }, presentData: function(){ - build(this.map, "treemap_placeholder"); + //build(this.map, "treemap_placeholder"); + build(this.map, this._component.$.treemap_placeholder); } }; -- libgit2 0.21.4