File: dot-anchor.html

package info (click to toggle)
ruby-rubyvis 0.6.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,808 kB
  • ctags: 679
  • sloc: ruby: 11,114; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
  <head>
    <title>Scatterplot</title>
    <script type="text/javascript" src="protovis-d3.3.js"></script>
  </head>
  <body>
    <script type="text/javascript+protovis">

var w = 400,
    h = 400;

var vis = new pv.Panel()
    .width(w)
    .height(h)
    .margin(20)
    .strokeStyle("#ccc");

var dot = vis.add(pv.Dot)
    .top(w / 2)
    .left(w / 2)
    .shapeRadius(w >> 2);

dot.anchor("top").add(pv.Label).text("top");
dot.anchor("left").add(pv.Label).text("left");
dot.anchor("right").add(pv.Label).text("right");
dot.anchor("bottom").add(pv.Label).text("bottom");
dot.anchor("center").add(pv.Label).text("center");

vis.render();

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