Bring treemap examples up-to-date
This commit is contained in:
Родитель
d4b0939ba1
Коммит
30ad8bcc55
|
@ -1,15 +1,15 @@
|
|||
var w = 960,
|
||||
h = 500,
|
||||
var width = 960,
|
||||
height = 500,
|
||||
color = d3.scale.category20c();
|
||||
|
||||
var treemap = d3.layout.treemap()
|
||||
.padding(4)
|
||||
.size([w, h])
|
||||
.size([width, height])
|
||||
.value(function(d) { return d.size; });
|
||||
|
||||
var svg = d3.select("body").append("svg")
|
||||
.attr("width", w)
|
||||
.attr("height", h)
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.append("g")
|
||||
.attr("transform", "translate(-.5,-.5)");
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
var w = 960,
|
||||
h = 500,
|
||||
var width = 960,
|
||||
height = 500,
|
||||
color = d3.scale.category20c();
|
||||
|
||||
var treemap = d3.layout.treemap()
|
||||
.size([w, h])
|
||||
.size([width, height])
|
||||
.sticky(true)
|
||||
.value(function(d) { return d.size; });
|
||||
|
||||
var div = d3.select("#chart").append("div")
|
||||
.style("position", "relative")
|
||||
.style("width", w + "px")
|
||||
.style("height", h + "px");
|
||||
.style("width", width + "px")
|
||||
.style("height", height + "px");
|
||||
|
||||
d3.json("../data/flare.json", function(json) {
|
||||
div.data([json]).selectAll("div")
|
||||
|
|
Загрузка…
Ссылка в новой задаче