-
-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some extra edge case checks Make it actually, you know, work Split omni opts into a bool and a num Change interface to uni
- Loading branch information
=
committed
May 15, 2020
1 parent
abacd02
commit f7e9c04
Showing
4 changed files
with
99 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Zoom Variations</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="../dist/uPlot.min.css"> | ||
<style> | ||
.uplot { | ||
display: inline-block; | ||
width: 800px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<script src="../dist/uPlot.iife.js"></script> | ||
<script> | ||
let xs = [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]; | ||
let vals = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | ||
|
||
let data = [ | ||
xs, | ||
xs.map((t, i) => vals[Math.floor(Math.random() * vals.length)]) | ||
]; | ||
|
||
const opts = (title, dragOpts) => ({ | ||
title: title, | ||
width: 800, | ||
height: 600, | ||
scales: { | ||
x: { | ||
time: false, | ||
}, | ||
}, | ||
cursor: { | ||
drag: dragOpts | ||
}, | ||
series: [ | ||
{}, | ||
{ | ||
stroke: "purple" | ||
} | ||
], | ||
}); | ||
|
||
let variations = [ | ||
['X only', { x: true, y: false }], | ||
['Y only', { x: false, y: true }], | ||
['X / Y', { x: true, y: true }], | ||
['X / Y Unidirectional Threshold 0 (Same as X / Y)', { x: true, y: true, uni: 0 }], | ||
['X / Y Unidirectional Threshold 50', { x: true, y: true, uni: 50 }], | ||
['X / Y Unidirectional Threshold Infinity', { x: true, y: true, uni: Infinity }] | ||
]; | ||
|
||
variations.forEach((variation) => new uPlot(opts(...variation), data, document.body)); | ||
</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
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 |
---|---|---|
|
@@ -306,6 +306,7 @@ export const cursorOpts = { | |
setScale: true, | ||
x: true, | ||
y: false, | ||
uni: null | ||
}, | ||
|
||
focus: { | ||
|
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