forked from Mikhus/canvas-gauges
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Mikhus#96 from Mikhus/v2.1.1
Merge of release v2.1.1
- Loading branch information
Showing
18 changed files
with
515 additions
and
82 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "canvas-gauges", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"homepage": "https://github.com/Mikhus/canvas-gauges", | ||
"authors": [ | ||
"Mykhailo Stadnyk <[email protected]>" | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,130 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Gauge Test</title> | ||
<script src="../gauge.min.js"></script> | ||
<style>body { | ||
padding: 0; | ||
margin: 0; | ||
background: #fff | ||
}</style> | ||
</head> | ||
<body> | ||
|
||
<button onclick="animateGauges()">Animate</button> | ||
<button onclick="stopGaugesAnimation()">Stop animation</button> | ||
|
||
<hr> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
data-font-numbers-size="10" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
data-font-numbers-size="20" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
data-font-numbers-size="30" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
data-font-numbers-size="40" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,25,38,50,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
data-font-numbers-size="50" | ||
></canvas> | ||
|
||
<script> | ||
if (!Array.prototype.forEach) { | ||
Array.prototype.forEach = function(cb) { | ||
var i = 0, s = this.length; | ||
for (; i < s; i++) { | ||
cb && cb(this[i], i, this); | ||
} | ||
} | ||
} | ||
|
||
document.fonts && document.fonts.forEach(function(font) { | ||
font.loaded.then(function() { | ||
if (font.family.match(/Led/)) { | ||
document.gauges.forEach(function(gauge) { | ||
gauge.update(); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
var timers = []; | ||
|
||
function animateGauges() { | ||
document.gauges.forEach(function(gauge) { | ||
timers.push(setInterval(function() { | ||
gauge.value = Math.random() * | ||
(gauge.options.maxValue - gauge.options.minValue) + | ||
gauge.options.minValue; | ||
}, gauge.animation.duration + 50)); | ||
}); | ||
} | ||
|
||
function stopGaugesAnimation() { | ||
timers.forEach(function(timer) { | ||
clearInterval(timer); | ||
}); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,5 +140,5 @@ | |
</script> | ||
|
||
<script async src="../gauge.min.js" onload="initScriptedGauges()"></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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,5 +143,5 @@ | |
}); | ||
}); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Gauge Test</title> | ||
<script src="../gauge.min.js"></script> | ||
<style>body { | ||
padding: 0; | ||
margin: 0; | ||
background: #fff | ||
}</style> | ||
</head> | ||
<body> | ||
|
||
<button onclick="animateGauges()">Animate</button> | ||
<button onclick="stopGaugesAnimation()">Stop animation</button> | ||
|
||
<hr> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,38,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="500" | ||
></canvas> | ||
|
||
<canvas data-type="linear-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,38,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="150" | ||
data-height="500" | ||
></canvas> | ||
|
||
<canvas data-type="linear-gauge" | ||
data-min-value="13" | ||
data-max-value="87" | ||
data-exact-ticks="true" | ||
data-major-ticks="13,20,38,62,80,87" | ||
data-minor-ticks="2" | ||
data-highlights="0" | ||
data-width="500" | ||
data-height="150" | ||
data-value="47" | ||
></canvas> | ||
|
||
<script> | ||
if (!Array.prototype.forEach) { | ||
Array.prototype.forEach = function(cb) { | ||
var i = 0, s = this.length; | ||
for (; i < s; i++) { | ||
cb && cb(this[i], i, this); | ||
} | ||
} | ||
} | ||
|
||
document.fonts && document.fonts.forEach(function(font) { | ||
font.loaded.then(function() { | ||
if (font.family.match(/Led/)) { | ||
document.gauges.forEach(function(gauge) { | ||
gauge.update(); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
var timers = []; | ||
|
||
function animateGauges() { | ||
document.gauges.forEach(function(gauge) { | ||
timers.push(setInterval(function() { | ||
gauge.value = Math.random() * | ||
(gauge.options.maxValue - gauge.options.minValue) + | ||
gauge.options.minValue; | ||
}, gauge.animation.duration + 50)); | ||
}); | ||
} | ||
|
||
function stopGaugesAnimation() { | ||
timers.forEach(function(timer) { | ||
clearInterval(timer); | ||
}); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Gauge Test</title> | ||
<style>body { | ||
padding: 0; | ||
margin: 0; | ||
background: #fff | ||
}</style> | ||
</head> | ||
<body> | ||
|
||
<button onclick="animateGauges()">Animate</button> | ||
<button onclick="stopGaugesAnimation()">Stop animation</button> | ||
|
||
<hr> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-value="-20" | ||
data-width="400" | ||
data-height="400" | ||
data-bar-width="10" | ||
data-bar-shadow="5" | ||
data-color-bar-progress="rgba(50,200,50,.75)" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-value="-20" | ||
data-width="400" | ||
data-height="400" | ||
data-bar-width="2" | ||
data-bar-shadow="0" | ||
data-border-inner-width="0" | ||
data-border-outer-width="0" | ||
data-border-middle-width="0" | ||
data-color-bar-progress="rgba(50,50,200,.75)" | ||
data-color-bar="#aae" | ||
data-color-needle="rgba(50,50,200,.75)" | ||
data-color-needle-end="#aae" | ||
data-highlights="false" | ||
data-value-box-border-radius="0" | ||
data-value-box-stroke="1" | ||
data-color-value-box-shadow="0" | ||
data-needle-type="line" | ||
data-needle-width="1" | ||
data-needle-circle-size="5" | ||
data-needle-circle-inner="false" | ||
data-color-needle-circle-outer="rgba(50,50,200,.75)" | ||
data-color-needle-circle-outer-end="#aae" | ||
data-stroke-ticks="0" | ||
></canvas> | ||
|
||
<canvas data-type="radial-gauge" | ||
data-value="-20" | ||
data-width="400" | ||
data-height="400" | ||
data-bar-width="20" | ||
data-bar-shadow="1" | ||
data-color-bar-progress="rgba(200,50,50,.75)" | ||
data-color-bar="#eaa" | ||
data-border-shadow-width="0" | ||
data-border-inner-width="0" | ||
data-border-outer-width="0" | ||
data-border-middle-width="0" | ||
data-highlights="false" | ||
data-value-box-stroke="0" | ||
data-color-value-box-shadow="0" | ||
data-value-box-border-radius="0" | ||
data-value-text-shadow="0" | ||
data-color-value-box-background="transparent" | ||
data-needle="false" | ||
></canvas> | ||
|
||
<script async src="../gauge.min.js"></script> | ||
|
||
<script> | ||
if (!Array.prototype.forEach) { | ||
Array.prototype.forEach = function(cb) { | ||
var i = 0, s = this.length; | ||
for (; i < s; i++) { | ||
cb && cb(this[i], i, this); | ||
} | ||
} | ||
} | ||
|
||
document.fonts && document.fonts.forEach(function(font) { | ||
font.loaded.then(function() { | ||
if (font.family.match(/Led/)) { | ||
document.gauges.forEach(function(gauge) { | ||
gauge.update(); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
var timers = []; | ||
|
||
function animateGauges() { | ||
document.gauges.forEach(function(gauge) { | ||
timers.push(setInterval(function() { | ||
var min = gauge.options.minValue - 20; | ||
var max = gauge.options.maxValue + 20; | ||
|
||
gauge.value = min + Math.random() * (max - min); | ||
}, gauge.animation.duration + 50)); | ||
}); | ||
} | ||
|
||
function stopGaugesAnimation() { | ||
timers.forEach(function(timer) { | ||
clearInterval(timer); | ||
}); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,5 +143,5 @@ | |
}); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,5 +142,5 @@ | |
}); | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.