Sha256: d7dc3bdf74475db1ff2ef5d20a3ff599414b244388af5475a073434a3e03ef1f

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <title>Partition - Icicle</title>
    <script type="text/javascript" src="../../d3.js"></script>
    <script type="text/javascript" src="../../d3.layout.js"></script>
    <style type="text/css">

rect {
  stroke: #fff;
}

    </style>
  </head>
  <body>
    <div id="chart"></div>
    <script type="text/javascript">

var w = 960,
    h = 250,
    color = d3.scale.category20c();

var vis = d3.select("#chart").append("svg:svg")
    .attr("width", w)
    .attr("height", h);

var partition = d3.layout.partition()
    .size([w, h])
    .value(function(d) { return d.size; });

d3.json("../data/flare.json", function(json) {
  vis.data([json]).selectAll("rect")
      .data(partition.nodes)
    .enter().append("svg:rect")
      .attr("x", function(d) { return d.x; })
      .attr("y", function(d) { return d.y; })
      .attr("width", function(d) { return d.dx; })
      .attr("height", function(d) { return d.dy; })
      .style("fill", function(d) { return color((d.children ? d : d.parent).name); });
});

    </script>
  </body>
</html>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bum-0.0.17 public/d3/examples/partition/partition-icicle.html
bum-0.0.16 public/d3/examples/partition/partition-icicle.html
bum-0.0.15 public/d3/examples/partition/partition-icicle.html
bum-0.0.14 public/d3/examples/partition/partition-icicle.html
bum-0.0.13 public/d3/examples/partition/partition-icicle.html
bum-0.0.12 public/d3/examples/partition/partition-icicle.html