Sha256: 796103fcf9066ae01c4638c54a12ee3eccb232f2728647e667d82d63a11f677b

Contents?: true

Size: 1018 Bytes

Versions: 1

Compression:

Stored size: 1018 Bytes

Contents

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

body {
  margin: 0;
}

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

var vis = new pv.Panel()
    .width(window.innerWidth)
    .height(window.innerHeight)
    .fillStyle("white")
    .event("mousedown", pv.Behavior.pan())
    .event("mousewheel", pv.Behavior.zoom());

var layout = vis.add(pv.Layout.Force)
    .nodes(social.nodes)
    .links(social.links);

layout.link.add(pv.Line);

layout.node.add(pv.Dot)
    .strokeStyle(null)
    .shape(function(d) d.gender == "M" ? "square" : "circle")
    .fillStyle(function(d) d.group == 1 ? "black" : "grey")
    .event("mousedown", pv.Behavior.drag())
    .event("drag", layout);

layout.label.add(pv.Label)
    .textStyle("white")
    .text(function(d) d.gender + d.group);

vis.render();

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyvis-0.1.1 vendor/tests/layout/force4.html