This repository has been archived by the owner on Apr 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mike Bostock
committed
Mar 10, 2010
1 parent
0cf135a
commit b497554
Showing
3 changed files
with
100 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<html> | ||
<head> | ||
<title>Panel Transform</title> | ||
<script type="text/javascript" src="../../protovis-d3.2.js"></script> | ||
</head> | ||
<body> | ||
<script type="text/javascript+protovis"> | ||
|
||
var lines = pv.range(0, 1001, 100), | ||
mouse; | ||
|
||
var vis = new pv.Panel() | ||
.width(1000) | ||
.height(1000) | ||
.top(10) | ||
.left(10) | ||
.right(10) | ||
.bottom(10) | ||
.event("mousedown", pv.Behavior.pan()) | ||
.event("mousewheel", pv.Behavior.zoom()) | ||
.event("mousemove", function() (mouse = this.mouse(), this)) | ||
.fillStyle("#fff"); | ||
|
||
vis.add(pv.Rule) | ||
.data(lines) | ||
.strokeStyle(function() this.index % 2 ? "#aaa" : "#666") | ||
.left(pv.identity) | ||
.add(pv.Rule) | ||
.left(null) | ||
.top(pv.identity); | ||
|
||
vis.add(pv.Panel) | ||
.data(lines) | ||
.add(pv.Dot) | ||
.data(lines) | ||
.left(function(x, y) x) | ||
.top(function(x, y) y) | ||
.add(pv.Label) | ||
.text(function(x, y) x + ", " + y); | ||
|
||
vis.add(pv.Dot) | ||
.data(function() [mouse]) | ||
.visible(pv.identity) | ||
.left(function(d) d.x) | ||
.top(function(d) d.y) | ||
.add(pv.Label) | ||
.text(function(d) Math.round(d.x) + ", " + Math.round(d.y)); | ||
|
||
vis.render(); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters