Sha256: 0913df1d9e454eaa4f21b821899db4772d11e5f4872f9b81a7b62323d3b93955

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 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("wiggle")
    .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-wiggle.html
rubyvis-0.6.1 spec/fixtures/stack-wiggle.html
rubyvis-0.6.0 spec/fixtures/stack-wiggle.html
rubyvis-0.5.2 spec/fixtures/stack-wiggle.html
rubyvis-0.5.1 spec/fixtures/stack-wiggle.html
rubyvis-0.5.0 spec/fixtures/stack-wiggle.html
rubyvis-0.4.1 spec/fixtures/stack-wiggle.html
rubyvis-0.4.0 spec/fixtures/stack-wiggle.html