@fc-plot/ts-graph 0.27.2 → 0.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BundleReport.html +2 -2
- package/dist/index.js +1 -1
- package/examples/index.js +24 -15
- package/package.json +1 -1
- package/src/yAxis.ts +3 -3
package/dist/BundleReport.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@fc-plot/ts-graph [
|
|
6
|
+
<title>@fc-plot/ts-graph [1 Jun 2026 at 14:57]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<body>
|
|
47
47
|
<div id="app"></div>
|
|
48
48
|
<script>
|
|
49
|
-
window.chartData = [{"label":"index.js","isAsset":true,"statSize":
|
|
49
|
+
window.chartData = [{"label":"index.js","isAsset":true,"statSize":125535,"parsedSize":55214,"gzipSize":15729,"groups":[{"label":"node_modules","path":"./node_modules","statSize":18573,"groups":[{"label":"@babel/runtime/helpers","path":"./node_modules/@babel/runtime/helpers","statSize":3683,"groups":[{"id":2,"label":"classCallCheck.js","path":"./node_modules/@babel/runtime/helpers/classCallCheck.js","statSize":274,"parsedSize":169,"gzipSize":140},{"id":3,"label":"createClass.js","path":"./node_modules/@babel/runtime/helpers/createClass.js","statSize":752,"parsedSize":349,"gzipSize":230},{"id":4,"label":"defineProperty.js","path":"./node_modules/@babel/runtime/helpers/defineProperty.js","statSize":367,"parsedSize":195,"gzipSize":154},{"id":5,"label":"toConsumableArray.js","path":"./node_modules/@babel/runtime/helpers/toConsumableArray.js","statSize":521,"parsedSize":154,"gzipSize":128},{"id":6,"label":"arrayLikeToArray.js","path":"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","statSize":312,"parsedSize":181,"gzipSize":151},{"id":8,"label":"arrayWithoutHoles.js","path":"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","statSize":266,"parsedSize":134,"gzipSize":117},{"id":9,"label":"iterableToArray.js","path":"./node_modules/@babel/runtime/helpers/iterableToArray.js","statSize":274,"parsedSize":189,"gzipSize":153},{"id":10,"label":"unsupportedIterableToArray.js","path":"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","statSize":609,"parsedSize":374,"gzipSize":270},{"id":11,"label":"nonIterableSpread.js","path":"./node_modules/@babel/runtime/helpers/nonIterableSpread.js","statSize":308,"parsedSize":244,"gzipSize":193}],"parsedSize":1989,"gzipSize":720},{"label":"events","path":"./node_modules/events","statSize":14890,"groups":[{"id":7,"label":"events.js","path":"./node_modules/events/events.js","statSize":14890,"parsedSize":6026,"gzipSize":2004}],"parsedSize":6026,"gzipSize":2004}],"parsedSize":8015,"gzipSize":2554},{"label":"assets","path":"./assets","statSize":1972,"groups":[{"id":12,"label":"style.less","path":"./assets/style.less","statSize":1972,"parsedSize":17,"gzipSize":37}],"parsedSize":17,"gzipSize":37},{"label":"src","path":"./src","statSize":104990,"groups":[{"id":13,"label":"index.ts + 12 modules (concatenated)","path":"./src/index.ts + 12 modules (concatenated)","statSize":104990,"parsedSize":45784,"gzipSize":13235,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 12 modules (concatenated)/src","statSize":96908,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 12 modules (concatenated)/src/index.ts","statSize":32980,"parsedSize":14381,"gzipSize":4157,"inaccurateSizes":true},{"id":null,"label":"utils.ts","path":"./src/index.ts + 12 modules (concatenated)/src/utils.ts","statSize":5536,"parsedSize":2414,"gzipSize":697,"inaccurateSizes":true},{"id":null,"label":"xAxis.ts","path":"./src/index.ts + 12 modules (concatenated)/src/xAxis.ts","statSize":4884,"parsedSize":2129,"gzipSize":615,"inaccurateSizes":true},{"id":null,"label":"yAxis.ts","path":"./src/index.ts + 12 modules (concatenated)/src/yAxis.ts","statSize":7299,"parsedSize":3182,"gzipSize":920,"inaccurateSizes":true},{"id":null,"label":"yAxis2.ts","path":"./src/index.ts + 12 modules (concatenated)/src/yAxis2.ts","statSize":5136,"parsedSize":2239,"gzipSize":647,"inaccurateSizes":true},{"id":null,"label":"tooltip.ts","path":"./src/index.ts + 12 modules (concatenated)/src/tooltip.ts","statSize":16241,"parsedSize":7082,"gzipSize":2047,"inaccurateSizes":true},{"id":null,"label":"line.ts","path":"./src/index.ts + 12 modules (concatenated)/src/line.ts","statSize":5595,"parsedSize":2439,"gzipSize":705,"inaccurateSizes":true},{"id":null,"label":"bar.ts","path":"./src/index.ts + 12 modules (concatenated)/src/bar.ts","statSize":2307,"parsedSize":1006,"gzipSize":290,"inaccurateSizes":true},{"id":null,"label":"zoom.ts","path":"./src/index.ts + 12 modules (concatenated)/src/zoom.ts","statSize":4341,"parsedSize":1893,"gzipSize":547,"inaccurateSizes":true},{"id":null,"label":"legend.ts","path":"./src/index.ts + 12 modules (concatenated)/src/legend.ts","statSize":3739,"parsedSize":1630,"gzipSize":471,"inaccurateSizes":true},{"id":null,"label":"shapes.ts","path":"./src/index.ts + 12 modules (concatenated)/src/shapes.ts","statSize":3100,"parsedSize":1351,"gzipSize":390,"inaccurateSizes":true},{"id":null,"label":"getNearestPoints.ts","path":"./src/index.ts + 12 modules (concatenated)/src/getNearestPoints.ts","statSize":5750,"parsedSize":2507,"gzipSize":724,"inaccurateSizes":true}],"parsedSize":42259,"gzipSize":12216,"inaccurateSizes":true},{"label":"node_modules/resize-detector/esm","path":"./src/index.ts + 12 modules (concatenated)/node_modules/resize-detector/esm","statSize":8042,"groups":[{"id":null,"label":"index.js","path":"./src/index.ts + 12 modules (concatenated)/node_modules/resize-detector/esm/index.js","statSize":8042,"parsedSize":3506,"gzipSize":1013,"inaccurateSizes":true}],"parsedSize":3506,"gzipSize":1013,"inaccurateSizes":true}]}],"parsedSize":45784,"gzipSize":13235}]}];
|
|
50
50
|
window.defaultSizes = "parsed";
|
|
51
51
|
</script>
|
|
52
52
|
</body>
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("d3"),require("lodash"));else if("function"==typeof define&&define.amd)define([,],t);else{var i="object"==typeof exports?t(require("d3"),require("lodash")):t(e.d3,e._);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(window,(function(e,t){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=13)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(8),o=i(9),r=i(10),s=i(11);e.exports=function(e){return n(e)||o(e)||r(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n,o="object"==typeof Reflect?Reflect:null,r=o&&"function"==typeof o.apply?o.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(i,n){function o(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",o),i([].slice.call(arguments))}m(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&m(e,"error",t,i)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,i,n){var o,r,s,a;if(l(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),s=r[t]),void 0===s)s=r[t]=i,++e._eventsCount;else if("function"==typeof s?s=r[t]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(o=h(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},o=u.bind(n);return o.listener=i,n.wrapFn=o,o}function p(e,t,i){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?i?[o.listener||o]:[o]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(o):y(o,o.length)}function v(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function y(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(r){n.once&&e.removeEventListener(t,o),i(r)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,h=y(c,l);for(i=0;i<l;++i)r(h[i],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var i,n,o,r,s;if(l(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(o=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){s=i[r].listener,o=r;break}if(o<0)return this;0===o?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,o),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var o,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(o=r[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},a.prototype.listenerCount=v,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,i){var n=i(6);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(6);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return ie}));var n=i(5),o=i.n(n),r=i(4),s=i.n(r),a=i(2),c=i.n(a),l=i(3),h=i.n(l),d=i(0),u=i(1);let f=null;let p=null;function v(e,t={}){let i=document.createElement(e);return Object.keys(t).forEach(e=>{i[e]=t[e]}),i}function y(e,t,i){return(window.getComputedStyle(e,i||null)||{display:"none"})[t]}function m(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};let t=e;for(;t!==document;){if("none"===y(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}let g=0,b=null;function x(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=_.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){let{offsetWidth:t,offsetHeight:i}=e,n=new ResizeObserver(()=>{(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==t||e.offsetHeight!==i))&&w(e)}),{detached:o,rendered:r}=m(e);e.__resize_observer_triggered__=!1===o&&!1===r,e.__resize_observer__=n,n.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){w(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(g||(b=function(e){var t=document.createElement("style");return t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){let t=y(e,"position");t&&"static"!==t||(e.style.position="relative");e.__resize_old_position__=t,e.__resize_last__={};let i=v("div",{className:"resize-triggers"}),n=v("div",{className:"resize-expand-trigger"}),o=v("div"),r=v("div",{className:"resize-contract-trigger"});n.appendChild(o),i.appendChild(n),i.appendChild(r),e.appendChild(i),e.__resize_triggers__={triggers:i,expand:n,expandChild:o,contract:r},O(e),e.addEventListener("scroll",k,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=m(e).rendered,window.MutationObserver){let t=new MutationObserver(e.__resize_mutation_handler__);t.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=t}e.__resize_listeners__.push(t),g++}function _(){let{rendered:e,detached:t}=m(this);e!==this.__resize_rendered__&&(!t&&this.__resize_triggers__&&(O(this),this.addEventListener("scroll",k,!0)),this.__resize_rendered__=e,w(this))}function k(){var e,t;O(this),this.__resize_raf__&&(e=this.__resize_raf__,p||(p=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),p(e)),this.__resize_raf__=(t=()=>{let e=function(e){let{width:t,height:i}=e.__resize_last__,{offsetWidth:n,offsetHeight:o}=e;return n!==t||o!==i?{width:n,height:o}:null}(this);e&&(this.__resize_last__=e,w(this))},f||(f=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),f(t))}function w(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach(t=>{t.call(e,e)})}function O(e){let{expand:t,expandChild:i,contract:n}=e.__resize_triggers__,{scrollWidth:o,scrollHeight:r}=n,{offsetWidth:s,offsetHeight:a,scrollWidth:c,scrollHeight:l}=t;n.scrollLeft=o,n.scrollTop=r,i.style.width=s+1+"px",i.style.height=a+1+"px",t.scrollLeft=c,t.scrollTop=l}var S=i(7),C=i.n(S);function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(e,t){return"X"===t?1e3*e:e}function E(e){var t,i=e.series,n=e.x,o=e.xkey,r=e.ykey,s=e.ykey2,a=e.oykey,c=e.timestamp,l=e.fillNull,h=(t=function(e,t){return(i=j(e[o],c))<(n=t)?-1:i>n?1:i>=n?0:NaN;var i,n},{left:function(e,i,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var r=n+o>>>1;t(e[r],i)<0?n=r+1:o=r}return n},right:function(e,i,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var r=n+o>>>1;t(e[r],i)>0?o=r:n=r+1}return n}}).left,d=new Date(n).getTime(),f=[];return"[object Array]"!==Object.prototype.toString.call(i)?[]:(i.forEach((function(e,t){if(!function(e,t){return Object(u.some)(e.data,(function(e){return t&&t in e}))}(e,s)&&!1!==e.visible){var i=e.name,p=e.color,v=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&"[object Function]"===Object.prototype.toString.call(t)&&t(n)&&(i[n]=e[n]);return i}(e,(function(e){return"data"!==e})),y=e.data,m=void 0===y?[]:y;if("[object Array]"===Object.prototype.toString.call(m)&&0!==(m=m.filter((function(e){return"number"==typeof e[r]||"number"==typeof l}))).length){var g,b=h(m,n),x=m[b-1],_=m[b];if(x&&_){var k=j(x[o],c),w=j(_[o],c),O=x[r],S=_[r];null===O&&void 0!==l&&(O=l),null===S&&void 0!==l&&(S=l),g=d-k<w-d?A(A({},x),{},{name:i,color:p,timestamp:k,value:O,origin:x[a],serieIndex:t,serieOptions:v}):A(A({},_),{},{name:i,color:p,timestamp:w,value:S,origin:_[a],serieIndex:t,serieOptions:v}),f.push(g)}else if(x){var C=j(x[o],c),L=x[r];null===L&&void 0!==l&&(L=l),g=A(A({},x),{},{name:i,color:p,timestamp:C,value:L,origin:x[a],serieIndex:t,serieOptions:v}),f.push(g)}else if(_){var E=j(_[o],c),z=_[r];null===z&&void 0!==l&&(z=l),g=A(A({},_),{},{name:i,color:p,timestamp:E,value:z,origin:_[a],serieIndex:t,serieOptions:v}),f.push(g)}}}})),f)}function z(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function M(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?z(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function P(e,t){var i=e.length;return t<i?e[t]:P(e,t-i)}function T(e,t){return"X"===t?1e3*e:e}function I(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.getBoundingClientRect(),o=t.touches[i].clientX,r=t.touches[i].clientY,s=o-n.left,a=r-n.top;return{offsetX:s,offsetY:a,clientX:o,clientY:r}}function N(e){var t=String(e);if(e>=1e3){t=d.format(".5s")(e);var i=/[kMGTPEZY]$/;if(i.test(t)){var n=t[t.length-1];t=t.replace(i,""),t=parseFloat(t)+n}}return t}function D(e,t,i){var n=e.map((function(e){var n;return n="function"==typeof i?i(e):N(e),t.measureText(n).width}));return Object(u.max)(n)}function W(e,t){var i=e;return null!==e&&"function"==typeof t&&(i=t(e)),i}function R(e,t,i,n){var o=t.xkey,r=t.ykey,s=t.ykey2,a=t.oykey,c=t.timestamp,l=t.series,h=t.fillNull,d=e.offsetX||e.layerX,u=e.offsetY||e.layerY,f=i.invert(d);return{x:f,y:n.invert(u),nearestPoints:E({x:f,xkey:o,ykey:r,ykey2:s,oykey:a,timestamp:c,series:l,fillNull:h})}}var B=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.ctx=void 0,this.yAxis=void 0,this.y2Axis=void 0,this.options=t,this.ctx=i,this.yAxis=n,this.y2Axis=o}return h()(e,[{key:"init",value:function(){var e,t=this.options,i=t.chart.width,n=t.timestamp,o=t.xmin,r=t.xmax,s=t.xAxis,a=this.yAxis.tickMaxWidth||0,c=(null===(e=this.y2Axis)||void 0===e?void 0:e.tickMaxWidth)||0,l=d.scaleTime().range([s.visible?a:0,i-c]);return l.domain([T(o,n)-(o===r?1e3:0),T(r,n)+(o===r?1e3:0)]),l}},{key:"draw",value:function(e){var t=this.ctx,i=this.options,n=i.chart,o=i.xAxis,r=i.time,s=e.ticks(Math.floor(n.width/90));o.ticks&&(s=o.ticks);var a=n.height-o.tickpadding-o.labels.fontSize;t.beginPath(),s.forEach((function(i){var n=e(i);n&&(t.moveTo(n,a),t.lineTo(n,a-o.tickLength))})),t.lineWidth=1,t.strokeStyle=o.tickColor,t.stroke(),t.closePath(),t.beginPath(),t.moveTo(this.yAxis.tickMaxWidth||0,a-o.tickLength),t.lineTo(n.width,a-o.tickLength),t.lineWidth=1,t.strokeStyle=o.lineColor,t.stroke(),t.closePath(),t.textAlign="center",t.textBaseline="bottom",t.fillStyle=o.labels.color,t.font="".concat(o.labels.fontSize,"px Palantino"),s.forEach((function(i,a){var c="%H:%M";0!==i.getSeconds()&&(c="%H:%M:%S"),0===i.getHours()&&0===i.getMinutes()&&0===i.getSeconds()&&(c="%m-%d"),o.labels.timeFormat&&(c=o.labels.timeFormat);var l=i;if(r&&void 0!==r.timezoneOffset){var h=i.getTimezoneOffset(),u=i.getTime()+60*h*1e3+60*r.timezoneOffset*1e3;l=new Date(u)}if(o.ticks&&o.ticks.length>1){var f=e(i);0===a?f+=c.length*o.labels.fontSize/4+1:a===s.length-1&&(f-=c.length*o.labels.fontSize/4-1),t.fillText(d.timeFormat(c)(l),f,n.height)}else e(i)&&t.fillText(d.timeFormat(c)(l),e(i),n.height)}))}},{key:"drawPlotLines",value:function(e){var t=this.ctx,i=this.options,n=i.chart,o=i.xAxis,r=i.xAxis.plotLines,s=n.height-o.tickpadding-o.labels.fontSize;Array.isArray(r)&&r.forEach((function(n){var r=e("X"===i.timestamp?1e3*n.value:n.value);t.setLineDash([5,3]),t.beginPath(),t.moveTo(r,0),t.lineTo(r,s-o.tickLength),t.strokeStyle=n.color,t.stroke(),t.setLineDash([])}))}}]),e}(),X=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.tickLength=void 0,this.ticks=void 0,this.tickMaxWidth=void 0,this.options=t;var n=t.yAxis;i.font="".concat(n.labels.fontSize,"px Palantino"),this.ctx=i,this.tickLength=Math.floor(t.chart.height/50),this.ticks=[],this.tickMaxWidth=0}return h()(e,[{key:"init",value:function(){var e=this.options,t=e.chart,i=e.xAxis,n=e.yAxis,o=d.scaleLinear();n.scale&&"log"===n.scale.type&&(o=d.scaleLog().base(n.scale.log||10));var r=o.range([t.height-(i.labels.fontSize+i.tickpadding+i.tickLength),10]);return this.setDomain(r,this.options),r}},{key:"getPlotLinesMaxAbs",value:function(){var e,t=this.options.yAxis.plotLines;return Array.isArray(t)&&t.forEach((function(t){(!e||Math.abs(e)<Math.abs(t.value))&&(e=t.value)})),e}},{key:"setDomain",value:function(e,t){var i=t.ymin,n=t.ymax,o=this.options.yAxis,r=this.tickLength;if(i===n&&0!==i){var s=(n-i)/(this.tickLength-1),a=s/2||n||1;r=0===s?1:this.tickLength,i-=a,n+=a}if(i>n){var c=i;i=n,n=c}if(o.plotLinesFixed||i===n){var l=this.getPlotLinesMaxAbs();l&&(l<i&&(i=l),l>n&&(n=l))}var h=[];if("number"==typeof o.min||"number"==typeof o.max){var f="number"==typeof o.min?o.min:i,p="number"==typeof o.max?o.max:n;if(e.domain([f,p]),"number"==typeof o.min&&o.min>p)h=[o.min];else if("number"==typeof o.max&&o.max<f)h=[o.max];else{var v=d.tickStep(f,p,r);h=Object(u.map)(d.range(f,p,v),(function(e){return Object(u.floor)(e,2)}))}}else e.domain([i,n]),e.nice(r),h=e.ticks(r);o.ticksHandler&&(h=o.ticksHandler(h));var y=D(h,this.ctx,o.tickValueFormatter)+5;this.ticks=h,this.tickMaxWidth=y}},{key:"draw",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.yAxis,r=n.chart;i.beginPath(),i.fillStyle=o.backgroundColor||"#fff",i.fillRect(0,0,this.tickMaxWidth,r.height-12),i.stroke(),i.closePath(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=o.labels.color,i.lineWidth=1,i.fillStyle=o.labels.color,this.ticks.forEach((function(n){var r;r="function"==typeof o.tickValueFormatter?o.tickValueFormatter(n):N(n);var s=e(n);i.fillText(r,t.tickMaxWidth-5,s)}))}},{key:"drawGridLine",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.chart,r=n.yAxis;i.beginPath(),this.ticks.forEach((function(n){var r=e(n);i.moveTo(t.tickMaxWidth,r),i.lineTo(o.width,r)})),i.lineWidth=1,i.strokeStyle=r.gridLineColor,i.stroke(),i.closePath()}},{key:"drawPlotLines",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.chart,r=n.yAxis,s=n.yAxis.plotLines;Array.isArray(s)&&s.forEach((function(n){var s=n.labelEnable,a=void 0===s||s,c=n.label,l=n.textAlign,h=void 0===l?"right":l,d=e(n.value);if(i.setLineDash([5,3]),i.beginPath(),i.moveTo(0,d),i.lineTo(o.width,d),i.strokeStyle=n.color,i.stroke(),i.setLineDash([]),a){var u=c||String(n.value),f="right"===h?o.width-8:t.tickMaxWidth+8;i.textAlign=h,i.textBaseline="top",i.shadowColor=n.shadowColor||"#fff",i.shadowBlur=1,i.lineWidth=1,i.fillStyle=n.color,i.font="".concat(r.labels.fontSize,"px Palantino"),i.strokeText(u,f,d),i.fillText(u,f,d)}}))}}]),e}(),F=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.tickLength=void 0,this.ticks=void 0,this.tickMaxWidth=void 0,this.options=t;var n=t.yAxis;i.font="".concat(n.labels.fontSize,"px Palantino"),this.ctx=i,this.tickLength=Math.floor(t.chart.height/50),this.ticks=[],this.tickMaxWidth=0}return h()(e,[{key:"init",value:function(){var e=this.options,t=e.chart,i=e.xAxis,n=e.yAxis,o=d.scaleLinear();n.scale&&"log"===n.scale.type&&(o=d.scaleLog().base(n.scale.log||10));var r=o.range([t.height-(i.labels.fontSize+i.tickpadding+i.tickLength),10]);return this.setDomain(r,this.options),r}},{key:"getPlotLinesMaxAbs",value:function(){var e,t=this.options.yAxis.plotLines;return Array.isArray(t)&&t.forEach((function(t){(!e||Math.abs(e)<Math.abs(t.value))&&(e=t.value)})),e}},{key:"setDomain",value:function(e,t){var i=t.y2min,n=t.y2max,o=this.options,r=o.yAxis,s=o.yAxis2,a=this.tickLength;if(i===n&&0!==i){var c=(n-i)/(this.tickLength-1),l=c/2||n||1;a=0===c?1:this.tickLength,i-=l,n+=l}if(i>n){var h=i;i=n,n=h}if(r.plotLinesFixed||i===n){var f=this.getPlotLinesMaxAbs();f&&(f<i&&(i=f),f>n&&(n=f))}var p=[];if("number"==typeof r.min||"number"==typeof r.max){var v="number"==typeof r.min?r.min:i,y="number"==typeof r.max?r.max:n;if(e.domain([v,y]),"number"==typeof r.min&&r.min>y)p=[r.min];else if("number"==typeof r.max&&r.max<v)p=[r.max];else{var m=d.tickStep(v,y,a);p=Object(u.map)(d.range(v,y,m),(function(e){return Object(u.floor)(e,2)}))}}else e.domain([i,n]),e.nice(a),p=e.ticks(a);var g=D(p,this.ctx,s.tickValueFormatter)+10;this.ticks=p,this.tickMaxWidth=g}},{key:"draw",value:function(e){var t=this.ctx,i=this.options,n=i.yAxis2,o=i.chart;t.beginPath(),t.fillStyle=n.backgroundColor||"#fff",t.fillRect(o.width-this.tickMaxWidth,0,this.tickMaxWidth,o.height-12),t.stroke(),t.closePath(),t.textAlign="right",t.textBaseline="middle",t.strokeStyle=n.labels.color,t.lineWidth=1,t.fillStyle=n.labels.color,this.ticks.forEach((function(i){var r;r="function"==typeof n.tickValueFormatter?n.tickValueFormatter(i):N(i);var s=e(i);t.fillText(r,o.width-5,s)}))}}]),e}();function H(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?H(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Y=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.ctx=void 0,this.flag=void 0,this.container=void 0,this.isMouserover=void 0,this.options=t,this.ctx=i,this.flag=!1,this.container=n,this.init(n,o),this.isMouserover=!1}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart.id,n=document.createElement("div");n.id="".concat(i,"-tooltip"),n.className="ts-graph-tooltip",document.getElementById(n.id)||document.body.append(n)}},{key:"clear",value:function(){var e=this.options,t=e.ratio,i=e.chart,n=i.id,o=i.containerWidth,r=i.containerHeight,s=document.getElementById("".concat(n,"-tooltip"));this.isMouserover=!1,this.ctx.save(),this.ctx.setTransform(1*t,0,0,1*t,0,0),this.ctx.clearRect(0,0,o,r),this.ctx.restore(),s.style.top="-99999px",s.lastChild&&s.removeChild(s.lastChild)}},{key:"getNearestPoints",value:function(e,t,i,n,o,r){var s=this.options,a=s.series,c=void 0===a?[]:a,l=s.chart.colors,h=s.tooltip.shared,d=s.xkey,f=s.ykey,p=s.ykey2,v=s.oykey,y=s.timestamp,m=s.fillNull,g=s.yAxis2,b=e.offsetX||e.layerX,x=e.offsetY||e.layerY,_=t.invert(b),k=i.invert(x),w=[];if(!1!==this.isMouserover){var O=[];O=r?function(e,t){var i=t.series,n=void 0===i?[]:i,o=t.xkey,r=t.ykey,s=t.oykey,a=t.timestamp,c=[];return n.forEach((function(t,i){if(!1!==t.visible){var n=t.name,l=t.color,h=Object(u.pickBy)(t,(function(e,t){return"data"!==t})),d=t.data,f=void 0===d?[]:d;"[object Array]"===Object.prototype.toString.call(f)&&f.forEach((function(t){var d=T(t[o],a);d===e&&c.push(M(M({},t),{},{name:n,color:l,timestamp:d,value:t[r],origin:t[s],serieIndex:i,serieOptions:h}))}))}})),c}(r,this.options):E({x:_,xkey:d,ykey:f,ykey2:p,oykey:v,timestamp:y,series:c,fillNull:m});var S,C,L=function(e,t){var i=e.map((function(e){return A(A({},e),{},{distance:Math.abs(e.value-t)})})).sort((function(e,t){return e.distance-t.distance}))[0];return Object(u.omit)(i,["distance"])}(w=O.map((function(e){var o=g.visible&&g.matchRefId&&e.serieOptions.refId===g.matchRefId?n:i;return Z(Z({},e),{},{x:t(e.timestamp),y:o(e.value),color:e.color||P(l,e.serieIndex)})})),k),j=Object(u.groupBy)(w,"x");if(Object(u.keys)(j).length>1){var z=Number.POSITIVE_INFINITY;for(var I in j)if(Object.prototype.hasOwnProperty.call(j,I)){var N=(S=e.offsetX,C=Number(I),Math.sqrt(Math.pow(C-S,2)));N<z&&(z=N,w=j[I])}}if(!h){var D=Number.POSITIVE_INFINITY;w.forEach((function(t){var i,n,o=(i={x:e.offsetX,y:e.offsetY},n=t,Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2)));o<D&&(D=o,w=[t])}))}o(w,L)}}},{key:"draw",value:function(e,t,i,n,o){var r,s=this,a=t.xScales,c=t.yScales,l=t.y2Scales,h=t.yAxis,d=t.options,u=null==d||null===(r=d.tooltip)||void 0===r?void 0:r.cascadeMode;this.isMouserover=!0,this.getNearestPoints(e,a,c,l,(function(t,r){if(s.clear(),s.drawCrosshair(e,n,o),t.length){if(t[0].x<h.tickMaxWidth)return;(void 0===i||void 0!==i&&"sharedTooltip"===u)&&(s.drawSymbol(t),s.drawModal(t,r,e,n,o))}}),i)}},{key:"drawModal",value:function(e,t,i,n,r){var s=this.options,a=s.chart,c=a.id,l=a.renderTo,h=s.tooltip,f=s.time,p=s.notDisplayedSeries,v=s.oykey,y=l.offsetHeight,m=document.getElementById("".concat(c,"-tooltip")),g=document.createElement("div"),b=e,x=((y=window.innerHeight/1.5)-18-100)/15,_=!1;if(h.sharedSortDirection&&(e=Object(u.orderBy)(e,(function(e){return e[v]}),h.sharedSortDirection)),e.length>x&&(e=e.slice(0,x),_=!0),g.className="ts-graph-tooltip-content",m.appendChild(g),"[object Function]"===Object.prototype.toString.call(h.formatter))g.innerHTML=h.formatter(o()(e),o()(b),Object(u.clone)(t));else{var k=e[0],w=document.createDocumentFragment(),O=document.createElement("ul"),S=document.createElement("li"),C=new Date(k.timestamp);if(f&&void 0!==f.timezoneOffset){var L=C.getTimezoneOffset(),A=C.getTime()+60*L*1e3+60*f.timezoneOffset*1e3;C=new Date(A)}var j=document.createTextNode(d.timeFormat(h.timeFormat)(C));if(S.appendChild(j),S.style.color="#666",O.style.maxWidth="".concat(window.innerWidth/1.5,"px"),O.appendChild(S),w.appendChild(O),e.forEach((function(e){var i=e.color,n=e.name,o=e.origin,r=e.filledNull;if(!(p.indexOf(n)>-1)){var s=document.createElement("li");if(i){var a=document.createElement("span"),c=document.createTextNode("● ");a.style.color=i,a.appendChild(c),s.appendChild(a)}var l=n;if("function"==typeof h.pointNameformatter&&(l=h.pointNameformatter(n,e)),l){var f=document.createElement("span"),v=document.createTextNode("".concat(l,": "));(null==t?void 0:t.name)===n&&(f.style.fontWeight="bold"),f.appendChild(v),s.appendChild(f)}var y=o;if(Object(u.isNumber)(y)){var m,g=document.createElement("span");if((null==t?void 0:t.name)===n&&(g.style.fontWeight="bold"),"function"==typeof h.pointValueformatter)m=h.pointValueformatter(y,e);else if("origin"===h.precision)m=y;else if("short"===h.precision){m=function(e){e:for(var t,i=e.length,n=1,o=-1;n<i;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(o>0){if(!+e[n])break e;o=0}}return o>0?e.slice(0,o)+e.slice(t+1):e}(d.format(".5s")(y))}else m=h.precision>0?d.format(",."+h.precision+"f")(y):d.format(",.3f")(y);m+=r?"(空值填补,仅限看图使用)":"";var b=document.createTextNode(m);g.appendChild(b),s.appendChild(g)}O.appendChild(s)}})),_){var E=document.createElement("li"),z=document.createTextNode("......");E.appendChild(z),O.appendChild(E)}g.appendChild(w)}var M=g.offsetWidth,P=g.offsetHeight,T=this.container.getBoundingClientRect(),I=(n||i.layerX)+T.left,N=(r||i.layerY)+T.top;m.style.left="".concat(I-M-20,"px"),m.style.top="".concat(N+20,"px"),I-M-20<0&&(m.style.left="".concat(I+20,"px")),N+20+P>y&&(m.style.top=N-P-20<0?"0px":"".concat(N-P-20,"px")),m.style.zIndex="9999",m.style.visibility="visible"}},{key:"drawSymbol",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.ctx,i=this.options;e.forEach((function(e){var n=e.x,o=e.y,r=e.color,s=e.name;i.notDisplayedSeries.indexOf(s)>-1||(t.beginPath(),t.arc(n,o,5,0,360,!1),t.lineWidth=1,t.fillStyle=r,t.fill(),t.beginPath(),t.arc(n,o,3,0,360,!1),t.lineWidth=1,t.fillStyle="white",t.fill())}))}},{key:"drawCrosshair",value:function(e,t,i){var n=this.ctx,o=this.options,r=o.chart,s=o.xAxis,a=t||e.offsetX||e.layerX,c=i||e.offsetY||e.layerY,l=r.height-s.tickpadding-s.labels.fontSize-s.tickLength,h=r.width,d=[3,3];n.beginPath(),n.setLineDash(d),n.moveTo(a,0),n.lineTo(a,l),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath(),n.beginPath(),n.setLineDash(d),n.moveTo(0,c),n.lineTo(h,c),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath()}},{key:"destroy",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-tooltip"));t&&t.parentNode&&t.parentNode.removeChild(t)}}]),e}(),q=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=i}return h()(e,[{key:"draw",value:function(e,t,i){var n=this.options,o=n.series,r=n.chart,s=r.colors,a=r.height,c=n.xAxis,l=n.yAxis2,h=n.xkey,f=n.ykey,p=n.ykey2,v=n.timestamp,y=n.fillNull,m=n.notDisplayedSeries,g=n.curve,b=this.options.line,x=b.width,_=b.showPoints,k=void 0===_?"never":_,w=b.pointSize,O=void 0===w?5:w,S=this.options.area,C=S.opacity,L=S.gradientMode,A=S.gradientOpacityStopColor,j=this.ctx,E=function(t){var i="X"===v?1e3*t[h]:t[h];return e(new Date(i))},z=function(e,n,o){var r=e[n],s=l.visible&&l.matchRefId&&o===l.matchRefId?i:t;return"number"!=typeof r||isNaN(r)?"number"==typeof y?s(y):void 0:s(r)},M=function(e){return"number"==typeof e[f]||"number"==typeof y};Object(u.sortBy)(o,"zIndex").forEach((function(e,t){if(!1!==e.visible&&!(m.indexOf(e.name)>-1)){var i,n=e.color||P(s,t),o=e.areaColor||n;if(e.color=n,e.areaColor=o,"opacity"===L&&((i=j.createLinearGradient(0,0,0,a)).addColorStop(0,n),i.addColorStop(1,A)),C>0||e.opacity){j.beginPath();var r=d.area().x(E).y0((function(t){return p&&p in t?z(t,f,e.refId):c.visible?a-c.tickpadding-c.labels.fontSize-5:a})).y1((function(t){return z(t,p&&p in t?p:f,e.refId)})).defined(M).context(j);g.enabled&&"smooth"===g.mode&&r.curve(d.curveMonotoneX),r(e.data||[]),j.fillStyle="opacity"===L&&i?i:o,j.globalAlpha=C||(e.opacity?e.opacity:.5),j.fill(),j.closePath()}if(x>0&&void 0===e.opacity){j.beginPath();var l=d.line().x(E).y((function(t){return z(t,f,e.refId)})).defined(M).context(j);g.enabled&&"smooth"===g.mode&&l.curve(d.curveMonotoneX),j.lineTo(0,0),l(e.data||[]),j.lineJoin="round",j.lineWidth=x,j.strokeStyle=n,j.lineCap="round",j.globalAlpha=1,j.setLineDash(e.lineDash||[]),j.stroke(),j.closePath()}"always"===k&&Object(u.forEach)(e.data,(function(t){var i=E(t),o=z(t,f,e.refId);"number"==typeof o&&(j.beginPath(),j.arc(i,o,O/2,0,2*Math.PI),j.fillStyle=n,j.globalAlpha=1,j.fill(),j.closePath())}))}}))}}]),e}(),V=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=i}return h()(e,[{key:"draw",value:function(e,t,i){var n=this.options,o=n.series,r=n.chart,s=r.colors,a=r.height,c=r.width,l=n.xAxis,h=n.timestamp,f=n.xkey,p=n.ykey,v=n.notDisplayedSeries,y=this.ctx,m=this.options.area.opacity;Object(u.sortBy)(o,"zIndex").forEach((function(n,o){if(!1!==n.visible&&!(v.indexOf(n.name)>-1)){var r=n.color||P(s,o);n.color=r,y.fillStyle=r,y.globalAlpha=m;var u=d.scaleBand().domain(n.data.map((function(e){return"X"===h?1e3*e[f]:e[f]}))).range([0,c]).padding(.3),g=(null==i?void 0:i.k)||1;n.data.forEach((function(i){var n="X"===h?1e3*i[f]:i[f],o=a-t(i[p])-l.tickpadding-l.labels.fontSize-5;o>0&&o<1&&(o=1),y.fillRect(e(n)-u.bandwidth()*g/2,t(i[p]),u.bandwidth()*g,o)})),y.globalAlpha=1}}))}}]),e}(),G=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.reset=void 0,this.options=t,this.init(n,o),this.reset=i}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart,n=i.id,o=i.containerHeight,r=document.getElementById("".concat(n,"-zoom"));r&&r.remove(),r=document.createElement("div");var s=document.createElement("div"),a=document.createElement("a"),c=document.createTextNode("Reset zoom");r.id="".concat(n,"-zoom"),r.className="ts-graph-zoom",s.id="".concat(n,"-zoom-marker"),s.className="ts-graph-zoom-marker",s.style.height="".concat(o,"px"),a.id="".concat(n,"-zoom-resetBtn"),a.className="ts-graph-zoom-resetBtn",a.appendChild(c),r.appendChild(s),r.appendChild(a),e.insertBefore(r,t),this.onReset()}},{key:"onReset",value:function(){var e=this,t=this.options.chart.id,i=document.getElementById("".concat(t,"-zoom-resetBtn"));null==i||i.addEventListener("click",(function(t){t.stopPropagation(),e.reset(),e.clearResetBtn()}))}},{key:"onZoom",value:function(e,t,i){var n=this.options.chart.width,o=t.layerX-e.layerX;if(o){var r=n/Math.abs(o),s=t.layerX>e.layerX?e.layerX:t.layerX,a=d.zoomIdentity.translate(-s*r,0).scale(r);this.options.hideResetBtn||this.drawResetBtn(),i(a)}}},{key:"clearMarker",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-zoom-marker"));t.style.display="none",t.style.width="0px",t.style.left="unset",t.style.right="unset"}},{key:"drawMarker",value:function(e,t){var i=this.options.chart.marginLeft,n=e.layerX,o=t.layerX,r=this.options.chart,s=r.id,a=r.containerWidth,c=document.getElementById("".concat(s,"-zoom-marker"));c.style.display="block",c.style.top="0px",n<o?(c.style.right="unset",c.style.left="".concat(n+i,"px"),c.style.width="".concat(o-n,"px")):(c.style.left="unset",c.style.right="".concat(a-n-i,"px"),c.style.width="".concat(n-o,"px"))}},{key:"clearResetBtn",value:function(){var e=this.options.chart.id;document.getElementById("".concat(e,"-zoom-resetBtn")).style.display="none"}},{key:"drawResetBtn",value:function(){var e=this.options.chart.id;document.getElementById("".concat(e,"-zoom-resetBtn")).style.display="block"}}]),e}(),U=function(){function e(t,i,n,o){var r=this;c()(this,e),this.options=void 0,this.onLegendItemClick=void 0,this.handelLegendItemClick=function(e){var t=e.currentTarget;if(t){t.classList.contains("ts-graph-legend-item-active")?t.classList.remove("ts-graph-legend-item-active"):t.classList.add("ts-graph-legend-item-active");var i=t.getAttribute("data-serie");i&&r.onLegendItemClick(i)}},this.options=t,this.init(n,o),this.onLegendItemClick=i}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart.id,n=document.createElement("div");n.id="".concat(i,"-legend"),n.className="ts-graph-legend",document.getElementById(n.id)||e.insertBefore(n,t)}},{key:"initEvent",value:function(){var e=this,t=this.options.chart.id;document.getElementById("".concat(t,"-legend")).querySelectorAll(".ts-graph-legend-item").forEach((function(t){t.removeEventListener("click",e.handelLegendItemClick),t.addEventListener("click",e.handelLegendItemClick)}))}},{key:"updateOptions",value:function(e){this.options=e}},{key:"draw",value:function(){var e=this.options,t=e.chart.id,i=e.series,n=e.legend,o=document.getElementById("".concat(t,"-legend"));if(n.enabled){if("[object Array]"===Object.prototype.toString.call(i)){o.innerHTML="";var r=document.createDocumentFragment();i.forEach((function(e){var t=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span"),o=document.createElement("span"),s=document.createTextNode(e.name);t.className="ts-graph-legend-item",t.setAttribute("data-serie",e.name),i.className="ts-graph-legend-item-symbol",n.className="ts-graph-legend-item-symbol-line",n.style.borderColor=e.color,o.className="ts-graph-legend-item-symbol-point",o.style.backgroundColor=e.color,i.appendChild(n),i.appendChild(o),t.appendChild(i),t.appendChild(s),r.appendChild(t)})),o.appendChild(r)}this.initEvent()}}}]),e}(),$=function(){function e(t,i){c()(this,e),this.options=void 0,this.options=t,this.init(i)}return h()(e,[{key:"init",value:function(e){var t=this.options.chart.id,i=document.getElementById("".concat(t,"-shapes"));i&&i.remove(),(i=document.createElement("div")).id="".concat(t,"-shapes"),i.className="ts-graph-shapes",e.appendChild(i),i.addEventListener("mouseover",this.onMouseMove.bind(this)),i.addEventListener("click",this.onClick.bind(this))}},{key:"onMouseMove",value:function(e){var t=this.options,i=t.shapes,n=t.onShapeMouseOver;if("IMG"===e.target.tagName){var o=Object(u.find)(i,{id:e.target.dataset.id});o&&"function"==typeof n&&n(e,o)}}},{key:"onClick",value:function(e){var t=this.options,i=t.shapes,n=t.onShapeClick;if("IMG"===e.target.tagName){var o=Object(u.find)(i,{id:e.target.dataset.id});o&&"function"==typeof n&&n(e,o)}}},{key:"draw",value:function(e,t){var i=this.options,n=i.chart.id,o=i.shapes,r=document.getElementById("".concat(n,"-shapes"));r&&"[object Array]"===Object.prototype.toString.call(o)&&(r.innerHTML="",o.forEach((function(i){var n=document.createElement("img");n.src=i.imgData,n.dataset.id=i.id,n.style.position="absolute",n.onload=function(){n.style.left="".concat(e(i.x)+n.width/2,"px"),n.style.top="".concat(t(i.y)-n.height/2,"px")},r.appendChild(n)})))}},{key:"destroy",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-shapes"));t&&(t.removeEventListener("mouseover",this.onMouseMove),t.removeEventListener("click",this.onClick),t.parentNode&&(t.innerHTML=""))}}]),e}();i(12);function K(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Q(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ee(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var te=new C.a,ie=function(){function e(t){var i=this;c()(this,e),this.options=void 0,this.container=void 0,this.frontContext=void 0,this.backContext=void 0,this.eventCanvas=void 0,this.frontCanvas=void 0,this.backCanvas=void 0,this.xAxis=void 0,this.xScales=void 0,this.yAxis=void 0,this.yAxis2=void 0,this.yScales=void 0,this.y2Scales=void 0,this.line=void 0,this.bar=void 0,this.legend=void 0,this.tooltip=void 0,this.zoom=void 0,this.transform=void 0,this.shapes=void 0,this.isMouserover=void 0,this.showTooltip=function(e,t,n,o){if(!i.isMouserover){var r=i.options.chart.width*n,s=i.options.chart.height*o;i.tooltip.draw(e,i,t,r,s)}},this.hideTooltip=function(){i.tooltip.clear()},this.getZoomedSeries=function(){var e=i.options,t=e.chart.renderTo,n=e.series,o=e.timestamp,r=e.xkey,s=t.offsetWidth;return n.map((function(e){if("[object Array]"===Object.prototype.toString.call(e.data)){var t=e.data.filter((function(e){var t="X"===o?1e3*e[r]:e[r],n=i.xScales(new Date(t));return n>=0&&n<=s}));return ee(ee({},e),{},{data:t})}return e}))},this.handleResize=function(){var e=i.options.chart,t=e.renderTo.offsetWidth,n=e.renderTo.offsetHeight;i.options.chart.width=t-e.marginLeft-e.marginRight,i.options.chart.height=n-e.marginTop-e.marginBottom,i.options.chart.containerWidth=t,i.options.chart.containerHeight=n,i.container.style.width="".concat(t,"px"),i.container.style.height="".concat(n,"px"),i.retinaScaled(i.backCanvas,"back"),i.retinaScaled(i.frontCanvas,"front"),i.retinaScaled(i.eventCanvas,"event"),i.initScales(),i.initZoom(),i.draw(!1)},this.handleZoom=function(e,t){if(i.options.onZoomWithoutDefult){var n;t&&(n=Object(u.sortBy)(t,"layerX").map((function(e){return i.xScales.invert(e.layerX)}))),i.options.onZoomWithoutDefult(n)}else{var o=i.options,r=o.ykey,s=o.ykey2,a=o.yAxis,c=o.yAxis2,l=o.ykeyFormatter,h=i.options.series;if(e?(i.transform=e,i.xScales=e.rescaleX(i.xScales),h=i.getZoomedSeries()):(i.transform=void 0,i.xScales=i.xAxis.init()),Array.isArray(h)){var d,f=a.min||-1/0,p=a.max||1/0,v=c.min||-1/0,y=c.max||1/0,m=K(h);try{for(m.s();!(d=m.n()).done;){var g=d.value,b=Array.isArray(g.data)?g.data:[],x=void 0;for(x=0;x<b.length;x++){var _=b[x],k=W(_[r],l);if(null!==k&&(c.visible&&c.matchRefId&&c.matchRefId===g.refId?(v<k&&(v=k),y>k&&(y=k)):(f<k&&(f=k),p>k&&(p=k)),s)){var w=W(_[s],l);if(null===w)continue;f<w&&(f=w),p>w&&(p=w)}}}}catch(e){m.e(e)}finally{m.f()}f!==-1/0&&p!==1/0&&(i.yAxis.setDomain(i.yScales,{ymin:f,ymax:p}),c.visible&&c.matchRefId&&i.yAxis2.setDomain(i.y2Scales,{y2min:v,y2max:y}))}i.options.onZoom(i.getZoomedSeries)}i.draw(!1)},this.handleLegendItemClick=function(e){var t=i.options.notDisplayedSeries;-1===t.indexOf(e)?t.push(e):i.options.notDisplayedSeries=t.filter((function(t){return t!==e})),i.draw(!1)};var n={ratio:window.devicePixelRatio||1,xkey:0,ykey:1,ykey2:2,oykey:"__originValue",timestamp:"x",chart:{id:Object(u.uniqueId)("ts-graph-"),colors:["#3399CC","#CC9933","#9966CC","#66CC66","#CC3333","#99CCCC","#CCCC66","#CC99CC","#99CC99","#CC6666","#336699","#996633","#993399","#339966","#993333"],width:t.chart.renderTo.clientWidth,height:t.chart.renderTo.clientHeight||350,marginTop:10,marginRight:10,marginBottom:10,marginLeft:10},xAxis:{visible:!0,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",labels:{color:"#999",fontSize:11}},yAxis:{scale:{type:"linear",log:10},visible:!0,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",gridLineColor:"#f6f6f6",labels:{color:"#999",fontSize:11}},yAxis2:{scale:{type:"linear",log:10},visible:!1,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",labels:{color:"#999",fontSize:11}},type:"line",line:{enable:!0,width:2,showPoints:"none",pointSize:5},area:{opacity:0,gradientMode:"none",gradientOpacityStopColor:"rgba(255, 255, 255, 0)"},bars:{},stack:{enabled:!1},curve:{enabled:!1},tooltip:{shared:!0,cascade:!1,cascadeScope:void 0,cascadeMode:"sharedTooltip",timeFormat:"%Y-%m-%d %H:%M:%S"},series:[],legend:{align:"center",verticalAlign:"top",enabled:!1},fillNull:void 0,onClick:void 0,onRightClick:function(){},onZoom:function(){},onShapeMouseOver:function(){},onShapeClick:function(){}},o=Object(u.merge)({},n,t);void 0===t.chart.marginTop&&o.legend.enabled&&(o.chart.marginTop=20),this.handleResize=Object(u.debounce)(this.handleResize,300),this.init(o)}return h()(e,[{key:"init",value:function(e){var t=e.chart;this.isMouserover=!1,this.options=e,this.options.notDisplayedSeries=[],this.options.chart.containerWidth=t.width,this.options.chart.containerHeight=t.height,this.options.chart.width=t.width-t.marginLeft-t.marginRight,this.options.chart.height=t.height-t.marginTop-t.marginBottom,this.createContainer(),this.createCanvas(),this.initSeries(),this.initScales(),this.initEvent(),"line"===this.options.type&&this.initLine(),"bar"===this.options.type&&this.initBar(),this.initLegend(),this.initTooltip(),this.initZoom(),this.initShapes(),this.draw()}},{key:"clearRect",value:function(e){var t=this.options.chart,i=t.containerWidth,n=t.containerHeight;e.clearRect(0,0,i,n)}},{key:"draw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.transform;this.clearRect(this.backContext),this.options.yAxis.visible&&this.yAxis.drawGridLine(this.yScales),this.options.xAxis.visible&&this.xAxis.draw(this.xScales),"line"===this.options.type&&this.line.draw(this.xScales,this.yScales,this.y2Scales),"bar"===this.options.type&&this.bar.draw(this.xScales,this.yScales,t),this.xAxis.drawPlotLines(this.xScales),this.yAxis.drawPlotLines(this.yScales),this.options.yAxis.visible&&this.yAxis.draw(this.yScales),this.options.yAxis2.visible&&this.options.yAxis2.matchRefId&&this.yAxis2.draw(this.y2Scales),e&&this.legend.draw(),this.shapes.draw(this.xScales,this.yScales)}},{key:"update",value:function(e){var t=Object(u.assign)({},this.options,e);e.series&&(t.series=e.series),this.options=t,this.offEvents(),this.initSeries(),this.initScales(),this.initEvent(),"line"===this.options.type&&this.initLine(),"bar"===this.options.type&&this.initBar(),this.initTooltip(),this.initShapes(),this.legend.updateOptions(t),this.draw()}},{key:"getSeries",value:function(){return o()(this.options.series)}},{key:"initEvent",value:function(){var e,t=this.options.tooltip,i=t.cascade,n=t.cascadeScope,o=n?"plotmove:".concat(n):"plotmove",r=n?"plotleave:".concat(n):"plotleave",s=!1,a={},c={},l=this;l.isMouserover=!1;var h=Object(u.debounce)((function(e){l.isMouserover&&(l.tooltip.draw(e,l),s&&l.zoom.drawMarker(a,e))}),5),f=Object(u.throttle)((function(){l.tooltip.clear()}),5),p=function(){if("function"==typeof l.options.onClick){var e=R(d.event,l.options,l.xScales,l.yScales),t=e.x,i=e.y,n=e.nearestPoints;l.options.onClick(d.event,t,i,n)}};d.select(this.eventCanvas).on("mousemove",(function(){if(l.isMouserover=!0,h(d.event),i){var e,t=R(d.event,l.options,l.xScales,l.yScales).nearestPoints;if(t.length)e=t[0].timestamp;var n=d.event.offsetX||d.event.layerX,r=d.event.offsetY||d.event.layerY,s=l.options.chart.width,a=l.options.chart.height;te.emit(o,d.event,e,n/s,r/a)}})).on("mouseleave",(function(){e=d.event,l.isMouserover=!1,f(),i&&te.emit(r)})).on("mousedown",(function(){1===d.event.which&&(s=!0,a=d.event)})).on("mouseup",(function(){d.event.stopPropagation();var e=d.event;a&&a.layerX!==e.layerX?(l.zoom.clearMarker(),l.zoom.onZoom(a,e,(function(t){l.handleZoom(t,[a,e])}))):p(),s=!1,a={}})).on("contextmenu",(function(){l.options.onRightClick(d.event,l.xScales.invert(d.event.offsetX),l.yScales.invert(d.event.offsetY)),d.event.preventDefault()})).on("touchstart",(function(){d.event.touches.length>1&&(s=!0)})).on("touchmove",(function(){var e=I(l.eventCanvas,d.event);1===d.event.touches.length&&l.tooltip.draw(e,l),s&&(a=e,c=I(l.eventCanvas,d.event,1),l.zoom.drawMarker(a,c))})).on("touchend",(function(){l.isMouserover=!1,f(),a&&a.layerX!==c.layerX?(l.zoom.clearMarker(),l.zoom.onZoom(a,c,(function(e){l.handleZoom(e,[a,c])}))):p(),s=!1,a={},c={}})),i&&(te.on(o,this.showTooltip),te.on(r,this.hideTooltip)),window.addEventListener("mouseup",(function(){if(!Object(u.isEmpty)(a)){var t=e;s=!1,l.zoom.clearMarker(),l.zoom.onZoom(a,t,(function(e){l.handleZoom(e,[a,t])})),a={}}})),x(this.options.chart.renderTo,this.handleResize)}},{key:"retinaScaled",value:function(e,t){var i=this.options,n=i.chart,o=i.ratio,r=e.getContext("2d"),s="front"===t?n.containerWidth:n.width,a="front"===t?n.containerHeight:n.height,c="front"===t?"0px":"".concat(n.marginLeft,"px"),l="front"===t?"0px":"".concat(n.marginTop,"px");e.width=s*o,e.height=a*o,e.style.width="".concat(s,"px"),e.style.height="".concat(a,"px"),e.style.position="absolute",e.style.left=c,e.style.top=l,"front"===t&&r.translate(n.marginLeft*o,n.marginTop*o),r.scale(o,o)}},{key:"createContainer",value:function(){var e=this.options.chart,t=document.createElement("div");t.style.position="relative",t.style.width="".concat(e.containerWidth,"px"),t.style.height="".concat(e.containerHeight,"px"),t.style.overflow="hidden",t.className="d3-graph-container",e.renderTo.appendChild(t),this.container=t}},{key:"createCanvas",value:function(){var e=this.options.chart.id;function t(t){var i=document.createElement("canvas"),n=i.getContext("2d");i.setAttribute("id","".concat(e,"-").concat(t,"Canvas")),this.container.appendChild(i),this["".concat(t,"Canvas")]=i,this["".concat(t,"Context")]=n,this.retinaScaled(i,t)}t.call(this,"back"),t.call(this,"front"),t.call(this,"event")}},{key:"initSeries",value:function(){var e=this.options,t=e.fillNull,i=e.series,n=e.xkey,o=e.ykey,r=e.ykey2,a=e.ykeyFormatter,c=e.oykey,l=e.xAxis,h=e.yAxis,d=e.yAxis2,f=e.stack,p=e.notDisplayedSeries,v=l.min||-1/0,y=l.max||1/0,m=h.min,g=h.max,b=d.min,x=d.max;if(Array.isArray(i)){var _=[];i.forEach((function(e,l){var k=void 0===e.visible||e.visible;if(!(p.indexOf(e.name)>-1)){var w,O=Array.isArray(e.data)?e.data:[],S=[],C=!1,L=function(){var h,p=void 0!==O[w][c]?O[w][c]:W(O[w][o],a),_=(h={},s()(h,n,O[w][n]),s()(h,o,p),s()(h,c,p),h);if(r&&r in O[w]&&(_[r]=W(O[w][r],a)),f.enabled){void 0===_[c]&&(_[c]=W(_[o],a));var L=l;if(L>0)for(;L>0;){var A;if(!1!==(null===(A=i[L-1])||void 0===A?void 0:A.visible)){var j=Array.isArray(i[L-1].data)?i[L-1].data:[],E=Object(u.find)(j,(function(e){return e[n]===_[n]}));if(E){var z=isNaN(_[c])?0:_[c],M=W(E[o],a);M=isNaN(M)?0:M,_[o]=M+z;break}1===L&&(_[o]=_[c]),L--}else L--}else _[o]=_[c]}O[w]=_;var P=_[n],T=_[o],I=void 0;r&&r in O[w]&&(I=_[r]),void 0===t?!isNaN(T)&&(0===w||w===O.length-1||w>0&&w<O.length-1&&"number"==typeof T)?(S.push(_),C=!0):C&&(S.push(_),C=!1):S.push(_),(P<v||v===-1/0)&&(v=P),(P>y||y===1/0)&&(y=P),k&&"number"==typeof T&&!isNaN(T)?d.visible&&d.matchRefId&&d.matchRefId===e.refId?(("number"!=typeof b||T<b)&&(b=T),("number"!=typeof x||T>x)&&(x=T)):(("number"!=typeof m||T<m)&&(m=T),"number"==typeof I&&I<m&&(m=I),("number"!=typeof g||T>g)&&(g=T),"number"==typeof I&&I>g&&(g=I)):"number"==typeof t&&(t<m&&(m=t),t>g&&(g=t))};for(w=0;w<O.length;w++)L();"number"!=typeof h.min&&"number"!=typeof h.max||(S=Object(u.map)(S,(function(e){return"number"!=typeof e[o]||isNaN(e[o])?e:"number"==typeof h.min&&e[o]<h.min||"number"==typeof h.max&&e[o]>h.max?ee(ee({},e),{},s()({},o,null)):e}))),_.push(ee(ee({},e),{},{data:S,zIndex:f.enabled?i.length-l:l}))}})),this.options.series=_,this.options.xmin=v,this.options.xmax=y,this.options.ymin=m,this.options.ymax=g,this.options.y2min=b,this.options.y2max=x}}},{key:"initLine",value:function(){this.line=new q(this.options,this.backContext)}},{key:"initBar",value:function(){this.bar=new V(this.options,this.backContext)}},{key:"initTooltip",value:function(){this.tooltip=new Y(this.options,this.frontContext,this.container,this.eventCanvas)}},{key:"initZoom",value:function(){this.zoom=new G(this.options,this.handleZoom,this.container,this.eventCanvas)}},{key:"initLegend",value:function(){this.legend=new U(this.options,this.handleLegendItemClick,this.container,this.eventCanvas)}},{key:"initScales",value:function(){var e=new X(this.options,this.backContext);if(this.yAxis=e,this.yScales=e.init(),this.options.yAxis2.visible&&this.options.yAxis2.matchRefId){var t=new F(this.options,this.backContext);this.yAxis2=t,this.y2Scales=t.init()}var i=new B(this.options,this.backContext,this.yAxis,this.yAxis2);this.xAxis=i;var n=i.init();this.transform&&(n=this.transform.rescaleX(n)),this.xScales=n}},{key:"initShapes",value:function(){var e=new $(this.options,this.container);this.shapes=e}},{key:"offEvents",value:function(){var e=this.options.tooltip,t=e.cascade,i=e.cascadeScope,n=i?"plotmove:".concat(i):"plotmove",o=i?"plotleave:".concat(i):"plotleave";d.select(this.eventCanvas).on("mousemove",null).on("mouseleave",null).on("mousedown",null).on("mouseup",null).on("touchmove",null),function(e,t){let i=e.__resize_listeners__;if(i){if(t&&i.splice(i.indexOf(t),1),!i.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",k),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--g&&b&&b.parentNode.removeChild(b)}}(this.options.chart.renderTo,this.handleResize),t&&(te.off(n,this.showTooltip),te.off(o,this.hideTooltip))}},{key:"destroy",value:function(){this.shapes.destroy(),this.tooltip.destroy(),this.offEvents(),d.select(this.container).remove()}}]),e}()}])}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("d3"),require("lodash"));else if("function"==typeof define&&define.amd)define([,],t);else{var i="object"==typeof exports?t(require("d3"),require("lodash")):t(e.d3,e._);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(window,(function(e,t){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=13)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(8),o=i(9),r=i(10),s=i(11);e.exports=function(e){return n(e)||o(e)||r(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n,o="object"==typeof Reflect?Reflect:null,r=o&&"function"==typeof o.apply?o.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(i,n){function o(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",o),i([].slice.call(arguments))}m(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&m(e,"error",t,i)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,i,n){var o,r,s,a;if(l(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),s=r[t]),void 0===s)s=r[t]=i,++e._eventsCount;else if("function"==typeof s?s=r[t]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(o=h(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},o=u.bind(n);return o.listener=i,n.wrapFn=o,o}function p(e,t,i){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?i?[o.listener||o]:[o]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(o):y(o,o.length)}function v(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function y(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(r){n.once&&e.removeEventListener(t,o),i(r)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,h=y(c,l);for(i=0;i<l;++i)r(h[i],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var i,n,o,r,s;if(l(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(o=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){s=i[r].listener,o=r;break}if(o<0)return this;0===o?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,o),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var o,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(o=r[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},a.prototype.listenerCount=v,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,i){var n=i(6);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(6);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return ie}));var n=i(5),o=i.n(n),r=i(4),s=i.n(r),a=i(2),c=i.n(a),l=i(3),h=i.n(l),d=i(0),u=i(1);let f=null;let p=null;function v(e,t={}){let i=document.createElement(e);return Object.keys(t).forEach(e=>{i[e]=t[e]}),i}function y(e,t,i){return(window.getComputedStyle(e,i||null)||{display:"none"})[t]}function m(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};let t=e;for(;t!==document;){if("none"===y(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}let g=0,b=null;function x(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=_.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){let{offsetWidth:t,offsetHeight:i}=e,n=new ResizeObserver(()=>{(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==t||e.offsetHeight!==i))&&w(e)}),{detached:o,rendered:r}=m(e);e.__resize_observer_triggered__=!1===o&&!1===r,e.__resize_observer__=n,n.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){w(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(g||(b=function(e){var t=document.createElement("style");return t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){let t=y(e,"position");t&&"static"!==t||(e.style.position="relative");e.__resize_old_position__=t,e.__resize_last__={};let i=v("div",{className:"resize-triggers"}),n=v("div",{className:"resize-expand-trigger"}),o=v("div"),r=v("div",{className:"resize-contract-trigger"});n.appendChild(o),i.appendChild(n),i.appendChild(r),e.appendChild(i),e.__resize_triggers__={triggers:i,expand:n,expandChild:o,contract:r},O(e),e.addEventListener("scroll",k,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=m(e).rendered,window.MutationObserver){let t=new MutationObserver(e.__resize_mutation_handler__);t.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=t}e.__resize_listeners__.push(t),g++}function _(){let{rendered:e,detached:t}=m(this);e!==this.__resize_rendered__&&(!t&&this.__resize_triggers__&&(O(this),this.addEventListener("scroll",k,!0)),this.__resize_rendered__=e,w(this))}function k(){var e,t;O(this),this.__resize_raf__&&(e=this.__resize_raf__,p||(p=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),p(e)),this.__resize_raf__=(t=()=>{let e=function(e){let{width:t,height:i}=e.__resize_last__,{offsetWidth:n,offsetHeight:o}=e;return n!==t||o!==i?{width:n,height:o}:null}(this);e&&(this.__resize_last__=e,w(this))},f||(f=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),f(t))}function w(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach(t=>{t.call(e,e)})}function O(e){let{expand:t,expandChild:i,contract:n}=e.__resize_triggers__,{scrollWidth:o,scrollHeight:r}=n,{offsetWidth:s,offsetHeight:a,scrollWidth:c,scrollHeight:l}=t;n.scrollLeft=o,n.scrollTop=r,i.style.width=s+1+"px",i.style.height=a+1+"px",t.scrollLeft=c,t.scrollTop=l}var S=i(7),C=i.n(S);function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(e,t){return"X"===t?1e3*e:e}function E(e){var t,i=e.series,n=e.x,o=e.xkey,r=e.ykey,s=e.ykey2,a=e.oykey,c=e.timestamp,l=e.fillNull,h=(t=function(e,t){return(i=j(e[o],c))<(n=t)?-1:i>n?1:i>=n?0:NaN;var i,n},{left:function(e,i,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var r=n+o>>>1;t(e[r],i)<0?n=r+1:o=r}return n},right:function(e,i,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var r=n+o>>>1;t(e[r],i)>0?o=r:n=r+1}return n}}).left,d=new Date(n).getTime(),f=[];return"[object Array]"!==Object.prototype.toString.call(i)?[]:(i.forEach((function(e,t){if(!function(e,t){return Object(u.some)(e.data,(function(e){return t&&t in e}))}(e,s)&&!1!==e.visible){var i=e.name,p=e.color,v=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&"[object Function]"===Object.prototype.toString.call(t)&&t(n)&&(i[n]=e[n]);return i}(e,(function(e){return"data"!==e})),y=e.data,m=void 0===y?[]:y;if("[object Array]"===Object.prototype.toString.call(m)&&0!==(m=m.filter((function(e){return"number"==typeof e[r]||"number"==typeof l}))).length){var g,b=h(m,n),x=m[b-1],_=m[b];if(x&&_){var k=j(x[o],c),w=j(_[o],c),O=x[r],S=_[r];null===O&&void 0!==l&&(O=l),null===S&&void 0!==l&&(S=l),g=d-k<w-d?A(A({},x),{},{name:i,color:p,timestamp:k,value:O,origin:x[a],serieIndex:t,serieOptions:v}):A(A({},_),{},{name:i,color:p,timestamp:w,value:S,origin:_[a],serieIndex:t,serieOptions:v}),f.push(g)}else if(x){var C=j(x[o],c),L=x[r];null===L&&void 0!==l&&(L=l),g=A(A({},x),{},{name:i,color:p,timestamp:C,value:L,origin:x[a],serieIndex:t,serieOptions:v}),f.push(g)}else if(_){var E=j(_[o],c),z=_[r];null===z&&void 0!==l&&(z=l),g=A(A({},_),{},{name:i,color:p,timestamp:E,value:z,origin:_[a],serieIndex:t,serieOptions:v}),f.push(g)}}}})),f)}function z(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function M(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?z(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function P(e,t){var i=e.length;return t<i?e[t]:P(e,t-i)}function T(e,t){return"X"===t?1e3*e:e}function I(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.getBoundingClientRect(),o=t.touches[i].clientX,r=t.touches[i].clientY,s=o-n.left,a=r-n.top;return{offsetX:s,offsetY:a,clientX:o,clientY:r}}function N(e){var t=String(e);if(e>=1e3){t=d.format(".5s")(e);var i=/[kMGTPEZY]$/;if(i.test(t)){var n=t[t.length-1];t=t.replace(i,""),t=parseFloat(t)+n}}return t}function D(e,t,i){var n=e.map((function(e){var n;return n="function"==typeof i?i(e):N(e),t.measureText(n).width}));return Object(u.max)(n)}function W(e,t){var i=e;return null!==e&&"function"==typeof t&&(i=t(e)),i}function R(e,t,i,n){var o=t.xkey,r=t.ykey,s=t.ykey2,a=t.oykey,c=t.timestamp,l=t.series,h=t.fillNull,d=e.offsetX||e.layerX,u=e.offsetY||e.layerY,f=i.invert(d);return{x:f,y:n.invert(u),nearestPoints:E({x:f,xkey:o,ykey:r,ykey2:s,oykey:a,timestamp:c,series:l,fillNull:h})}}var B=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.ctx=void 0,this.yAxis=void 0,this.y2Axis=void 0,this.options=t,this.ctx=i,this.yAxis=n,this.y2Axis=o}return h()(e,[{key:"init",value:function(){var e,t=this.options,i=t.chart.width,n=t.timestamp,o=t.xmin,r=t.xmax,s=t.xAxis,a=this.yAxis.tickMaxWidth||0,c=(null===(e=this.y2Axis)||void 0===e?void 0:e.tickMaxWidth)||0,l=d.scaleTime().range([s.visible?a:0,i-c]);return l.domain([T(o,n)-(o===r?1e3:0),T(r,n)+(o===r?1e3:0)]),l}},{key:"draw",value:function(e){var t=this.ctx,i=this.options,n=i.chart,o=i.xAxis,r=i.time,s=e.ticks(Math.floor(n.width/90));o.ticks&&(s=o.ticks);var a=n.height-o.tickpadding-o.labels.fontSize;t.beginPath(),s.forEach((function(i){var n=e(i);n&&(t.moveTo(n,a),t.lineTo(n,a-o.tickLength))})),t.lineWidth=1,t.strokeStyle=o.tickColor,t.stroke(),t.closePath(),t.beginPath(),t.moveTo(this.yAxis.tickMaxWidth||0,a-o.tickLength),t.lineTo(n.width,a-o.tickLength),t.lineWidth=1,t.strokeStyle=o.lineColor,t.stroke(),t.closePath(),t.textAlign="center",t.textBaseline="bottom",t.fillStyle=o.labels.color,t.font="".concat(o.labels.fontSize,"px Palantino"),s.forEach((function(i,a){var c="%H:%M";0!==i.getSeconds()&&(c="%H:%M:%S"),0===i.getHours()&&0===i.getMinutes()&&0===i.getSeconds()&&(c="%m-%d"),o.labels.timeFormat&&(c=o.labels.timeFormat);var l=i;if(r&&void 0!==r.timezoneOffset){var h=i.getTimezoneOffset(),u=i.getTime()+60*h*1e3+60*r.timezoneOffset*1e3;l=new Date(u)}if(o.ticks&&o.ticks.length>1){var f=e(i);0===a?f+=c.length*o.labels.fontSize/4+1:a===s.length-1&&(f-=c.length*o.labels.fontSize/4-1),t.fillText(d.timeFormat(c)(l),f,n.height)}else e(i)&&t.fillText(d.timeFormat(c)(l),e(i),n.height)}))}},{key:"drawPlotLines",value:function(e){var t=this.ctx,i=this.options,n=i.chart,o=i.xAxis,r=i.xAxis.plotLines,s=n.height-o.tickpadding-o.labels.fontSize;Array.isArray(r)&&r.forEach((function(n){var r=e("X"===i.timestamp?1e3*n.value:n.value);t.setLineDash([5,3]),t.beginPath(),t.moveTo(r,0),t.lineTo(r,s-o.tickLength),t.strokeStyle=n.color,t.stroke(),t.setLineDash([])}))}}]),e}(),X=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.tickLength=void 0,this.ticks=void 0,this.tickMaxWidth=void 0,this.options=t;var n=t.yAxis;i.font="".concat(n.labels.fontSize,"px Palantino"),this.ctx=i,this.tickLength=Math.floor(t.chart.height/50),this.ticks=[],this.tickMaxWidth=0}return h()(e,[{key:"init",value:function(){var e=this.options,t=e.chart,i=e.xAxis,n=e.yAxis,o=d.scaleLinear();n.scale&&"log"===n.scale.type&&(o=d.scaleLog().base(n.scale.log||10));var r=o.range([t.height-(i.labels.fontSize+i.tickpadding+i.tickLength),10]);return this.setDomain(r,this.options),r}},{key:"getPlotLinesMaxAbs",value:function(){var e,t=this.options.yAxis.plotLines;return Array.isArray(t)&&t.forEach((function(t){(!e||Math.abs(e)<Math.abs(t.value))&&(e=t.value)})),e}},{key:"setDomain",value:function(e,t){var i=t.ymin,n=t.ymax,o=this.options.yAxis,r=this.tickLength;if(i===n&&0!==i){var s=(n-i)/(this.tickLength-1),a=s/2||n||1;r=0===s?1:this.tickLength,i-=a,n+=a}if(i>n){var c=i;i=n,n=c}if(o.plotLinesFixed||i===n){var l=this.getPlotLinesMaxAbs();l&&(l<i&&(i=l),l>n&&(n=l))}var h=[];if("number"==typeof o.min||"number"==typeof o.max){var f="number"==typeof o.min?o.min:i,p="number"==typeof o.max?o.max:n;if(e.domain([f,p]),"number"==typeof o.min&&o.min>p)h=[o.min];else if("number"==typeof o.max&&o.max<f)h=[o.max];else{var v=d.tickStep(f,p,r);h=Object(u.map)(d.range(f,p,v),(function(e){return Object(u.floor)(e,2)}))}}else e.domain([i,n]),e.nice(r),h=e.ticks(r);o.ticksHandler&&(h=o.ticksHandler(h));var y=D(h,this.ctx,o.tickValueFormatter)+5;this.ticks=h,this.tickMaxWidth=y}},{key:"draw",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.yAxis,r=n.chart;i.beginPath(),i.fillStyle=o.backgroundColor||"#fff",i.fillRect(0,0,this.tickMaxWidth,r.height-12),i.stroke(),i.closePath(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=o.labels.color,i.lineWidth=1,i.fillStyle=o.labels.color,this.ticks.forEach((function(n){var r;r="function"==typeof o.tickValueFormatter?o.tickValueFormatter(n):N(n);var s=e(n);i.fillText(r,t.tickMaxWidth-5,s)}))}},{key:"drawGridLine",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.chart,r=n.yAxis;i.beginPath(),this.ticks.forEach((function(n){var r=e(n);i.moveTo(t.tickMaxWidth,r),i.lineTo(o.width,r)})),i.lineWidth=1,i.strokeStyle=r.gridLineColor,i.stroke(),i.closePath()}},{key:"drawPlotLines",value:function(e){var t=this,i=this.ctx,n=this.options,o=n.chart,r=n.yAxis,s=n.yAxis.plotLines;Array.isArray(s)&&s.forEach((function(n){var s=n.labelEnable,a=void 0===s||s,c=n.label,l=n.textAlign,h=void 0===l?"right":l,d=e(n.value);if(i.setLineDash([5,3]),i.beginPath(),i.moveTo(0,d),i.lineTo(o.width,d),i.strokeStyle=n.color,i.stroke(),i.setLineDash([]),a){var u=c||String(n.value),f="right"===h?o.width-8:t.tickMaxWidth+8;i.textAlign=h,i.textBaseline="top",i.lineWidth=1,i.fillStyle=n.color,i.font="".concat(r.labels.fontSize,"px Palantino"),i.fillText(u,f,d)}}))}}]),e}(),F=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.tickLength=void 0,this.ticks=void 0,this.tickMaxWidth=void 0,this.options=t;var n=t.yAxis;i.font="".concat(n.labels.fontSize,"px Palantino"),this.ctx=i,this.tickLength=Math.floor(t.chart.height/50),this.ticks=[],this.tickMaxWidth=0}return h()(e,[{key:"init",value:function(){var e=this.options,t=e.chart,i=e.xAxis,n=e.yAxis,o=d.scaleLinear();n.scale&&"log"===n.scale.type&&(o=d.scaleLog().base(n.scale.log||10));var r=o.range([t.height-(i.labels.fontSize+i.tickpadding+i.tickLength),10]);return this.setDomain(r,this.options),r}},{key:"getPlotLinesMaxAbs",value:function(){var e,t=this.options.yAxis.plotLines;return Array.isArray(t)&&t.forEach((function(t){(!e||Math.abs(e)<Math.abs(t.value))&&(e=t.value)})),e}},{key:"setDomain",value:function(e,t){var i=t.y2min,n=t.y2max,o=this.options,r=o.yAxis,s=o.yAxis2,a=this.tickLength;if(i===n&&0!==i){var c=(n-i)/(this.tickLength-1),l=c/2||n||1;a=0===c?1:this.tickLength,i-=l,n+=l}if(i>n){var h=i;i=n,n=h}if(r.plotLinesFixed||i===n){var f=this.getPlotLinesMaxAbs();f&&(f<i&&(i=f),f>n&&(n=f))}var p=[];if("number"==typeof r.min||"number"==typeof r.max){var v="number"==typeof r.min?r.min:i,y="number"==typeof r.max?r.max:n;if(e.domain([v,y]),"number"==typeof r.min&&r.min>y)p=[r.min];else if("number"==typeof r.max&&r.max<v)p=[r.max];else{var m=d.tickStep(v,y,a);p=Object(u.map)(d.range(v,y,m),(function(e){return Object(u.floor)(e,2)}))}}else e.domain([i,n]),e.nice(a),p=e.ticks(a);var g=D(p,this.ctx,s.tickValueFormatter)+10;this.ticks=p,this.tickMaxWidth=g}},{key:"draw",value:function(e){var t=this.ctx,i=this.options,n=i.yAxis2,o=i.chart;t.beginPath(),t.fillStyle=n.backgroundColor||"#fff",t.fillRect(o.width-this.tickMaxWidth,0,this.tickMaxWidth,o.height-12),t.stroke(),t.closePath(),t.textAlign="right",t.textBaseline="middle",t.strokeStyle=n.labels.color,t.lineWidth=1,t.fillStyle=n.labels.color,this.ticks.forEach((function(i){var r;r="function"==typeof n.tickValueFormatter?n.tickValueFormatter(i):N(i);var s=e(i);t.fillText(r,o.width-5,s)}))}}]),e}();function H(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?H(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Y=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.ctx=void 0,this.flag=void 0,this.container=void 0,this.isMouserover=void 0,this.options=t,this.ctx=i,this.flag=!1,this.container=n,this.init(n,o),this.isMouserover=!1}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart.id,n=document.createElement("div");n.id="".concat(i,"-tooltip"),n.className="ts-graph-tooltip",document.getElementById(n.id)||document.body.append(n)}},{key:"clear",value:function(){var e=this.options,t=e.ratio,i=e.chart,n=i.id,o=i.containerWidth,r=i.containerHeight,s=document.getElementById("".concat(n,"-tooltip"));this.isMouserover=!1,this.ctx.save(),this.ctx.setTransform(1*t,0,0,1*t,0,0),this.ctx.clearRect(0,0,o,r),this.ctx.restore(),s.style.top="-99999px",s.lastChild&&s.removeChild(s.lastChild)}},{key:"getNearestPoints",value:function(e,t,i,n,o,r){var s=this.options,a=s.series,c=void 0===a?[]:a,l=s.chart.colors,h=s.tooltip.shared,d=s.xkey,f=s.ykey,p=s.ykey2,v=s.oykey,y=s.timestamp,m=s.fillNull,g=s.yAxis2,b=e.offsetX||e.layerX,x=e.offsetY||e.layerY,_=t.invert(b),k=i.invert(x),w=[];if(!1!==this.isMouserover){var O=[];O=r?function(e,t){var i=t.series,n=void 0===i?[]:i,o=t.xkey,r=t.ykey,s=t.oykey,a=t.timestamp,c=[];return n.forEach((function(t,i){if(!1!==t.visible){var n=t.name,l=t.color,h=Object(u.pickBy)(t,(function(e,t){return"data"!==t})),d=t.data,f=void 0===d?[]:d;"[object Array]"===Object.prototype.toString.call(f)&&f.forEach((function(t){var d=T(t[o],a);d===e&&c.push(M(M({},t),{},{name:n,color:l,timestamp:d,value:t[r],origin:t[s],serieIndex:i,serieOptions:h}))}))}})),c}(r,this.options):E({x:_,xkey:d,ykey:f,ykey2:p,oykey:v,timestamp:y,series:c,fillNull:m});var S,C,L=function(e,t){var i=e.map((function(e){return A(A({},e),{},{distance:Math.abs(e.value-t)})})).sort((function(e,t){return e.distance-t.distance}))[0];return Object(u.omit)(i,["distance"])}(w=O.map((function(e){var o=g.visible&&g.matchRefId&&e.serieOptions.refId===g.matchRefId?n:i;return Z(Z({},e),{},{x:t(e.timestamp),y:o(e.value),color:e.color||P(l,e.serieIndex)})})),k),j=Object(u.groupBy)(w,"x");if(Object(u.keys)(j).length>1){var z=Number.POSITIVE_INFINITY;for(var I in j)if(Object.prototype.hasOwnProperty.call(j,I)){var N=(S=e.offsetX,C=Number(I),Math.sqrt(Math.pow(C-S,2)));N<z&&(z=N,w=j[I])}}if(!h){var D=Number.POSITIVE_INFINITY;w.forEach((function(t){var i,n,o=(i={x:e.offsetX,y:e.offsetY},n=t,Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2)));o<D&&(D=o,w=[t])}))}o(w,L)}}},{key:"draw",value:function(e,t,i,n,o){var r,s=this,a=t.xScales,c=t.yScales,l=t.y2Scales,h=t.yAxis,d=t.options,u=null==d||null===(r=d.tooltip)||void 0===r?void 0:r.cascadeMode;this.isMouserover=!0,this.getNearestPoints(e,a,c,l,(function(t,r){if(s.clear(),s.drawCrosshair(e,n,o),t.length){if(t[0].x<h.tickMaxWidth)return;(void 0===i||void 0!==i&&"sharedTooltip"===u)&&(s.drawSymbol(t),s.drawModal(t,r,e,n,o))}}),i)}},{key:"drawModal",value:function(e,t,i,n,r){var s=this.options,a=s.chart,c=a.id,l=a.renderTo,h=s.tooltip,f=s.time,p=s.notDisplayedSeries,v=s.oykey,y=l.offsetHeight,m=document.getElementById("".concat(c,"-tooltip")),g=document.createElement("div"),b=e,x=((y=window.innerHeight/1.5)-18-100)/15,_=!1;if(h.sharedSortDirection&&(e=Object(u.orderBy)(e,(function(e){return e[v]}),h.sharedSortDirection)),e.length>x&&(e=e.slice(0,x),_=!0),g.className="ts-graph-tooltip-content",m.appendChild(g),"[object Function]"===Object.prototype.toString.call(h.formatter))g.innerHTML=h.formatter(o()(e),o()(b),Object(u.clone)(t));else{var k=e[0],w=document.createDocumentFragment(),O=document.createElement("ul"),S=document.createElement("li"),C=new Date(k.timestamp);if(f&&void 0!==f.timezoneOffset){var L=C.getTimezoneOffset(),A=C.getTime()+60*L*1e3+60*f.timezoneOffset*1e3;C=new Date(A)}var j=document.createTextNode(d.timeFormat(h.timeFormat)(C));if(S.appendChild(j),S.style.color="#666",O.style.maxWidth="".concat(window.innerWidth/1.5,"px"),O.appendChild(S),w.appendChild(O),e.forEach((function(e){var i=e.color,n=e.name,o=e.origin,r=e.filledNull;if(!(p.indexOf(n)>-1)){var s=document.createElement("li");if(i){var a=document.createElement("span"),c=document.createTextNode("● ");a.style.color=i,a.appendChild(c),s.appendChild(a)}var l=n;if("function"==typeof h.pointNameformatter&&(l=h.pointNameformatter(n,e)),l){var f=document.createElement("span"),v=document.createTextNode("".concat(l,": "));(null==t?void 0:t.name)===n&&(f.style.fontWeight="bold"),f.appendChild(v),s.appendChild(f)}var y=o;if(Object(u.isNumber)(y)){var m,g=document.createElement("span");if((null==t?void 0:t.name)===n&&(g.style.fontWeight="bold"),"function"==typeof h.pointValueformatter)m=h.pointValueformatter(y,e);else if("origin"===h.precision)m=y;else if("short"===h.precision){m=function(e){e:for(var t,i=e.length,n=1,o=-1;n<i;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(o>0){if(!+e[n])break e;o=0}}return o>0?e.slice(0,o)+e.slice(t+1):e}(d.format(".5s")(y))}else m=h.precision>0?d.format(",."+h.precision+"f")(y):d.format(",.3f")(y);m+=r?"(空值填补,仅限看图使用)":"";var b=document.createTextNode(m);g.appendChild(b),s.appendChild(g)}O.appendChild(s)}})),_){var E=document.createElement("li"),z=document.createTextNode("......");E.appendChild(z),O.appendChild(E)}g.appendChild(w)}var M=g.offsetWidth,P=g.offsetHeight,T=this.container.getBoundingClientRect(),I=(n||i.layerX)+T.left,N=(r||i.layerY)+T.top;m.style.left="".concat(I-M-20,"px"),m.style.top="".concat(N+20,"px"),I-M-20<0&&(m.style.left="".concat(I+20,"px")),N+20+P>y&&(m.style.top=N-P-20<0?"0px":"".concat(N-P-20,"px")),m.style.zIndex="9999",m.style.visibility="visible"}},{key:"drawSymbol",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.ctx,i=this.options;e.forEach((function(e){var n=e.x,o=e.y,r=e.color,s=e.name;i.notDisplayedSeries.indexOf(s)>-1||(t.beginPath(),t.arc(n,o,5,0,360,!1),t.lineWidth=1,t.fillStyle=r,t.fill(),t.beginPath(),t.arc(n,o,3,0,360,!1),t.lineWidth=1,t.fillStyle="white",t.fill())}))}},{key:"drawCrosshair",value:function(e,t,i){var n=this.ctx,o=this.options,r=o.chart,s=o.xAxis,a=t||e.offsetX||e.layerX,c=i||e.offsetY||e.layerY,l=r.height-s.tickpadding-s.labels.fontSize-s.tickLength,h=r.width,d=[3,3];n.beginPath(),n.setLineDash(d),n.moveTo(a,0),n.lineTo(a,l),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath(),n.beginPath(),n.setLineDash(d),n.moveTo(0,c),n.lineTo(h,c),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath()}},{key:"destroy",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-tooltip"));t&&t.parentNode&&t.parentNode.removeChild(t)}}]),e}(),q=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=i}return h()(e,[{key:"draw",value:function(e,t,i){var n=this.options,o=n.series,r=n.chart,s=r.colors,a=r.height,c=n.xAxis,l=n.yAxis2,h=n.xkey,f=n.ykey,p=n.ykey2,v=n.timestamp,y=n.fillNull,m=n.notDisplayedSeries,g=n.curve,b=this.options.line,x=b.width,_=b.showPoints,k=void 0===_?"never":_,w=b.pointSize,O=void 0===w?5:w,S=this.options.area,C=S.opacity,L=S.gradientMode,A=S.gradientOpacityStopColor,j=this.ctx,E=function(t){var i="X"===v?1e3*t[h]:t[h];return e(new Date(i))},z=function(e,n,o){var r=e[n],s=l.visible&&l.matchRefId&&o===l.matchRefId?i:t;return"number"!=typeof r||isNaN(r)?"number"==typeof y?s(y):void 0:s(r)},M=function(e){return"number"==typeof e[f]||"number"==typeof y};Object(u.sortBy)(o,"zIndex").forEach((function(e,t){if(!1!==e.visible&&!(m.indexOf(e.name)>-1)){var i,n=e.color||P(s,t),o=e.areaColor||n;if(e.color=n,e.areaColor=o,"opacity"===L&&((i=j.createLinearGradient(0,0,0,a)).addColorStop(0,n),i.addColorStop(1,A)),C>0||e.opacity){j.beginPath();var r=d.area().x(E).y0((function(t){return p&&p in t?z(t,f,e.refId):c.visible?a-c.tickpadding-c.labels.fontSize-5:a})).y1((function(t){return z(t,p&&p in t?p:f,e.refId)})).defined(M).context(j);g.enabled&&"smooth"===g.mode&&r.curve(d.curveMonotoneX),r(e.data||[]),j.fillStyle="opacity"===L&&i?i:o,j.globalAlpha=C||(e.opacity?e.opacity:.5),j.fill(),j.closePath()}if(x>0&&void 0===e.opacity){j.beginPath();var l=d.line().x(E).y((function(t){return z(t,f,e.refId)})).defined(M).context(j);g.enabled&&"smooth"===g.mode&&l.curve(d.curveMonotoneX),j.lineTo(0,0),l(e.data||[]),j.lineJoin="round",j.lineWidth=x,j.strokeStyle=n,j.lineCap="round",j.globalAlpha=1,j.setLineDash(e.lineDash||[]),j.stroke(),j.closePath()}"always"===k&&Object(u.forEach)(e.data,(function(t){var i=E(t),o=z(t,f,e.refId);"number"==typeof o&&(j.beginPath(),j.arc(i,o,O/2,0,2*Math.PI),j.fillStyle=n,j.globalAlpha=1,j.fill(),j.closePath())}))}}))}}]),e}(),V=function(){function e(t,i){c()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=i}return h()(e,[{key:"draw",value:function(e,t,i){var n=this.options,o=n.series,r=n.chart,s=r.colors,a=r.height,c=r.width,l=n.xAxis,h=n.timestamp,f=n.xkey,p=n.ykey,v=n.notDisplayedSeries,y=this.ctx,m=this.options.area.opacity;Object(u.sortBy)(o,"zIndex").forEach((function(n,o){if(!1!==n.visible&&!(v.indexOf(n.name)>-1)){var r=n.color||P(s,o);n.color=r,y.fillStyle=r,y.globalAlpha=m;var u=d.scaleBand().domain(n.data.map((function(e){return"X"===h?1e3*e[f]:e[f]}))).range([0,c]).padding(.3),g=(null==i?void 0:i.k)||1;n.data.forEach((function(i){var n="X"===h?1e3*i[f]:i[f],o=a-t(i[p])-l.tickpadding-l.labels.fontSize-5;o>0&&o<1&&(o=1),y.fillRect(e(n)-u.bandwidth()*g/2,t(i[p]),u.bandwidth()*g,o)})),y.globalAlpha=1}}))}}]),e}(),G=function(){function e(t,i,n,o){c()(this,e),this.options=void 0,this.reset=void 0,this.options=t,this.init(n,o),this.reset=i}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart,n=i.id,o=i.containerHeight,r=document.getElementById("".concat(n,"-zoom"));r&&r.remove(),r=document.createElement("div");var s=document.createElement("div"),a=document.createElement("a"),c=document.createTextNode("Reset zoom");r.id="".concat(n,"-zoom"),r.className="ts-graph-zoom",s.id="".concat(n,"-zoom-marker"),s.className="ts-graph-zoom-marker",s.style.height="".concat(o,"px"),a.id="".concat(n,"-zoom-resetBtn"),a.className="ts-graph-zoom-resetBtn",a.appendChild(c),r.appendChild(s),r.appendChild(a),e.insertBefore(r,t),this.onReset()}},{key:"onReset",value:function(){var e=this,t=this.options.chart.id,i=document.getElementById("".concat(t,"-zoom-resetBtn"));null==i||i.addEventListener("click",(function(t){t.stopPropagation(),e.reset(),e.clearResetBtn()}))}},{key:"onZoom",value:function(e,t,i){var n=this.options.chart.width,o=t.layerX-e.layerX;if(o){var r=n/Math.abs(o),s=t.layerX>e.layerX?e.layerX:t.layerX,a=d.zoomIdentity.translate(-s*r,0).scale(r);this.options.hideResetBtn||this.drawResetBtn(),i(a)}}},{key:"clearMarker",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-zoom-marker"));t.style.display="none",t.style.width="0px",t.style.left="unset",t.style.right="unset"}},{key:"drawMarker",value:function(e,t){var i=this.options.chart.marginLeft,n=e.layerX,o=t.layerX,r=this.options.chart,s=r.id,a=r.containerWidth,c=document.getElementById("".concat(s,"-zoom-marker"));c.style.display="block",c.style.top="0px",n<o?(c.style.right="unset",c.style.left="".concat(n+i,"px"),c.style.width="".concat(o-n,"px")):(c.style.left="unset",c.style.right="".concat(a-n-i,"px"),c.style.width="".concat(n-o,"px"))}},{key:"clearResetBtn",value:function(){var e=this.options.chart.id;document.getElementById("".concat(e,"-zoom-resetBtn")).style.display="none"}},{key:"drawResetBtn",value:function(){var e=this.options.chart.id;document.getElementById("".concat(e,"-zoom-resetBtn")).style.display="block"}}]),e}(),U=function(){function e(t,i,n,o){var r=this;c()(this,e),this.options=void 0,this.onLegendItemClick=void 0,this.handelLegendItemClick=function(e){var t=e.currentTarget;if(t){t.classList.contains("ts-graph-legend-item-active")?t.classList.remove("ts-graph-legend-item-active"):t.classList.add("ts-graph-legend-item-active");var i=t.getAttribute("data-serie");i&&r.onLegendItemClick(i)}},this.options=t,this.init(n,o),this.onLegendItemClick=i}return h()(e,[{key:"init",value:function(e,t){var i=this.options.chart.id,n=document.createElement("div");n.id="".concat(i,"-legend"),n.className="ts-graph-legend",document.getElementById(n.id)||e.insertBefore(n,t)}},{key:"initEvent",value:function(){var e=this,t=this.options.chart.id;document.getElementById("".concat(t,"-legend")).querySelectorAll(".ts-graph-legend-item").forEach((function(t){t.removeEventListener("click",e.handelLegendItemClick),t.addEventListener("click",e.handelLegendItemClick)}))}},{key:"updateOptions",value:function(e){this.options=e}},{key:"draw",value:function(){var e=this.options,t=e.chart.id,i=e.series,n=e.legend,o=document.getElementById("".concat(t,"-legend"));if(n.enabled){if("[object Array]"===Object.prototype.toString.call(i)){o.innerHTML="";var r=document.createDocumentFragment();i.forEach((function(e){var t=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span"),o=document.createElement("span"),s=document.createTextNode(e.name);t.className="ts-graph-legend-item",t.setAttribute("data-serie",e.name),i.className="ts-graph-legend-item-symbol",n.className="ts-graph-legend-item-symbol-line",n.style.borderColor=e.color,o.className="ts-graph-legend-item-symbol-point",o.style.backgroundColor=e.color,i.appendChild(n),i.appendChild(o),t.appendChild(i),t.appendChild(s),r.appendChild(t)})),o.appendChild(r)}this.initEvent()}}}]),e}(),$=function(){function e(t,i){c()(this,e),this.options=void 0,this.options=t,this.init(i)}return h()(e,[{key:"init",value:function(e){var t=this.options.chart.id,i=document.getElementById("".concat(t,"-shapes"));i&&i.remove(),(i=document.createElement("div")).id="".concat(t,"-shapes"),i.className="ts-graph-shapes",e.appendChild(i),i.addEventListener("mouseover",this.onMouseMove.bind(this)),i.addEventListener("click",this.onClick.bind(this))}},{key:"onMouseMove",value:function(e){var t=this.options,i=t.shapes,n=t.onShapeMouseOver;if("IMG"===e.target.tagName){var o=Object(u.find)(i,{id:e.target.dataset.id});o&&"function"==typeof n&&n(e,o)}}},{key:"onClick",value:function(e){var t=this.options,i=t.shapes,n=t.onShapeClick;if("IMG"===e.target.tagName){var o=Object(u.find)(i,{id:e.target.dataset.id});o&&"function"==typeof n&&n(e,o)}}},{key:"draw",value:function(e,t){var i=this.options,n=i.chart.id,o=i.shapes,r=document.getElementById("".concat(n,"-shapes"));r&&"[object Array]"===Object.prototype.toString.call(o)&&(r.innerHTML="",o.forEach((function(i){var n=document.createElement("img");n.src=i.imgData,n.dataset.id=i.id,n.style.position="absolute",n.onload=function(){n.style.left="".concat(e(i.x)+n.width/2,"px"),n.style.top="".concat(t(i.y)-n.height/2,"px")},r.appendChild(n)})))}},{key:"destroy",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-shapes"));t&&(t.removeEventListener("mouseover",this.onMouseMove),t.removeEventListener("click",this.onClick),t.parentNode&&(t.innerHTML=""))}}]),e}();i(12);function K(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Q(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ee(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach((function(t){s()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var te=new C.a,ie=function(){function e(t){var i=this;c()(this,e),this.options=void 0,this.container=void 0,this.frontContext=void 0,this.backContext=void 0,this.eventCanvas=void 0,this.frontCanvas=void 0,this.backCanvas=void 0,this.xAxis=void 0,this.xScales=void 0,this.yAxis=void 0,this.yAxis2=void 0,this.yScales=void 0,this.y2Scales=void 0,this.line=void 0,this.bar=void 0,this.legend=void 0,this.tooltip=void 0,this.zoom=void 0,this.transform=void 0,this.shapes=void 0,this.isMouserover=void 0,this.showTooltip=function(e,t,n,o){if(!i.isMouserover){var r=i.options.chart.width*n,s=i.options.chart.height*o;i.tooltip.draw(e,i,t,r,s)}},this.hideTooltip=function(){i.tooltip.clear()},this.getZoomedSeries=function(){var e=i.options,t=e.chart.renderTo,n=e.series,o=e.timestamp,r=e.xkey,s=t.offsetWidth;return n.map((function(e){if("[object Array]"===Object.prototype.toString.call(e.data)){var t=e.data.filter((function(e){var t="X"===o?1e3*e[r]:e[r],n=i.xScales(new Date(t));return n>=0&&n<=s}));return ee(ee({},e),{},{data:t})}return e}))},this.handleResize=function(){var e=i.options.chart,t=e.renderTo.offsetWidth,n=e.renderTo.offsetHeight;i.options.chart.width=t-e.marginLeft-e.marginRight,i.options.chart.height=n-e.marginTop-e.marginBottom,i.options.chart.containerWidth=t,i.options.chart.containerHeight=n,i.container.style.width="".concat(t,"px"),i.container.style.height="".concat(n,"px"),i.retinaScaled(i.backCanvas,"back"),i.retinaScaled(i.frontCanvas,"front"),i.retinaScaled(i.eventCanvas,"event"),i.initScales(),i.initZoom(),i.draw(!1)},this.handleZoom=function(e,t){if(i.options.onZoomWithoutDefult){var n;t&&(n=Object(u.sortBy)(t,"layerX").map((function(e){return i.xScales.invert(e.layerX)}))),i.options.onZoomWithoutDefult(n)}else{var o=i.options,r=o.ykey,s=o.ykey2,a=o.yAxis,c=o.yAxis2,l=o.ykeyFormatter,h=i.options.series;if(e?(i.transform=e,i.xScales=e.rescaleX(i.xScales),h=i.getZoomedSeries()):(i.transform=void 0,i.xScales=i.xAxis.init()),Array.isArray(h)){var d,f=a.min||-1/0,p=a.max||1/0,v=c.min||-1/0,y=c.max||1/0,m=K(h);try{for(m.s();!(d=m.n()).done;){var g=d.value,b=Array.isArray(g.data)?g.data:[],x=void 0;for(x=0;x<b.length;x++){var _=b[x],k=W(_[r],l);if(null!==k&&(c.visible&&c.matchRefId&&c.matchRefId===g.refId?(v<k&&(v=k),y>k&&(y=k)):(f<k&&(f=k),p>k&&(p=k)),s)){var w=W(_[s],l);if(null===w)continue;f<w&&(f=w),p>w&&(p=w)}}}}catch(e){m.e(e)}finally{m.f()}f!==-1/0&&p!==1/0&&(i.yAxis.setDomain(i.yScales,{ymin:f,ymax:p}),c.visible&&c.matchRefId&&i.yAxis2.setDomain(i.y2Scales,{y2min:v,y2max:y}))}i.options.onZoom(i.getZoomedSeries)}i.draw(!1)},this.handleLegendItemClick=function(e){var t=i.options.notDisplayedSeries;-1===t.indexOf(e)?t.push(e):i.options.notDisplayedSeries=t.filter((function(t){return t!==e})),i.draw(!1)};var n={ratio:window.devicePixelRatio||1,xkey:0,ykey:1,ykey2:2,oykey:"__originValue",timestamp:"x",chart:{id:Object(u.uniqueId)("ts-graph-"),colors:["#3399CC","#CC9933","#9966CC","#66CC66","#CC3333","#99CCCC","#CCCC66","#CC99CC","#99CC99","#CC6666","#336699","#996633","#993399","#339966","#993333"],width:t.chart.renderTo.clientWidth,height:t.chart.renderTo.clientHeight||350,marginTop:10,marginRight:10,marginBottom:10,marginLeft:10},xAxis:{visible:!0,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",labels:{color:"#999",fontSize:11}},yAxis:{scale:{type:"linear",log:10},visible:!0,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",gridLineColor:"#f6f6f6",labels:{color:"#999",fontSize:11}},yAxis2:{scale:{type:"linear",log:10},visible:!1,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",labels:{color:"#999",fontSize:11}},type:"line",line:{enable:!0,width:2,showPoints:"none",pointSize:5},area:{opacity:0,gradientMode:"none",gradientOpacityStopColor:"rgba(255, 255, 255, 0)"},bars:{},stack:{enabled:!1},curve:{enabled:!1},tooltip:{shared:!0,cascade:!1,cascadeScope:void 0,cascadeMode:"sharedTooltip",timeFormat:"%Y-%m-%d %H:%M:%S"},series:[],legend:{align:"center",verticalAlign:"top",enabled:!1},fillNull:void 0,onClick:void 0,onRightClick:function(){},onZoom:function(){},onShapeMouseOver:function(){},onShapeClick:function(){}},o=Object(u.merge)({},n,t);void 0===t.chart.marginTop&&o.legend.enabled&&(o.chart.marginTop=20),this.handleResize=Object(u.debounce)(this.handleResize,300),this.init(o)}return h()(e,[{key:"init",value:function(e){var t=e.chart;this.isMouserover=!1,this.options=e,this.options.notDisplayedSeries=[],this.options.chart.containerWidth=t.width,this.options.chart.containerHeight=t.height,this.options.chart.width=t.width-t.marginLeft-t.marginRight,this.options.chart.height=t.height-t.marginTop-t.marginBottom,this.createContainer(),this.createCanvas(),this.initSeries(),this.initScales(),this.initEvent(),"line"===this.options.type&&this.initLine(),"bar"===this.options.type&&this.initBar(),this.initLegend(),this.initTooltip(),this.initZoom(),this.initShapes(),this.draw()}},{key:"clearRect",value:function(e){var t=this.options.chart,i=t.containerWidth,n=t.containerHeight;e.clearRect(0,0,i,n)}},{key:"draw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.transform;this.clearRect(this.backContext),this.options.yAxis.visible&&this.yAxis.drawGridLine(this.yScales),this.options.xAxis.visible&&this.xAxis.draw(this.xScales),"line"===this.options.type&&this.line.draw(this.xScales,this.yScales,this.y2Scales),"bar"===this.options.type&&this.bar.draw(this.xScales,this.yScales,t),this.xAxis.drawPlotLines(this.xScales),this.yAxis.drawPlotLines(this.yScales),this.options.yAxis.visible&&this.yAxis.draw(this.yScales),this.options.yAxis2.visible&&this.options.yAxis2.matchRefId&&this.yAxis2.draw(this.y2Scales),e&&this.legend.draw(),this.shapes.draw(this.xScales,this.yScales)}},{key:"update",value:function(e){var t=Object(u.assign)({},this.options,e);e.series&&(t.series=e.series),this.options=t,this.offEvents(),this.initSeries(),this.initScales(),this.initEvent(),"line"===this.options.type&&this.initLine(),"bar"===this.options.type&&this.initBar(),this.initTooltip(),this.initShapes(),this.legend.updateOptions(t),this.draw()}},{key:"getSeries",value:function(){return o()(this.options.series)}},{key:"initEvent",value:function(){var e,t=this.options.tooltip,i=t.cascade,n=t.cascadeScope,o=n?"plotmove:".concat(n):"plotmove",r=n?"plotleave:".concat(n):"plotleave",s=!1,a={},c={},l=this;l.isMouserover=!1;var h=Object(u.debounce)((function(e){l.isMouserover&&(l.tooltip.draw(e,l),s&&l.zoom.drawMarker(a,e))}),5),f=Object(u.throttle)((function(){l.tooltip.clear()}),5),p=function(){if("function"==typeof l.options.onClick){var e=R(d.event,l.options,l.xScales,l.yScales),t=e.x,i=e.y,n=e.nearestPoints;l.options.onClick(d.event,t,i,n)}};d.select(this.eventCanvas).on("mousemove",(function(){if(l.isMouserover=!0,h(d.event),i){var e,t=R(d.event,l.options,l.xScales,l.yScales).nearestPoints;if(t.length)e=t[0].timestamp;var n=d.event.offsetX||d.event.layerX,r=d.event.offsetY||d.event.layerY,s=l.options.chart.width,a=l.options.chart.height;te.emit(o,d.event,e,n/s,r/a)}})).on("mouseleave",(function(){e=d.event,l.isMouserover=!1,f(),i&&te.emit(r)})).on("mousedown",(function(){1===d.event.which&&(s=!0,a=d.event)})).on("mouseup",(function(){d.event.stopPropagation();var e=d.event;a&&a.layerX!==e.layerX?(l.zoom.clearMarker(),l.zoom.onZoom(a,e,(function(t){l.handleZoom(t,[a,e])}))):p(),s=!1,a={}})).on("contextmenu",(function(){l.options.onRightClick(d.event,l.xScales.invert(d.event.offsetX),l.yScales.invert(d.event.offsetY)),d.event.preventDefault()})).on("touchstart",(function(){d.event.touches.length>1&&(s=!0)})).on("touchmove",(function(){var e=I(l.eventCanvas,d.event);1===d.event.touches.length&&l.tooltip.draw(e,l),s&&(a=e,c=I(l.eventCanvas,d.event,1),l.zoom.drawMarker(a,c))})).on("touchend",(function(){l.isMouserover=!1,f(),a&&a.layerX!==c.layerX?(l.zoom.clearMarker(),l.zoom.onZoom(a,c,(function(e){l.handleZoom(e,[a,c])}))):p(),s=!1,a={},c={}})),i&&(te.on(o,this.showTooltip),te.on(r,this.hideTooltip)),window.addEventListener("mouseup",(function(){if(!Object(u.isEmpty)(a)){var t=e;s=!1,l.zoom.clearMarker(),l.zoom.onZoom(a,t,(function(e){l.handleZoom(e,[a,t])})),a={}}})),x(this.options.chart.renderTo,this.handleResize)}},{key:"retinaScaled",value:function(e,t){var i=this.options,n=i.chart,o=i.ratio,r=e.getContext("2d"),s="front"===t?n.containerWidth:n.width,a="front"===t?n.containerHeight:n.height,c="front"===t?"0px":"".concat(n.marginLeft,"px"),l="front"===t?"0px":"".concat(n.marginTop,"px");e.width=s*o,e.height=a*o,e.style.width="".concat(s,"px"),e.style.height="".concat(a,"px"),e.style.position="absolute",e.style.left=c,e.style.top=l,"front"===t&&r.translate(n.marginLeft*o,n.marginTop*o),r.scale(o,o)}},{key:"createContainer",value:function(){var e=this.options.chart,t=document.createElement("div");t.style.position="relative",t.style.width="".concat(e.containerWidth,"px"),t.style.height="".concat(e.containerHeight,"px"),t.style.overflow="hidden",t.className="d3-graph-container",e.renderTo.appendChild(t),this.container=t}},{key:"createCanvas",value:function(){var e=this.options.chart.id;function t(t){var i=document.createElement("canvas"),n=i.getContext("2d");i.setAttribute("id","".concat(e,"-").concat(t,"Canvas")),this.container.appendChild(i),this["".concat(t,"Canvas")]=i,this["".concat(t,"Context")]=n,this.retinaScaled(i,t)}t.call(this,"back"),t.call(this,"front"),t.call(this,"event")}},{key:"initSeries",value:function(){var e=this.options,t=e.fillNull,i=e.series,n=e.xkey,o=e.ykey,r=e.ykey2,a=e.ykeyFormatter,c=e.oykey,l=e.xAxis,h=e.yAxis,d=e.yAxis2,f=e.stack,p=e.notDisplayedSeries,v=l.min||-1/0,y=l.max||1/0,m=h.min,g=h.max,b=d.min,x=d.max;if(Array.isArray(i)){var _=[];i.forEach((function(e,l){var k=void 0===e.visible||e.visible;if(!(p.indexOf(e.name)>-1)){var w,O=Array.isArray(e.data)?e.data:[],S=[],C=!1,L=function(){var h,p=void 0!==O[w][c]?O[w][c]:W(O[w][o],a),_=(h={},s()(h,n,O[w][n]),s()(h,o,p),s()(h,c,p),h);if(r&&r in O[w]&&(_[r]=W(O[w][r],a)),f.enabled){void 0===_[c]&&(_[c]=W(_[o],a));var L=l;if(L>0)for(;L>0;){var A;if(!1!==(null===(A=i[L-1])||void 0===A?void 0:A.visible)){var j=Array.isArray(i[L-1].data)?i[L-1].data:[],E=Object(u.find)(j,(function(e){return e[n]===_[n]}));if(E){var z=isNaN(_[c])?0:_[c],M=W(E[o],a);M=isNaN(M)?0:M,_[o]=M+z;break}1===L&&(_[o]=_[c]),L--}else L--}else _[o]=_[c]}O[w]=_;var P=_[n],T=_[o],I=void 0;r&&r in O[w]&&(I=_[r]),void 0===t?!isNaN(T)&&(0===w||w===O.length-1||w>0&&w<O.length-1&&"number"==typeof T)?(S.push(_),C=!0):C&&(S.push(_),C=!1):S.push(_),(P<v||v===-1/0)&&(v=P),(P>y||y===1/0)&&(y=P),k&&"number"==typeof T&&!isNaN(T)?d.visible&&d.matchRefId&&d.matchRefId===e.refId?(("number"!=typeof b||T<b)&&(b=T),("number"!=typeof x||T>x)&&(x=T)):(("number"!=typeof m||T<m)&&(m=T),"number"==typeof I&&I<m&&(m=I),("number"!=typeof g||T>g)&&(g=T),"number"==typeof I&&I>g&&(g=I)):"number"==typeof t&&(t<m&&(m=t),t>g&&(g=t))};for(w=0;w<O.length;w++)L();"number"!=typeof h.min&&"number"!=typeof h.max||(S=Object(u.map)(S,(function(e){return"number"!=typeof e[o]||isNaN(e[o])?e:"number"==typeof h.min&&e[o]<h.min||"number"==typeof h.max&&e[o]>h.max?ee(ee({},e),{},s()({},o,null)):e}))),_.push(ee(ee({},e),{},{data:S,zIndex:f.enabled?i.length-l:l}))}})),this.options.series=_,this.options.xmin=v,this.options.xmax=y,this.options.ymin=m,this.options.ymax=g,this.options.y2min=b,this.options.y2max=x}}},{key:"initLine",value:function(){this.line=new q(this.options,this.backContext)}},{key:"initBar",value:function(){this.bar=new V(this.options,this.backContext)}},{key:"initTooltip",value:function(){this.tooltip=new Y(this.options,this.frontContext,this.container,this.eventCanvas)}},{key:"initZoom",value:function(){this.zoom=new G(this.options,this.handleZoom,this.container,this.eventCanvas)}},{key:"initLegend",value:function(){this.legend=new U(this.options,this.handleLegendItemClick,this.container,this.eventCanvas)}},{key:"initScales",value:function(){var e=new X(this.options,this.backContext);if(this.yAxis=e,this.yScales=e.init(),this.options.yAxis2.visible&&this.options.yAxis2.matchRefId){var t=new F(this.options,this.backContext);this.yAxis2=t,this.y2Scales=t.init()}var i=new B(this.options,this.backContext,this.yAxis,this.yAxis2);this.xAxis=i;var n=i.init();this.transform&&(n=this.transform.rescaleX(n)),this.xScales=n}},{key:"initShapes",value:function(){var e=new $(this.options,this.container);this.shapes=e}},{key:"offEvents",value:function(){var e=this.options.tooltip,t=e.cascade,i=e.cascadeScope,n=i?"plotmove:".concat(i):"plotmove",o=i?"plotleave:".concat(i):"plotleave";d.select(this.eventCanvas).on("mousemove",null).on("mouseleave",null).on("mousedown",null).on("mouseup",null).on("touchmove",null),function(e,t){let i=e.__resize_listeners__;if(i){if(t&&i.splice(i.indexOf(t),1),!i.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",k),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--g&&b&&b.parentNode.removeChild(b)}}(this.options.chart.renderTo,this.handleResize),t&&(te.off(n,this.showTooltip),te.off(o,this.hideTooltip))}},{key:"destroy",value:function(){this.shapes.destroy(),this.tooltip.destroy(),this.offEvents(),d.select(this.container).remove()}}]),e}()}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/examples/index.js
CHANGED
|
@@ -107,28 +107,37 @@ for (let i = 0; i < graphsCount; i++) {
|
|
|
107
107
|
// pointSize: 5,
|
|
108
108
|
},
|
|
109
109
|
area: {
|
|
110
|
-
opacity:
|
|
111
|
-
},
|
|
112
|
-
yAxis2: {
|
|
113
|
-
visible: true,
|
|
114
|
-
matchRefId: "A",
|
|
110
|
+
opacity: 0,
|
|
115
111
|
},
|
|
112
|
+
// yAxis2: {
|
|
113
|
+
// visible: true,
|
|
114
|
+
// matchRefId: "A",
|
|
115
|
+
// },
|
|
116
116
|
// xAxis: {
|
|
117
117
|
// visible: false,
|
|
118
118
|
// },
|
|
119
|
+
xAxis: {
|
|
120
|
+
labels: {
|
|
121
|
+
fontSize: 14,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
119
124
|
yAxis: {
|
|
120
125
|
min: 0,
|
|
121
126
|
max: 100,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
labels: {
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
},
|
|
130
|
+
plotLines: [
|
|
131
|
+
{
|
|
132
|
+
value: 75,
|
|
133
|
+
color: "yellow",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
value: 90,
|
|
137
|
+
color: "red",
|
|
138
|
+
textAlign: 'left',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
132
141
|
},
|
|
133
142
|
// area: {
|
|
134
143
|
// opacity: 0.2,
|
package/package.json
CHANGED
package/src/yAxis.ts
CHANGED
|
@@ -189,12 +189,12 @@ export default class YAxis {
|
|
|
189
189
|
textAlign === "right" ? chart.width - 8 : this.tickMaxWidth + 8;
|
|
190
190
|
ctx.textAlign = textAlign;
|
|
191
191
|
ctx.textBaseline = "top";
|
|
192
|
-
ctx.shadowColor = plotLine.shadowColor || "#fff";
|
|
193
|
-
ctx.shadowBlur = 1;
|
|
192
|
+
// ctx.shadowColor = plotLine.shadowColor || "#fff";
|
|
193
|
+
// ctx.shadowBlur = 1;
|
|
194
194
|
ctx.lineWidth = 1;
|
|
195
195
|
ctx.fillStyle = plotLine.color;
|
|
196
196
|
ctx.font = `${yAxis.labels.fontSize}px Palantino`;
|
|
197
|
-
ctx.strokeText(labelText, x, yValue);
|
|
197
|
+
// ctx.strokeText(labelText, x, yValue);
|
|
198
198
|
ctx.fillText(labelText, x, yValue);
|
|
199
199
|
}
|
|
200
200
|
});
|