abbott_2024_event/bin/app.publish/Line/assets/javascript/pages/sparkline-demo.min.js

3 lines
1.8 KiB
JavaScript

"use strict";function _classCallCheck(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,o){for(var n=0;n<o.length;n++){var r=o[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,o,n){return o&&_defineProperties(e.prototype,o),n&&_defineProperties(e,n),e}var SparklineDemo=function(){function e(){_classCallCheck(this,e),this.init()}return _createClass(e,[{key:"init",value:function(){this.compositeLineChart(),this.compositeChart(),this.drawMouseSpeed()}},{key:"compositeLineChart",value:function(){$("#compositeline").sparkline("html",{fillColor:!1,changeRangeMin:0,chartRangeMax:10,lineColor:Looper.colors.brand.teal}),$("#compositeline").sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7],{composite:!0,fillColor:!1,lineColor:Looper.colors.brand.pink,changeRangeMin:0,chartRangeMax:10})}},{key:"compositeChart",value:function(){$("#compositebar").sparkline("html",{type:"bar",barColor:Looper.colors.brand.teal}),$("#compositebar").sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7],{composite:!0,fillColor:!1,lineColor:Looper.colors.brand.pink})}},{key:"drawMouseSpeed",value:function(){var r,t=-1,a=-1,i=0,l=[];$("html").mousemove(function(e){var o=e.pageX,n=e.pageY;-1<t&&(i+=Math.max(Math.abs(o-t),Math.abs(n-a))),t=o,a=n});setTimeout(function e(){var o=(new Date).getTime();if(r&&r!=o){var n=Math.round(i/(o-r)*1e3);l.push(n),30<l.length&&l.splice(0,1),i=0,$("#mousespeed").sparkline(l,{width:2*l.length,tooltipSuffix:" pixels per second",lineColor:Looper.colors.brand.teal,fillColor:Looper.hexToRgba(Looper.colors.brand.teal,.1)})}r=o,setTimeout(e,500)},500)}}]),e}();$(document).on("theme:init",function(){new SparklineDemo});
//# sourceMappingURL=../../sourcemaps/pages/sparkline-demo.min.js.map