File: layout_grid.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 (34 lines) | stat: -rw-r--r-- 633 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
<html>
  <head>
    <title>Grid Layout</title>
    <script type="text/javascript" src="protovis-d3.3.js"></script>
  </head>
  <body>
    <script type="text/javascript+protovis">

var vis = new pv.Panel()
    .data(["A"])
    .width(800)
    .height(800)
    .margin(10)
    .fillStyle("#eee")
    .strokeStyle("#ccc");

vis.add(pv.Layout.Grid)
    .rows(3)
    .cols(3)
  .cell.add(pv.Layout.Grid)
    .rows(pv.index)
    .cols(pv.index)
  .cell.add(pv.Bar)
    .strokeStyle("#fff")
  .anchor("center").add(pv.Label)
    .textStyle("rgba(255, 255, 255, .4)")
    .font("24px sans");

vis.render();

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