Sha256: 607e74c77fa0e6461434b2a44c1b15cd3e09a2063781fe9ab9ba58c76b6b9f38

Contents?: true

Size: 868 Bytes

Versions: 8

Compression:

Stored size: 868 Bytes

Contents

<html>
  <head>
    <title>Stack</title>
    <script type="text/javascript" src="protovis-d3.3.js"></script>
    <script type="text/javascript" src="layers.js"></script>
    <style type="text/css">

body {
  margin: 0;
}

    </style>
  </head>
  <body>
    <script type="text/javascript+protovis">

var w = 300,
    h = 300,
    n = 20, // number of layers
    m = 75, // number of samples per layer
    x = pv.Scale.linear(2, m - 1).range(0, w)
    y = pv.Scale.linear(0,20).range(0,h/2.0)
var vis = new pv.Panel()
    .width(w)
    .height(h);

vis.add(pv.Layout.Stack)
    .layers(waves(n, m))
    .order("reverse")
    .offset("silohouette")
    .x(x.by(pv.index))
    .y(function(d) {return y(d);})
  .layer.add(pv.Area)
    .fillStyle(pv.ramp("#ada", "#656").domain(n, 0).by(pv.parent))
    .strokeStyle("#797");

vis.render();

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubyvis-0.7.0 spec/fixtures/stack-silohouette.html
rubyvis-0.6.1 spec/fixtures/stack-silohouette.html
rubyvis-0.6.0 spec/fixtures/stack-silohouette.html
rubyvis-0.5.2 spec/fixtures/stack-silohouette.html
rubyvis-0.5.1 spec/fixtures/stack-silohouette.html
rubyvis-0.5.0 spec/fixtures/stack-silohouette.html
rubyvis-0.4.1 spec/fixtures/stack-silohouette.html
rubyvis-0.4.0 spec/fixtures/stack-silohouette.html