Commit 8fcc0f363989afebb691f97c65c2df87a21f5562
1 parent
9bb60e44
treeview bug fixing
Showing
2 changed files
with
5 additions
and
6 deletions
datalets/treemap-datalet/js/buildtreemap.js
@@ -3,12 +3,10 @@ | @@ -3,12 +3,10 @@ | ||
3 | */ | 3 | */ |
4 | 4 | ||
5 | function build(root, place_holder) { | 5 | function build(root, place_holder) { |
6 | - var plwidth = $("#" + place_holder).width(), | ||
7 | - plheight = $("#" + place_holder).height(); | 6 | + var plwidth = $(place_holder).width(); |
7 | + var plheight = $(place_holder).height(); | ||
8 | 8 | ||
9 | var margin = {top: 20, right: 0, bottom: 0, left: 0}, | 9 | var margin = {top: 20, right: 0, bottom: 0, left: 0}, |
10 | - //width = 960, | ||
11 | - //height = 500 - margin.top - margin.bottom, | ||
12 | width = plwidth, | 10 | width = plwidth, |
13 | height = plheight - margin.top - margin.bottom, | 11 | height = plheight - margin.top - margin.bottom, |
14 | formatNumber = d3.format(",d"), | 12 | formatNumber = d3.format(",d"), |
@@ -28,7 +26,7 @@ function build(root, place_holder) { | @@ -28,7 +26,7 @@ function build(root, place_holder) { | ||
28 | .ratio(height / width * 0.5 * (1 + Math.sqrt(5))) | 26 | .ratio(height / width * 0.5 * (1 + Math.sqrt(5))) |
29 | .round(false); | 27 | .round(false); |
30 | 28 | ||
31 | - var svg = d3.select("#" + place_holder).append("svg") | 29 | + var svg = d3.select(place_holder).append("svg") |
32 | .attr("width", width + margin.left + margin.right) | 30 | .attr("width", width + margin.left + margin.right) |
33 | .attr("height", height + margin.bottom + margin.top) | 31 | .attr("height", height + margin.bottom + margin.top) |
34 | .style("margin-left", -margin.left + "px") | 32 | .style("margin-left", -margin.left + "px") |
datalets/treemap-datalet/treemap-datalet.html
@@ -178,7 +178,8 @@ Example: | @@ -178,7 +178,8 @@ Example: | ||
178 | }, | 178 | }, |
179 | 179 | ||
180 | presentData: function(){ | 180 | presentData: function(){ |
181 | - build(this.map, "treemap_placeholder"); | 181 | + //build(this.map, "treemap_placeholder"); |
182 | + build(this.map, this._component.$.treemap_placeholder); | ||
182 | } | 183 | } |
183 | }; | 184 | }; |
184 | 185 |