File: layout_tree_orient_left.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 (36 lines) | stat: -rw-r--r-- 810 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
34
35
36
<html>
  <head>
    <title>Test: Layout tree, orient left</title>
    <script type="text/javascript" src="protovis-r3.3.js"></script>
  </head>
  <body>
  <h1>Test: Layout tree, orient left</h1>
    <script type="text/javascript">
color=pv.Colors.category19()
w=200
h=200
hier_nodes=pv.dom({a:1,b:{ba:2,bb:{bba:3}, bc:4}, c:5}).root("test").nodes()


vis = new pv.Panel()
    .width(w)
    .height(h)
    .top(20)
    .bottom(10)
    .left(10)

treemap = vis.add(pv.Layout.Tree).
  nodes(hier_nodes) .breadth(40).orient("left")

treemap.node.add(pv.Dot).
  fillStyle(function(d) {return color(d.nodeValue);}).
  strokeStyle("black").
  lineWidth(1).
  antialias(false)
treemap.link.add(pv.Line)  
treemap.label.add(pv.Label).
text(function(d) {return d.nodeName})
vis.render()
</script>
    </body>
    </html>