Sha256: e36389022ef21f8c862a1d8e8f0d8e189a23288490814c31d71cb2ee59470828

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

<html>
  <head>
    <title>Label Events</title>
    <script type="text/javascript" src="../../protovis-d3.3.js"></script>
  </head>
  <body>
    <script type="text/javascript+protovis">

var vis = new pv.Panel()
    .width(200)
    .height(200)
    .fillStyle("#ccc")
    .strokeStyle("#aaa")
    .events("all") // stroke should not prevent label events
    .margin(2);

vis.anchor("center").add(pv.Label)
    .data([{}])
    .font("48px sans-serif")
    .cursor("pointer")
    .title("CLICK NOW")
    .textStyle(function(d) d.active ? "white" : "black")
    .text(function(d) d.active ? "OBEY" : "CLICK")
    .events("all")
    .event("mousedown", function(d) (d.active = true, this))
    .event("mouseup", function(d) (d.active = false, this))

vis.render();

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyvis-0.1.1 vendor/tests/mark/label-events.html