@fc-plot/ts-graph 0.24.1 → 0.24.2
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 +10 -4
- package/examples/mock2.json +502 -0
- package/package.json +1 -1
- package/src/index.ts +7 -7
- package/src/interface.ts +2 -1
- package/src/line.ts +6 -6
- package/src/tooltip.ts +1 -1
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 [29 Nov 2023 at
|
|
6
|
+
<title>@fc-plot/ts-graph [29 Nov 2023 at 16:16]</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":123436,"parsedSize":54684,"gzipSize":15539,"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":102891,"groups":[{"id":13,"label":"index.ts + 12 modules (concatenated)","path":"./src/index.ts + 12 modules (concatenated)","statSize":102891,"parsedSize":45254,"gzipSize":13043,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 12 modules (concatenated)/src","statSize":94809,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 12 modules (concatenated)/src/index.ts","statSize":32373,"parsedSize":14238,"gzipSize":4103,"inaccurateSizes":true},{"id":null,"label":"utils.ts","path":"./src/index.ts + 12 modules (concatenated)/src/utils.ts","statSize":5536,"parsedSize":2434,"gzipSize":701,"inaccurateSizes":true},{"id":null,"label":"xAxis.ts","path":"./src/index.ts + 12 modules (concatenated)/src/xAxis.ts","statSize":4825,"parsedSize":2122,"gzipSize":611,"inaccurateSizes":true},{"id":null,"label":"yAxis.ts","path":"./src/index.ts + 12 modules (concatenated)/src/yAxis.ts","statSize":7228,"parsedSize":3179,"gzipSize":916,"inaccurateSizes":true},{"id":null,"label":"yAxis2.ts","path":"./src/index.ts + 12 modules (concatenated)/src/yAxis2.ts","statSize":5129,"parsedSize":2255,"gzipSize":650,"inaccurateSizes":true},{"id":null,"label":"tooltip.ts","path":"./src/index.ts + 12 modules (concatenated)/src/tooltip.ts","statSize":15941,"parsedSize":7011,"gzipSize":2020,"inaccurateSizes":true},{"id":null,"label":"line.ts","path":"./src/index.ts + 12 modules (concatenated)/src/line.ts","statSize":4659,"parsedSize":2049,"gzipSize":590,"inaccurateSizes":true},{"id":null,"label":"bar.ts","path":"./src/index.ts + 12 modules (concatenated)/src/bar.ts","statSize":2181,"parsedSize":959,"gzipSize":276,"inaccurateSizes":true},{"id":null,"label":"zoom.ts","path":"./src/index.ts + 12 modules (concatenated)/src/zoom.ts","statSize":4348,"parsedSize":1912,"gzipSize":551,"inaccurateSizes":true},{"id":null,"label":"legend.ts","path":"./src/index.ts + 12 modules (concatenated)/src/legend.ts","statSize":3739,"parsedSize":1644,"gzipSize":473,"inaccurateSizes":true},{"id":null,"label":"shapes.ts","path":"./src/index.ts + 12 modules (concatenated)/src/shapes.ts","statSize":3100,"parsedSize":1363,"gzipSize":392,"inaccurateSizes":true},{"id":null,"label":"getNearestPoints.ts","path":"./src/index.ts + 12 modules (concatenated)/src/getNearestPoints.ts","statSize":5750,"parsedSize":2528,"gzipSize":728,"inaccurateSizes":true}],"parsedSize":41699,"gzipSize":12018,"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":3537,"gzipSize":1019,"inaccurateSizes":true}],"parsedSize":3537,"gzipSize":1019,"inaccurateSizes":true}]}],"parsedSize":45254,"gzipSize":13043}]}];
|
|
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))}y(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&y(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 u(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 d(){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=d.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):m(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 m(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function y(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=m(c,l);for(i=0;i<l;++i)r(h[i],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(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),u=i(0),d=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 m(e,t,i){return(window.getComputedStyle(e,i||null)||{display:"none"})[t]}function y(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};let t=e;for(;t!==document;){if("none"===m(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}=y(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=m(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__=y(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}=y(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,u=new Date(n).getTime(),f=[];return"[object Array]"!==Object.prototype.toString.call(i)?[]:(i.forEach((function(e,t){if(!function(e,t){return Object(d.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})),m=e.data,y=void 0===m?[]:m;if("[object Array]"===Object.prototype.toString.call(y)&&0!==(y=y.filter((function(e){return"number"==typeof e[r]||"number"==typeof l}))).length){var g,b=h(y,n),x=y[b-1],_=y[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=u-k<w-u?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 N(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 D(e){var t=String(e);if(e>=1e3){t=u.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 I(e,t,i){var n=e.map((function(e){var n;return n="function"==typeof i?i(e):D(e),t.measureText(n).width}));return Object(d.max)(n)}function W(e,t){var i=e;return null!==e&&"function"==typeof t&&(i=t(e)),i}function B(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,u=e.offsetX||e.layerX,d=e.offsetY||e.layerY,f=i.invert(u);return{x:f,y:n.invert(d),nearestPoints:E({x:f,xkey:o,ykey:r,ykey2:s,oykey:a,timestamp:c,series:l,fillNull:h})}}var X=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=(null===(e=this.y2Axis)||void 0===e?void 0:e.tickMaxWidth)||0,c=u.scaleTime().range([s.visible?this.yAxis.tickMaxWidth:0,i-a]);return c.domain([T(o,n)-(o===r?1e3:0),T(r,n)+(o===r?1e3:0)]),c}},{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,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(),d=i.getTime()+60*h*1e3+60*r.timezoneOffset*1e3;l=new Date(d)}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(u.timeFormat(c)(l),f,n.height)}else e(i)&&t.fillText(u.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}(),R=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=u.scaleLinear();n.scale&&"log"===n.scale.type&&(o=u.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=u.tickStep(f,p,r);h=Object(d.map)(u.range(f,p,v),(function(e){return Object(d.floor)(e,2)}))}}else e.domain([i,n]),e.nice(r),h=e.ticks(r);var m=I(h,this.ctx,o.tickValueFormatter)+5;this.ticks=h,this.tickMaxWidth=m}},{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):D(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,u=e(n.value);if(i.setLineDash([5,3]),i.beginPath(),i.moveTo(0,u),i.lineTo(o.width,u),i.strokeStyle=n.color,i.stroke(),i.setLineDash([]),a){var d=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(d,f,u),i.fillText(d,f,u)}}))}}]),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=u.scaleLinear();n.scale&&"log"===n.scale.type&&(o=u.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,m="number"==typeof r.max?r.max:n;if(e.domain([v,m]),"number"==typeof r.min&&r.min>m)p=[r.min];else if("number"==typeof r.max&&r.max<v)p=[r.max];else{var y=u.tickStep(v,m,a);p=Object(d.map)(u.range(v,m,y),(function(e){return Object(d.floor)(e,2)}))}}else e.domain([i,n]),e.nice(a),p=e.ticks(a);var g=I(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.yAxis,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):D(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,u=s.xkey,f=s.ykey,p=s.ykey2,v=s.oykey,m=s.timestamp,y=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(d.pickBy)(t,(function(e,t){return"data"!==t})),u=t.data,f=void 0===u?[]:u;"[object Array]"===Object.prototype.toString.call(f)&&f.forEach((function(t){var u=T(t[o],a);u===e&&c.push(M(M({},t),{},{name:n,color:l,timestamp:u,value:t[r],origin:t[s],serieIndex:i,serieOptions:h}))}))}})),c}(r,this.options):E({x:_,xkey:u,ykey:f,ykey2:p,oykey:v,timestamp:m,series:c,fillNull:y});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(d.omit)(i,["distance"])}(w=O.map((function(e){var o=g.visible&&g.matchName&&e.name===g.matchName?n:i;return Z(Z({},e),{},{x:t(e.timestamp),y:o(e.value),color:e.color||P(l,e.serieIndex)})})),k),j=Object(d.groupBy)(w,"x");if(Object(d.keys)(j).length>1){var z=Number.POSITIVE_INFINITY;for(var N in j)if(Object.prototype.hasOwnProperty.call(j,N)){var D=(S=e.offsetX,C=Number(N),Math.sqrt(Math.pow(C-S,2)));D<z&&(z=D,w=j[N])}}if(!h){var I=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<I&&(I=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,u=t.options,d=null==u||null===(r=u.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"===d)&&(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,m=l.offsetHeight,y=document.getElementById("".concat(c,"-tooltip")),g=document.createElement("div"),b=e,x=((m=window.innerHeight/1.5)-18-100)/15,_=!1;if(h.sharedSortDirection&&(e=Object(d.orderBy)(e,(function(e){return e[v]}),h.sharedSortDirection)),e.length>x&&(e=e.slice(0,x),_=!0),g.className="ts-graph-tooltip-content",y.appendChild(g),"[object Function]"===Object.prototype.toString.call(h.formatter))g.innerHTML=h.formatter(o()(e),o()(b),Object(d.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(u.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)}if(n){var l=document.createElement("span"),f=document.createTextNode("".concat(n,": "));(null==t?void 0:t.name)===n&&(l.style.fontWeight="bold"),l.appendChild(f),s.appendChild(l)}var v=o;if(Object(d.isNumber)(v)){var m,y=document.createElement("span");if((null==t?void 0:t.name)===n&&(y.style.fontWeight="bold"),"function"==typeof h.pointValueformatter)m=h.pointValueformatter(v);else if("origin"===h.precision)m=v;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}(u.format(".5s")(v))}else m=h.precision>0?u.format(",."+h.precision+"f")(v):u.format(",.3f")(v);m+=r?"(空值填补,仅限看图使用)":"";var g=document.createTextNode(m);y.appendChild(g),s.appendChild(y)}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(),N=(n||i.layerX)+T.left,D=(r||i.layerY)+T.top;y.style.left="".concat(N-M-20,"px"),y.style.top="".concat(D+20,"px"),N-M-20<0&&(y.style.left="".concat(N+20,"px")),D+20+P>m&&(y.style.top=D-P-20<0?"0px":"".concat(D-P-20,"px")),y.style.zIndex="9999",y.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,u=[3,3];n.beginPath(),n.setLineDash(u),n.moveTo(a,0),n.lineTo(a,l),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath(),n.beginPath(),n.setLineDash(u),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,m=n.fillNull,y=n.notDisplayedSeries,g=n.curve,b=this.options.line.width,x=this.options.area,_=x.opacity,k=x.gradientMode,w=x.gradientOpacityStopColor,O=this.ctx,S=function(t){var i="X"===v?1e3*t[h]:t[h];return e(new Date(i))},C=function(e,n,o){var r=e[n],s=l.visible&&l.matchName&&o===l.matchName?i:t;return"number"!=typeof r||isNaN(r)?"number"==typeof m?s(m):void 0:s(r)},L=function(e){return"number"==typeof e[f]||"number"==typeof m};Object(d.sortBy)(o,"zIndex").forEach((function(e,t){if(!1!==e.visible&&!(y.indexOf(e.name)>-1)){var i,n=e.color||P(s,t);if(e.color=n,"opacity"===k&&((i=O.createLinearGradient(0,0,0,a)).addColorStop(0,n),i.addColorStop(1,w)),_>0||e.opacity){O.beginPath();var o=u.area().x(S).y0((function(t){return p&&p in t?C(t,f,e.name):c.visible?a-c.tickpadding-c.labels.fontSize-5:a})).y1((function(t){return C(t,p&&p in t?p:f,e.name)})).defined(L).context(O);g.enabled&&"smooth"===g.mode&&o.curve(u.curveMonotoneX),o(e.data||[]),O.fillStyle="opacity"===k&&i?i:n,O.globalAlpha=_||(e.opacity?e.opacity:.5),O.fill(),O.closePath()}if(b>0&&void 0===e.opacity){O.beginPath();var r=u.line().x(S).y((function(t){return C(t,f,e.name)})).defined(L).context(O);g.enabled&&"smooth"===g.mode&&r.curve(u.curveMonotoneX),O.lineTo(0,0),r(e.data||[]),O.lineJoin="round",O.lineWidth=b,O.strokeStyle=n,O.lineCap="round",O.globalAlpha=1,O.setLineDash(e.lineDash||[]),O.stroke(),O.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,m=this.ctx,y=this.options.area.opacity;Object(d.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,m.fillStyle=r,m.globalAlpha=y;var d=u.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];m.fillRect(e(n)-d.bandwidth()*g/2,t(i[p]),d.bandwidth()*g,a-t(i[p])-l.tickpadding-l.labels.fontSize-5)})),m.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=u.zoomIdentity.translate(-s*r,0).scale(r);this.options.onZoomWithoutDefult||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(d.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(d.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(d.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 u,f=a.min||-1/0,p=a.max||1/0,v=c.min||-1/0,m=c.max||1/0,y=K(h);try{for(y.s();!(u=y.n()).done;){var g=u.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.matchName&&c.matchName===g.name?(v<k&&(v=k),m>k&&(m=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){y.e(e)}finally{y.f()}f!==-1/0&&p!==1/0&&(i.yAxis.setDomain(i.yScales,{ymin:f,ymax:p}),c.visible&&c.matchName&&i.yAxis2.setDomain(i.y2Scales,{y2min:v,y2max:m}))}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(d.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},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(d.merge)({},n,t);void 0===t.chart.marginTop&&o.legend.enabled&&(o.chart.marginTop=20),this.handleResize=Object(d.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.matchName&&this.yAxis2.draw(this.y2Scales),e&&this.legend.draw(),this.shapes.draw(this.xScales,this.yScales)}},{key:"update",value:function(e){var t=Object(d.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(d.debounce)((function(e){l.isMouserover&&(l.tooltip.draw(e,l),s&&l.zoom.drawMarker(a,e))}),5),f=Object(d.throttle)((function(){l.tooltip.clear()}),5),p=function(){if("function"==typeof l.options.onClick){var e=B(u.event,l.options,l.xScales,l.yScales),t=e.x,i=e.y,n=e.nearestPoints;l.options.onClick(u.event,t,i,n)}};u.select(this.eventCanvas).on("mousemove",(function(){if(l.isMouserover=!0,h(u.event),i){var e,t=B(u.event,l.options,l.xScales,l.yScales).nearestPoints;if(t.length)e=t[0].timestamp;var n=u.event.offsetX||u.event.layerX,r=u.event.offsetY||u.event.layerY,s=l.options.chart.width,a=l.options.chart.height;te.emit(o,u.event,e,n/s,r/a)}})).on("mouseleave",(function(){e=u.event,l.isMouserover=!1,f(),i&&te.emit(r)})).on("mousedown",(function(){1===u.event.which&&(s=!0,a=u.event)})).on("mouseup",(function(){u.event.stopPropagation();var e=u.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(u.event,l.xScales.invert(u.event.offsetX),l.yScales.invert(u.event.offsetY)),u.event.preventDefault()})).on("touchstart",(function(){u.event.touches.length>1&&(s=!0)})).on("touchmove",(function(){var e=N(l.eventCanvas,u.event);1===u.event.touches.length&&l.tooltip.draw(e,l),s&&(a=e,c=N(l.eventCanvas,u.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(d.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,u=e.yAxis2,f=e.stack,p=e.notDisplayedSeries,v=l.min||-1/0,m=l.max||1/0,y=h.min,g=h.max,b=u.min,x=u.max;if(Array.isArray(i)){var _=[];i.forEach((function(e,l){if(!(p.indexOf(e.name)>-1)){var k,w=Array.isArray(e.data)?e.data:[],O=[],S=!1,C=function(){var h,p=void 0!==w[k][c]?w[k][c]:W(w[k][o],a),_=(h={},s()(h,n,w[k][n]),s()(h,o,p),s()(h,c,p),h);if(r&&r in w[k]&&(_[r]=W(w[k][r],a)),f.enabled){void 0===_[c]&&(_[c]=W(_[o],a));var C=l;if(C>0)for(;C>0;){var L=Array.isArray(i[C-1].data)?i[C-1].data:[],A=Object(d.find)(L,(function(e){return e[n]===_[n]}));if(A){var j=isNaN(_[c])?0:_[c],E=W(A[o],a);E=isNaN(E)?0:E,_[o]=E+j;break}1===C&&(_[o]=_[c]),C--}else _[o]=_[c]}w[k]=_;var z=_[n],M=_[o],P=void 0;r&&r in w[k]&&(P=_[r]),void 0===t?!isNaN(M)&&(0===k||k===w.length-1||k>0&&k<w.length-1&&"number"==typeof M)?(O.push(_),S=!0):S&&(O.push(_),S=!1):O.push(_),(z<v||v===-1/0)&&(v=z),(z>m||m===1/0)&&(m=z),"number"!=typeof M||isNaN(M)?"number"==typeof t&&(t<y&&(y=t),t>g&&(g=t)):u.visible&&u.matchName&&u.matchName===e.name?(("number"!=typeof b||M<b)&&(b=M),("number"!=typeof x||M>x)&&(x=M)):(("number"!=typeof y||M<y)&&(y=M),"number"==typeof P&&P<y&&(y=P),("number"!=typeof g||M>g)&&(g=M),"number"==typeof P&&P>g&&(g=P))};for(k=0;k<w.length;k++)C();"number"!=typeof h.min&&"number"!=typeof h.max||(O=Object(d.map)(O,(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:O,zIndex:f.enabled?i.length-l:l}))}})),this.options.series=_,this.options.xmin=v,this.options.xmax=m,this.options.ymin=y,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 R(this.options,this.backContext);if(this.yAxis=e,this.yScales=e.init(),this.options.yAxis2.visible&&this.options.yAxis2.matchName){var t=new F(this.options,this.backContext);this.yAxis2=t,this.y2Scales=t.init()}var i=new X(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";u.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(),u.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 u(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 d(){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=d.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 u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(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),u=i(0),d=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,u=new Date(n).getTime(),f=[];return"[object Array]"!==Object.prototype.toString.call(i)?[]:(i.forEach((function(e,t){if(!function(e,t){return Object(d.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=u-k<w-u?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=u.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(d.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,u=e.offsetX||e.layerX,d=e.offsetY||e.layerY,f=i.invert(u);return{x:f,y:n.invert(d),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=(null===(e=this.y2Axis)||void 0===e?void 0:e.tickMaxWidth)||0,c=u.scaleTime().range([s.visible?this.yAxis.tickMaxWidth:0,i-a]);return c.domain([T(o,n)-(o===r?1e3:0),T(r,n)+(o===r?1e3:0)]),c}},{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,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(),d=i.getTime()+60*h*1e3+60*r.timezoneOffset*1e3;l=new Date(d)}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(u.timeFormat(c)(l),f,n.height)}else e(i)&&t.fillText(u.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=u.scaleLinear();n.scale&&"log"===n.scale.type&&(o=u.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=u.tickStep(f,p,r);h=Object(d.map)(u.range(f,p,v),(function(e){return Object(d.floor)(e,2)}))}}else e.domain([i,n]),e.nice(r),h=e.ticks(r);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,u=e(n.value);if(i.setLineDash([5,3]),i.beginPath(),i.moveTo(0,u),i.lineTo(o.width,u),i.strokeStyle=n.color,i.stroke(),i.setLineDash([]),a){var d=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(d,f,u),i.fillText(d,f,u)}}))}}]),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=u.scaleLinear();n.scale&&"log"===n.scale.type&&(o=u.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=u.tickStep(v,y,a);p=Object(d.map)(u.range(v,y,m),(function(e){return Object(d.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.yAxis,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,u=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(d.pickBy)(t,(function(e,t){return"data"!==t})),u=t.data,f=void 0===u?[]:u;"[object Array]"===Object.prototype.toString.call(f)&&f.forEach((function(t){var u=T(t[o],a);u===e&&c.push(M(M({},t),{},{name:n,color:l,timestamp:u,value:t[r],origin:t[s],serieIndex:i,serieOptions:h}))}))}})),c}(r,this.options):E({x:_,xkey:u,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(d.omit)(i,["distance"])}(w=O.map((function(e){var o=g.visible&&g.matchRefId&&e.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(d.groupBy)(w,"x");if(Object(d.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,u=t.options,d=null==u||null===(r=u.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"===d)&&(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(d.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(d.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(u.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)}if(n){var l=document.createElement("span"),f=document.createTextNode("".concat(n,": "));(null==t?void 0:t.name)===n&&(l.style.fontWeight="bold"),l.appendChild(f),s.appendChild(l)}var v=o;if(Object(d.isNumber)(v)){var y,m=document.createElement("span");if((null==t?void 0:t.name)===n&&(m.style.fontWeight="bold"),"function"==typeof h.pointValueformatter)y=h.pointValueformatter(v);else if("origin"===h.precision)y=v;else if("short"===h.precision){y=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}(u.format(".5s")(v))}else y=h.precision>0?u.format(",."+h.precision+"f")(v):u.format(",.3f")(v);y+=r?"(空值填补,仅限看图使用)":"";var g=document.createTextNode(y);m.appendChild(g),s.appendChild(m)}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,u=[3,3];n.beginPath(),n.setLineDash(u),n.moveTo(a,0),n.lineTo(a,l),n.lineWidth=1,n.strokeStyle="#666",n.stroke(),n.closePath(),n.beginPath(),n.setLineDash(u),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.width,x=this.options.area,_=x.opacity,k=x.gradientMode,w=x.gradientOpacityStopColor,O=this.ctx,S=function(t){var i="X"===v?1e3*t[h]:t[h];return e(new Date(i))},C=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)},L=function(e){return"number"==typeof e[f]||"number"==typeof y};Object(d.sortBy)(o,"zIndex").forEach((function(e,t){if(!1!==e.visible&&!(m.indexOf(e.name)>-1)){var i,n=e.color||P(s,t);if(e.color=n,"opacity"===k&&((i=O.createLinearGradient(0,0,0,a)).addColorStop(0,n),i.addColorStop(1,w)),_>0||e.opacity){O.beginPath();var o=u.area().x(S).y0((function(t){return p&&p in t?C(t,f,e.refId):c.visible?a-c.tickpadding-c.labels.fontSize-5:a})).y1((function(t){return C(t,p&&p in t?p:f,e.refId)})).defined(L).context(O);g.enabled&&"smooth"===g.mode&&o.curve(u.curveMonotoneX),o(e.data||[]),O.fillStyle="opacity"===k&&i?i:n,O.globalAlpha=_||(e.opacity?e.opacity:.5),O.fill(),O.closePath()}if(b>0&&void 0===e.opacity){O.beginPath();var r=u.line().x(S).y((function(t){return C(t,f,e.refId)})).defined(L).context(O);g.enabled&&"smooth"===g.mode&&r.curve(u.curveMonotoneX),O.lineTo(0,0),r(e.data||[]),O.lineJoin="round",O.lineWidth=b,O.strokeStyle=n,O.lineCap="round",O.globalAlpha=1,O.setLineDash(e.lineDash||[]),O.stroke(),O.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(d.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 d=u.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];y.fillRect(e(n)-d.bandwidth()*g/2,t(i[p]),d.bandwidth()*g,a-t(i[p])-l.tickpadding-l.labels.fontSize-5)})),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=u.zoomIdentity.translate(-s*r,0).scale(r);this.options.onZoomWithoutDefult||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(d.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(d.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(d.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 u,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();!(u=m.n()).done;){var g=u.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(d.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},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(d.merge)({},n,t);void 0===t.chart.marginTop&&o.legend.enabled&&(o.chart.marginTop=20),this.handleResize=Object(d.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(d.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(d.debounce)((function(e){l.isMouserover&&(l.tooltip.draw(e,l),s&&l.zoom.drawMarker(a,e))}),5),f=Object(d.throttle)((function(){l.tooltip.clear()}),5),p=function(){if("function"==typeof l.options.onClick){var e=R(u.event,l.options,l.xScales,l.yScales),t=e.x,i=e.y,n=e.nearestPoints;l.options.onClick(u.event,t,i,n)}};u.select(this.eventCanvas).on("mousemove",(function(){if(l.isMouserover=!0,h(u.event),i){var e,t=R(u.event,l.options,l.xScales,l.yScales).nearestPoints;if(t.length)e=t[0].timestamp;var n=u.event.offsetX||u.event.layerX,r=u.event.offsetY||u.event.layerY,s=l.options.chart.width,a=l.options.chart.height;te.emit(o,u.event,e,n/s,r/a)}})).on("mouseleave",(function(){e=u.event,l.isMouserover=!1,f(),i&&te.emit(r)})).on("mousedown",(function(){1===u.event.which&&(s=!0,a=u.event)})).on("mouseup",(function(){u.event.stopPropagation();var e=u.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(u.event,l.xScales.invert(u.event.offsetX),l.yScales.invert(u.event.offsetY)),u.event.preventDefault()})).on("touchstart",(function(){u.event.touches.length>1&&(s=!0)})).on("touchmove",(function(){var e=I(l.eventCanvas,u.event);1===u.event.touches.length&&l.tooltip.draw(e,l),s&&(a=e,c=I(l.eventCanvas,u.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(d.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,u=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=u.min,x=u.max;if(Array.isArray(i)){var _=[];i.forEach((function(e,l){if(!(p.indexOf(e.name)>-1)){var k,w=Array.isArray(e.data)?e.data:[],O=[],S=!1,C=function(){var h,p=void 0!==w[k][c]?w[k][c]:W(w[k][o],a),_=(h={},s()(h,n,w[k][n]),s()(h,o,p),s()(h,c,p),h);if(r&&r in w[k]&&(_[r]=W(w[k][r],a)),f.enabled){void 0===_[c]&&(_[c]=W(_[o],a));var C=l;if(C>0)for(;C>0;){var L=Array.isArray(i[C-1].data)?i[C-1].data:[],A=Object(d.find)(L,(function(e){return e[n]===_[n]}));if(A){var j=isNaN(_[c])?0:_[c],E=W(A[o],a);E=isNaN(E)?0:E,_[o]=E+j;break}1===C&&(_[o]=_[c]),C--}else _[o]=_[c]}w[k]=_;var z=_[n],M=_[o],P=void 0;r&&r in w[k]&&(P=_[r]),void 0===t?!isNaN(M)&&(0===k||k===w.length-1||k>0&&k<w.length-1&&"number"==typeof M)?(O.push(_),S=!0):S&&(O.push(_),S=!1):O.push(_),(z<v||v===-1/0)&&(v=z),(z>y||y===1/0)&&(y=z),"number"!=typeof M||isNaN(M)?"number"==typeof t&&(t<m&&(m=t),t>g&&(g=t)):u.visible&&u.matchRefId&&u.matchRefId===e.refId?(("number"!=typeof b||M<b)&&(b=M),("number"!=typeof x||M>x)&&(x=M)):(("number"!=typeof m||M<m)&&(m=M),"number"==typeof P&&P<m&&(m=P),("number"!=typeof g||M>g)&&(g=M),"number"==typeof P&&P>g&&(g=P))};for(k=0;k<w.length;k++)C();"number"!=typeof h.min&&"number"!=typeof h.max||(O=Object(d.map)(O,(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:O,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";u.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(),u.select(this.container).remove()}}]),e}()}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/examples/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import TsGraph from "../src/index";
|
|
3
3
|
import mock from "./mock.json";
|
|
4
|
+
import mock2 from "./mock2.json";
|
|
4
5
|
import "../assets/style.less";
|
|
5
6
|
|
|
7
|
+
console.log("mock2", mock2);
|
|
8
|
+
|
|
9
|
+
// 布林带图 - start
|
|
6
10
|
const serieColorMap = {
|
|
7
11
|
origin: "#573BA7",
|
|
8
12
|
upper_bound: "#1A94FF",
|
|
@@ -40,6 +44,8 @@ newSeries.push({
|
|
|
40
44
|
|
|
41
45
|
newSeries.push(origin);
|
|
42
46
|
|
|
47
|
+
// 布林带图 - end
|
|
48
|
+
|
|
43
49
|
function random(m, n) {
|
|
44
50
|
return Math.floor(Math.random() * (n - m + 1));
|
|
45
51
|
}
|
|
@@ -83,8 +89,8 @@ for (let i = 0; i < graphsCount; i++) {
|
|
|
83
89
|
document.body.appendChild(renderTo);
|
|
84
90
|
const graph = new TsGraph({
|
|
85
91
|
timestamp: "X",
|
|
86
|
-
xkey: "
|
|
87
|
-
ykey: "
|
|
92
|
+
xkey: "0",
|
|
93
|
+
ykey: "1",
|
|
88
94
|
// ykey2: 2,
|
|
89
95
|
ykeyFormatter: (value) => Number(value),
|
|
90
96
|
chart: {
|
|
@@ -95,13 +101,13 @@ for (let i = 0; i < graphsCount; i++) {
|
|
|
95
101
|
marginBottom: 0,
|
|
96
102
|
marginLeft: 0,
|
|
97
103
|
},
|
|
98
|
-
series:
|
|
104
|
+
series: mock2,
|
|
99
105
|
line: {
|
|
100
106
|
width: 1,
|
|
101
107
|
},
|
|
102
108
|
yAxis2: {
|
|
103
109
|
visible: true,
|
|
104
|
-
|
|
110
|
+
matchRefId: "A",
|
|
105
111
|
},
|
|
106
112
|
// xAxis: {
|
|
107
113
|
// visible: false,
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "series_5",
|
|
4
|
+
"refId": "A",
|
|
5
|
+
"name": "",
|
|
6
|
+
"metric": {},
|
|
7
|
+
"expr": "avg(cpu_usage_idle)",
|
|
8
|
+
"data": [
|
|
9
|
+
[1701241560, "86.41565038618812"],
|
|
10
|
+
[1701241575, "91.88684918040855"],
|
|
11
|
+
[1701241590, "93.05035534841561"],
|
|
12
|
+
[1701241605, "89.02838020385536"],
|
|
13
|
+
[1701241620, "86.12729717861598"],
|
|
14
|
+
[1701241635, "92.39301495894664"],
|
|
15
|
+
[1701241650, "93.0433473918964"],
|
|
16
|
+
[1701241665, "91.52376824517287"],
|
|
17
|
+
[1701241680, "86.95503210491106"],
|
|
18
|
+
[1701241695, "91.97933208006174"],
|
|
19
|
+
[1701241710, "92.41861018546953"],
|
|
20
|
+
[1701241725, "91.38369832997836"],
|
|
21
|
+
[1701241740, "86.82251791948613"],
|
|
22
|
+
[1701241755, "92.1645927093775"],
|
|
23
|
+
[1701241770, "92.89810718541838"],
|
|
24
|
+
[1701241785, "91.4258846054412"],
|
|
25
|
+
[1701241800, "87.03014158632803"],
|
|
26
|
+
[1701241815, "91.90283825396227"],
|
|
27
|
+
[1701241830, "92.71120080814254"],
|
|
28
|
+
[1701241845, "91.11141430371556"],
|
|
29
|
+
[1701241860, "86.32712753006516"],
|
|
30
|
+
[1701241875, "92.20729192204914"],
|
|
31
|
+
[1701241890, "93.07495312412868"],
|
|
32
|
+
[1701241905, "89.7460127306123"],
|
|
33
|
+
[1701241920, "86.16056418557312"],
|
|
34
|
+
[1701241935, "92.3694104006657"],
|
|
35
|
+
[1701241950, "92.74344022157686"],
|
|
36
|
+
[1701241965, "91.2833611049561"],
|
|
37
|
+
[1701241980, "86.53159302428415"],
|
|
38
|
+
[1701241995, "92.27793594735671"],
|
|
39
|
+
[1701242010, "92.31927289168536"],
|
|
40
|
+
[1701242025, "91.64915255529466"],
|
|
41
|
+
[1701242040, "86.83429593244446"],
|
|
42
|
+
[1701242055, "91.73194532541781"],
|
|
43
|
+
[1701242070, "92.90714798577855"],
|
|
44
|
+
[1701242085, "91.50436899221167"],
|
|
45
|
+
[1701242100, "86.8494431946263"],
|
|
46
|
+
[1701242115, "91.99455071265777"],
|
|
47
|
+
[1701242130, "92.81199152704261"],
|
|
48
|
+
[1701242145, "91.49752253856191"],
|
|
49
|
+
[1701242160, "86.7971182074306"],
|
|
50
|
+
[1701242175, "92.32783843218692"],
|
|
51
|
+
[1701242190, "92.94323169725207"],
|
|
52
|
+
[1701242205, "90.51720411921445"],
|
|
53
|
+
[1701242220, "84.98019265345627"],
|
|
54
|
+
[1701242235, "92.18643747513676"],
|
|
55
|
+
[1701242250, "93.12216563250205"],
|
|
56
|
+
[1701242265, "91.1403322131979"],
|
|
57
|
+
[1701242280, "86.82216024175027"],
|
|
58
|
+
[1701242295, "92.23729088729486"],
|
|
59
|
+
[1701242310, "92.7964273942508"],
|
|
60
|
+
[1701242325, "91.23215958483658"],
|
|
61
|
+
[1701242340, "87.07319390792706"],
|
|
62
|
+
[1701242355, "92.17366397002635"],
|
|
63
|
+
[1701242370, "92.79412255335431"],
|
|
64
|
+
[1701242385, "91.39982471702353"],
|
|
65
|
+
[1701242400, "86.94952772853622"],
|
|
66
|
+
[1701242415, "92.08953048412367"],
|
|
67
|
+
[1701242430, "92.82551821891379"],
|
|
68
|
+
[1701242445, "91.24738399126004"],
|
|
69
|
+
[1701242460, "86.82542874877394"],
|
|
70
|
+
[1701242475, "92.40977459916434"],
|
|
71
|
+
[1701242490, "92.61759994720938"],
|
|
72
|
+
[1701242505, "91.45134470010703"],
|
|
73
|
+
[1701242520, "84.46486014246868"],
|
|
74
|
+
[1701242535, "92.28103233459021"],
|
|
75
|
+
[1701242550, "93.15558650258508"],
|
|
76
|
+
[1701242565, "91.00020229061984"],
|
|
77
|
+
[1701242580, "86.80906927181621"],
|
|
78
|
+
[1701242595, "91.83692578983792"],
|
|
79
|
+
[1701242610, "92.53484842883967"],
|
|
80
|
+
[1701242625, "90.60181501164391"],
|
|
81
|
+
[1701242640, "87.00673010270933"],
|
|
82
|
+
[1701242655, "92.06218692443258"],
|
|
83
|
+
[1701242670, "93.09958064837812"],
|
|
84
|
+
[1701242685, "91.09477858641405"],
|
|
85
|
+
[1701242700, "87.0257756423789"],
|
|
86
|
+
[1701242715, "91.65725823666611"],
|
|
87
|
+
[1701242730, "93.09411522463289"],
|
|
88
|
+
[1701242745, "91.31379458756255"],
|
|
89
|
+
[1701242760, "87.17160682376357"],
|
|
90
|
+
[1701242775, "92.14411401095283"],
|
|
91
|
+
[1701242790, "92.56757383776966"],
|
|
92
|
+
[1701242805, "91.38454610471206"],
|
|
93
|
+
[1701242820, "84.43852548111863"],
|
|
94
|
+
[1701242835, "92.27953457001709"],
|
|
95
|
+
[1701242850, "92.90102261302717"],
|
|
96
|
+
[1701242865, "91.37192570608721"],
|
|
97
|
+
[1701242880, "86.6775018079744"],
|
|
98
|
+
[1701242895, "91.81368813650442"],
|
|
99
|
+
[1701242910, "92.04142117218763"],
|
|
100
|
+
[1701242925, "90.68871491857023"],
|
|
101
|
+
[1701242940, "86.91713444482383"],
|
|
102
|
+
[1701242955, "92.08743478616113"],
|
|
103
|
+
[1701242970, "93.02327740674475"],
|
|
104
|
+
[1701242985, "91.3043697978432"],
|
|
105
|
+
[1701243000, "86.70810178735402"],
|
|
106
|
+
[1701243015, "92.09580087437364"],
|
|
107
|
+
[1701243030, "92.7908722034989"],
|
|
108
|
+
[1701243045, "91.059710051974"],
|
|
109
|
+
[1701243060, "86.86700424613433"],
|
|
110
|
+
[1701243075, "91.80452749876756"],
|
|
111
|
+
[1701243090, "92.99597826717581"],
|
|
112
|
+
[1701243105, "91.24270445630732"],
|
|
113
|
+
[1701243120, "85.31107651501597"],
|
|
114
|
+
[1701243135, "90.45823256136018"],
|
|
115
|
+
[1701243150, "92.98536772432017"],
|
|
116
|
+
[1701243165, "91.15376317332559"],
|
|
117
|
+
[1701243180, "86.95593413751497"],
|
|
118
|
+
[1701243195, "91.82028509845749"],
|
|
119
|
+
[1701243210, "92.38343838510461"],
|
|
120
|
+
[1701243225, "91.16599192750809"],
|
|
121
|
+
[1701243240, "86.63412545757674"],
|
|
122
|
+
[1701243255, "92.39245913147931"],
|
|
123
|
+
[1701243270, "92.77046045903786"],
|
|
124
|
+
[1701243285, "91.0051552389929"],
|
|
125
|
+
[1701243300, "86.56905013870566"],
|
|
126
|
+
[1701243315, "91.76830815129298"],
|
|
127
|
+
[1701243330, "92.38040849284947"],
|
|
128
|
+
[1701243345, "91.24124984272754"],
|
|
129
|
+
[1701243360, "86.51980380410109"],
|
|
130
|
+
[1701243375, "92.37874490485311"],
|
|
131
|
+
[1701243390, "93.17556003120163"],
|
|
132
|
+
[1701243405, "91.0278074589026"],
|
|
133
|
+
[1701243420, "86.74169171513986"],
|
|
134
|
+
[1701243435, "89.43620783310078"],
|
|
135
|
+
[1701243450, "93.20867251193775"],
|
|
136
|
+
[1701243465, "91.45383436253869"],
|
|
137
|
+
[1701243480, "86.68115628215891"],
|
|
138
|
+
[1701243495, "92.09319512827341"],
|
|
139
|
+
[1701243510, "92.79958940302761"],
|
|
140
|
+
[1701243525, "91.08381800563188"],
|
|
141
|
+
[1701243540, "86.73380970498084"],
|
|
142
|
+
[1701243555, "92.05858350101857"],
|
|
143
|
+
[1701243570, "92.47460811765329"],
|
|
144
|
+
[1701243585, "91.12548014281842"],
|
|
145
|
+
[1701243600, "86.99267130080787"],
|
|
146
|
+
[1701243615, "92.04826360600937"],
|
|
147
|
+
[1701243630, "92.91689084520858"],
|
|
148
|
+
[1701243645, "91.25396697154335"],
|
|
149
|
+
[1701243660, "86.94254010268699"],
|
|
150
|
+
[1701243675, "92.07255723887495"],
|
|
151
|
+
[1701243690, "92.89268145777407"],
|
|
152
|
+
[1701243705, "91.19840466623603"],
|
|
153
|
+
[1701243720, "86.87513066128524"],
|
|
154
|
+
[1701243735, "89.56746220959157"],
|
|
155
|
+
[1701243750, "93.09738208055958"],
|
|
156
|
+
[1701243765, "91.13213280598913"],
|
|
157
|
+
[1701243780, "87.14467763899896"],
|
|
158
|
+
[1701243795, "91.67273351479872"],
|
|
159
|
+
[1701243810, "92.50140390171386"],
|
|
160
|
+
[1701243825, "91.23947837143736"],
|
|
161
|
+
[1701243840, "86.68877858322685"],
|
|
162
|
+
[1701243855, "91.93118683073277"],
|
|
163
|
+
[1701243870, "92.91179636309775"],
|
|
164
|
+
[1701243885, "91.1094830401543"],
|
|
165
|
+
[1701243900, "86.86893391272575"],
|
|
166
|
+
[1701243915, "91.55004854282805"],
|
|
167
|
+
[1701243930, "92.60877121475541"],
|
|
168
|
+
[1701243945, "91.16941151574196"],
|
|
169
|
+
[1701243960, "86.83187700932244"],
|
|
170
|
+
[1701243975, "91.75008763224146"],
|
|
171
|
+
[1701243990, "93.25670835253689"],
|
|
172
|
+
[1701244005, "91.02537608018011"],
|
|
173
|
+
[1701244020, "86.79760223720154"],
|
|
174
|
+
[1701244035, "89.00095429147416"],
|
|
175
|
+
[1701244050, "93.06266169822275"],
|
|
176
|
+
[1701244065, "91.68223960834791"],
|
|
177
|
+
[1701244080, "86.3841229065818"],
|
|
178
|
+
[1701244095, "92.36052335424543"],
|
|
179
|
+
[1701244110, "92.64505337024723"],
|
|
180
|
+
[1701244125, "91.39689233170019"],
|
|
181
|
+
[1701244140, "87.08207890067456"],
|
|
182
|
+
[1701244155, "91.83345386632914"],
|
|
183
|
+
[1701244170, "93.00021295586848"],
|
|
184
|
+
[1701244185, "90.89262801917417"],
|
|
185
|
+
[1701244200, "86.06380118082811"],
|
|
186
|
+
[1701244215, "92.04942583437612"],
|
|
187
|
+
[1701244230, "92.87256732007522"],
|
|
188
|
+
[1701244245, "91.51102934808434"],
|
|
189
|
+
[1701244260, "86.78032044896675"],
|
|
190
|
+
[1701244275, "91.98081882843152"],
|
|
191
|
+
[1701244290, "92.77126104257215"],
|
|
192
|
+
[1701244305, "91.26770364038236"],
|
|
193
|
+
[1701244320, "86.82151528611502"],
|
|
194
|
+
[1701244335, "90.75734764417469"],
|
|
195
|
+
[1701244350, "91.83574522166563"],
|
|
196
|
+
[1701244365, "91.18830196203582"],
|
|
197
|
+
[1701244380, "86.98634454804184"],
|
|
198
|
+
[1701244395, "91.97328401342415"],
|
|
199
|
+
[1701244410, "91.83089666655641"],
|
|
200
|
+
[1701244425, "91.09165524834638"],
|
|
201
|
+
[1701244440, "86.20265128236801"],
|
|
202
|
+
[1701244455, "92.145570306534"],
|
|
203
|
+
[1701244470, "92.57355639013394"],
|
|
204
|
+
[1701244485, "91.0558009345629"],
|
|
205
|
+
[1701244500, "86.79864941758649"],
|
|
206
|
+
[1701244515, "91.21805104684915"],
|
|
207
|
+
[1701244530, "92.72645284702224"],
|
|
208
|
+
[1701244545, "91.14179108573478"],
|
|
209
|
+
[1701244560, "86.46993528943109"],
|
|
210
|
+
[1701244575, "91.96981036174226"],
|
|
211
|
+
[1701244590, "92.87453123107088"],
|
|
212
|
+
[1701244605, "91.28610164175531"],
|
|
213
|
+
[1701244620, "86.84268722537279"],
|
|
214
|
+
[1701244635, "91.88038159159707"],
|
|
215
|
+
[1701244650, "89.9507334729549"],
|
|
216
|
+
[1701244665, "91.66894771648887"],
|
|
217
|
+
[1701244680, "92.10608357084946"],
|
|
218
|
+
[1701244695, "92.23014104822914"],
|
|
219
|
+
[1701244710, "92.27884524517644"],
|
|
220
|
+
[1701244725, "92.82772405446372"],
|
|
221
|
+
[1701244740, "87.31769570223994"],
|
|
222
|
+
[1701244755, "92.37543370153212"],
|
|
223
|
+
[1701244770, "92.44276982173176"],
|
|
224
|
+
[1701244785, "91.1847139851617"],
|
|
225
|
+
[1701244800, "86.93564815396965"],
|
|
226
|
+
[1701244815, "92.12018956006568"],
|
|
227
|
+
[1701244830, "92.95264388098146"],
|
|
228
|
+
[1701244845, "90.84385745477479"],
|
|
229
|
+
[1701244860, "87.03509949787966"],
|
|
230
|
+
[1701244875, "92.28709379401978"],
|
|
231
|
+
[1701244890, "92.73153001553048"],
|
|
232
|
+
[1701244905, "91.41712540216975"],
|
|
233
|
+
[1701244920, "86.95886889034675"],
|
|
234
|
+
[1701244935, "92.76848566296579"],
|
|
235
|
+
[1701244950, "90.24678537548535"],
|
|
236
|
+
[1701244965, "91.44033730616981"],
|
|
237
|
+
[1701244980, "86.94643584828339"],
|
|
238
|
+
[1701244995, "92.40393775981606"],
|
|
239
|
+
[1701245010, "92.41568970267346"],
|
|
240
|
+
[1701245025, "91.50947700660592"],
|
|
241
|
+
[1701245040, "87.05782937133287"],
|
|
242
|
+
[1701245055, "91.97476597570275"],
|
|
243
|
+
[1701245070, "92.88270153280698"],
|
|
244
|
+
[1701245085, "91.01603189059624"],
|
|
245
|
+
[1701245100, "85.67398118800278"],
|
|
246
|
+
[1701245115, "92.11788184668185"],
|
|
247
|
+
[1701245130, "92.5548635419469"],
|
|
248
|
+
[1701245145, "91.47893108695932"],
|
|
249
|
+
[1701245160, "86.9342790664209"]
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"id": "series_6",
|
|
254
|
+
"refId": "B",
|
|
255
|
+
"name": "",
|
|
256
|
+
"metric": {},
|
|
257
|
+
"expr": "avg(disk_used)",
|
|
258
|
+
"data": [
|
|
259
|
+
[1701241560, "109322774528"],
|
|
260
|
+
[1701241575, "109323604992"],
|
|
261
|
+
[1701241590, "109324357632"],
|
|
262
|
+
[1701241605, "109327187968"],
|
|
263
|
+
[1701241620, "109327929344"],
|
|
264
|
+
[1701241635, "109328769024"],
|
|
265
|
+
[1701241650, "109329521664"],
|
|
266
|
+
[1701241665, "109330220032"],
|
|
267
|
+
[1701241680, "109330928640"],
|
|
268
|
+
[1701241695, "109331815424"],
|
|
269
|
+
[1701241710, "109332482048"],
|
|
270
|
+
[1701241725, "109333261312"],
|
|
271
|
+
[1701241740, "109333902336"],
|
|
272
|
+
[1701241755, "109334839296"],
|
|
273
|
+
[1701241770, "109335515136"],
|
|
274
|
+
[1701241785, "109336308736"],
|
|
275
|
+
[1701241800, "109336948736"],
|
|
276
|
+
[1701241815, "109337894912"],
|
|
277
|
+
[1701241830, "109338537984"],
|
|
278
|
+
[1701241845, "109339327488"],
|
|
279
|
+
[1701241860, "109339992064"],
|
|
280
|
+
[1701241875, "109340900352"],
|
|
281
|
+
[1701241890, "109341566976"],
|
|
282
|
+
[1701241905, "109366864896"],
|
|
283
|
+
[1701241920, "109343035392"],
|
|
284
|
+
[1701241935, "109343889408"],
|
|
285
|
+
[1701241950, "109344618496"],
|
|
286
|
+
[1701241965, "109345318912"],
|
|
287
|
+
[1701241980, "109346064384"],
|
|
288
|
+
[1701241995, "109346908160"],
|
|
289
|
+
[1701242010, "109347635200"],
|
|
290
|
+
[1701242025, "109348387840"],
|
|
291
|
+
[1701242040, "109349144576"],
|
|
292
|
+
[1701242055, "109349993472"],
|
|
293
|
+
[1701242070, "109350688768"],
|
|
294
|
+
[1701242085, "109351447552"],
|
|
295
|
+
[1701242100, "109352141824"],
|
|
296
|
+
[1701242115, "109353033728"],
|
|
297
|
+
[1701242130, "109353732096"],
|
|
298
|
+
[1701242145, "109354514432"],
|
|
299
|
+
[1701242160, "109355167744"],
|
|
300
|
+
[1701242175, "109356101632"],
|
|
301
|
+
[1701242190, "109356729344"],
|
|
302
|
+
[1701242205, "109387011072"],
|
|
303
|
+
[1701242220, "109358204928"],
|
|
304
|
+
[1701242235, "109359134720"],
|
|
305
|
+
[1701242250, "109359788032"],
|
|
306
|
+
[1701242265, "109360623616"],
|
|
307
|
+
[1701242280, "109361272832"],
|
|
308
|
+
[1701242295, "109364275200"],
|
|
309
|
+
[1701242310, "109364951040"],
|
|
310
|
+
[1701242325, "109365713920"],
|
|
311
|
+
[1701242340, "109366418432"],
|
|
312
|
+
[1701242355, "109367279616"],
|
|
313
|
+
[1701242370, "109367991296"],
|
|
314
|
+
[1701242385, "109368682496"],
|
|
315
|
+
[1701242400, "109369425920"],
|
|
316
|
+
[1701242415, "109370251264"],
|
|
317
|
+
[1701242430, "109370983424"],
|
|
318
|
+
[1701242445, "109371706368"],
|
|
319
|
+
[1701242460, "109372451840"],
|
|
320
|
+
[1701242475, "109373274112"],
|
|
321
|
+
[1701242490, "109374030848"],
|
|
322
|
+
[1701242505, "109374748672"],
|
|
323
|
+
[1701242520, "109375484928"],
|
|
324
|
+
[1701242535, "109376337920"],
|
|
325
|
+
[1701242550, "109379124224"],
|
|
326
|
+
[1701242565, "109379893248"],
|
|
327
|
+
[1701242580, "109380587520"],
|
|
328
|
+
[1701242595, "109381498880"],
|
|
329
|
+
[1701242610, "109382146048"],
|
|
330
|
+
[1701242625, "109382969344"],
|
|
331
|
+
[1701242640, "109383630848"],
|
|
332
|
+
[1701242655, "109384576000"],
|
|
333
|
+
[1701242670, "109385199616"],
|
|
334
|
+
[1701242685, "109386006528"],
|
|
335
|
+
[1701242700, "109386653696"],
|
|
336
|
+
[1701242715, "109387585536"],
|
|
337
|
+
[1701242730, "109388211200"],
|
|
338
|
+
[1701242745, "109388960768"],
|
|
339
|
+
[1701242760, "109389662208"],
|
|
340
|
+
[1701242775, "109390573568"],
|
|
341
|
+
[1701242790, "109391244288"],
|
|
342
|
+
[1701242805, "109391963136"],
|
|
343
|
+
[1701242820, "109392722944"],
|
|
344
|
+
[1701242835, "109393561600"],
|
|
345
|
+
[1701242850, "109394294784"],
|
|
346
|
+
[1701242865, "109395020800"],
|
|
347
|
+
[1701242880, "109395759104"],
|
|
348
|
+
[1701242895, "109396620288"],
|
|
349
|
+
[1701242910, "109397346304"],
|
|
350
|
+
[1701242925, "109398065152"],
|
|
351
|
+
[1701242940, "109398795264"],
|
|
352
|
+
[1701242955, "109399633920"],
|
|
353
|
+
[1701242970, "109400303616"],
|
|
354
|
+
[1701242985, "109401089024"],
|
|
355
|
+
[1701243000, "109401768960"],
|
|
356
|
+
[1701243015, "109402669056"],
|
|
357
|
+
[1701243030, "109404344320"],
|
|
358
|
+
[1701243045, "109405146112"],
|
|
359
|
+
[1701243060, "109405774848"],
|
|
360
|
+
[1701243075, "109406703616"],
|
|
361
|
+
[1701243090, "109407347712"],
|
|
362
|
+
[1701243105, "109408141312"],
|
|
363
|
+
[1701243120, "109417804800"],
|
|
364
|
+
[1701243135, "109409741824"],
|
|
365
|
+
[1701243150, "109410379776"],
|
|
366
|
+
[1701243165, "109411185664"],
|
|
367
|
+
[1701243180, "109411848192"],
|
|
368
|
+
[1701243195, "109412749312"],
|
|
369
|
+
[1701243210, "109413413888"],
|
|
370
|
+
[1701243225, "109414158336"],
|
|
371
|
+
[1701243240, "109414878208"],
|
|
372
|
+
[1701243255, "109415711744"],
|
|
373
|
+
[1701243270, "109416453120"],
|
|
374
|
+
[1701243285, "109417158656"],
|
|
375
|
+
[1701243300, "109417907200"],
|
|
376
|
+
[1701243315, "109418731520"],
|
|
377
|
+
[1701243330, "109419484160"],
|
|
378
|
+
[1701243345, "109420203008"],
|
|
379
|
+
[1701243360, "109420933120"],
|
|
380
|
+
[1701243375, "109421803520"],
|
|
381
|
+
[1701243390, "109422478336"],
|
|
382
|
+
[1701243405, "109423243264"],
|
|
383
|
+
[1701243420, "109436938240"],
|
|
384
|
+
[1701243435, "109424837632"],
|
|
385
|
+
[1701243450, "109425465344"],
|
|
386
|
+
[1701243465, "109426273280"],
|
|
387
|
+
[1701243480, "109426921472"],
|
|
388
|
+
[1701243495, "109427850240"],
|
|
389
|
+
[1701243510, "109428478976"],
|
|
390
|
+
[1701243525, "109429297152"],
|
|
391
|
+
[1701243540, "109429923840"],
|
|
392
|
+
[1701243555, "109430849536"],
|
|
393
|
+
[1701243570, "109420980224"],
|
|
394
|
+
[1701243585, "109421782016"],
|
|
395
|
+
[1701243600, "109422425088"],
|
|
396
|
+
[1701243615, "109423333376"],
|
|
397
|
+
[1701243630, "109424020480"],
|
|
398
|
+
[1701243645, "109424787456"],
|
|
399
|
+
[1701243660, "109425466368"],
|
|
400
|
+
[1701243675, "109426320384"],
|
|
401
|
+
[1701243690, "109427055616"],
|
|
402
|
+
[1701243705, "109427790848"],
|
|
403
|
+
[1701243720, "109428526080"],
|
|
404
|
+
[1701243735, "109429393408"],
|
|
405
|
+
[1701243750, "109430116352"],
|
|
406
|
+
[1701243765, "109430840320"],
|
|
407
|
+
[1701243780, "109431575552"],
|
|
408
|
+
[1701243795, "109432422400"],
|
|
409
|
+
[1701243810, "109433141248"],
|
|
410
|
+
[1701243825, "109433870336"],
|
|
411
|
+
[1701243840, "109434546176"],
|
|
412
|
+
[1701243855, "109435459584"],
|
|
413
|
+
[1701243870, "109436106752"],
|
|
414
|
+
[1701243885, "109436904448"],
|
|
415
|
+
[1701243900, "109439661056"],
|
|
416
|
+
[1701243915, "109440611328"],
|
|
417
|
+
[1701243930, "109439153152"],
|
|
418
|
+
[1701243945, "109439968256"],
|
|
419
|
+
[1701243960, "109440618496"],
|
|
420
|
+
[1701243975, "109441560576"],
|
|
421
|
+
[1701243990, "109442214912"],
|
|
422
|
+
[1701244005, "109443005440"],
|
|
423
|
+
[1701244020, "109443662848"],
|
|
424
|
+
[1701244035, "109444575232"],
|
|
425
|
+
[1701244050, "109445258240"],
|
|
426
|
+
[1701244065, "109446017024"],
|
|
427
|
+
[1701244080, "109446735872"],
|
|
428
|
+
[1701244095, "109447562240"],
|
|
429
|
+
[1701244110, "109448301568"],
|
|
430
|
+
[1701244125, "109449008128"],
|
|
431
|
+
[1701244140, "109449742336"],
|
|
432
|
+
[1701244155, "109452667904"],
|
|
433
|
+
[1701244170, "109453416448"],
|
|
434
|
+
[1701244185, "109454127104"],
|
|
435
|
+
[1701244200, "109454892032"],
|
|
436
|
+
[1701244215, "109455731712"],
|
|
437
|
+
[1701244230, "109456485376"],
|
|
438
|
+
[1701244245, "109457199104"],
|
|
439
|
+
[1701244260, "109457904640"],
|
|
440
|
+
[1701244275, "109458782208"],
|
|
441
|
+
[1701244290, "109459462144"],
|
|
442
|
+
[1701244305, "109460241408"],
|
|
443
|
+
[1701244320, "109461422080"],
|
|
444
|
+
[1701244335, "109462367232"],
|
|
445
|
+
[1701244350, "109463023616"],
|
|
446
|
+
[1701244365, "109463820288"],
|
|
447
|
+
[1701244380, "109464478720"],
|
|
448
|
+
[1701244395, "109465420800"],
|
|
449
|
+
[1701244410, "109466130432"],
|
|
450
|
+
[1701244425, "109466968064"],
|
|
451
|
+
[1701244440, "109467630592"],
|
|
452
|
+
[1701244455, "109468562432"],
|
|
453
|
+
[1701244470, "109469196288"],
|
|
454
|
+
[1701244485, "109469965312"],
|
|
455
|
+
[1701244500, "109470642176"],
|
|
456
|
+
[1701244515, "109471526912"],
|
|
457
|
+
[1701244530, "109472247808"],
|
|
458
|
+
[1701244545, "109472963584"],
|
|
459
|
+
[1701244560, "109503652864"],
|
|
460
|
+
[1701244575, "109508399104"],
|
|
461
|
+
[1701244590, "109509136384"],
|
|
462
|
+
[1701244605, "109509852160"],
|
|
463
|
+
[1701244620, "109510597632"],
|
|
464
|
+
[1701244635, "109511447552"],
|
|
465
|
+
[1701244650, "109512205312"],
|
|
466
|
+
[1701244665, "109512923136"],
|
|
467
|
+
[1701244680, "109495563264"],
|
|
468
|
+
[1701244695, "109495838720"],
|
|
469
|
+
[1701244710, "109496035328"],
|
|
470
|
+
[1701244725, "109479628800"],
|
|
471
|
+
[1701244740, "109480826880"],
|
|
472
|
+
[1701244755, "109481614336"],
|
|
473
|
+
[1701244770, "109482322944"],
|
|
474
|
+
[1701244785, "109483033600"],
|
|
475
|
+
[1701244800, "109483776000"],
|
|
476
|
+
[1701244815, "109482949632"],
|
|
477
|
+
[1701244830, "109484748800"],
|
|
478
|
+
[1701244845, "109485414400"],
|
|
479
|
+
[1701244860, "109486125056"],
|
|
480
|
+
[1701244875, "109484092416"],
|
|
481
|
+
[1701244890, "109484801024"],
|
|
482
|
+
[1701244905, "109485500416"],
|
|
483
|
+
[1701244920, "109486209024"],
|
|
484
|
+
[1701244935, "109487077376"],
|
|
485
|
+
[1701244950, "109487733760"],
|
|
486
|
+
[1701244965, "109488527360"],
|
|
487
|
+
[1701244980, "109489170432"],
|
|
488
|
+
[1701244995, "109490085888"],
|
|
489
|
+
[1701245010, "109490747392"],
|
|
490
|
+
[1701245025, "109491554304"],
|
|
491
|
+
[1701245040, "109492199424"],
|
|
492
|
+
[1701245055, "109493133312"],
|
|
493
|
+
[1701245070, "109493756928"],
|
|
494
|
+
[1701245085, "109494544384"],
|
|
495
|
+
[1701245100, "109495241728"],
|
|
496
|
+
[1701245115, "109496105984"],
|
|
497
|
+
[1701245130, "109496782848"],
|
|
498
|
+
[1701245145, "109497535488"],
|
|
499
|
+
[1701245160, "109498244096"]
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
]
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -247,7 +247,7 @@ export default class TsGraph {
|
|
|
247
247
|
if (this.options.yAxis.visible) {
|
|
248
248
|
this.yAxis.draw(this.yScales);
|
|
249
249
|
}
|
|
250
|
-
if (this.options.yAxis2.visible && this.options.yAxis2.
|
|
250
|
+
if (this.options.yAxis2.visible && this.options.yAxis2.matchRefId) {
|
|
251
251
|
this.yAxis2.draw(this.y2Scales);
|
|
252
252
|
}
|
|
253
253
|
if (redrawLegend) {
|
|
@@ -569,8 +569,8 @@ export default class TsGraph {
|
|
|
569
569
|
// get axis domain
|
|
570
570
|
if (
|
|
571
571
|
yAxis2.visible &&
|
|
572
|
-
yAxis2.
|
|
573
|
-
yAxis2.
|
|
572
|
+
yAxis2.matchRefId &&
|
|
573
|
+
yAxis2.matchRefId === serie.refId
|
|
574
574
|
) {
|
|
575
575
|
if (y2min < y) {
|
|
576
576
|
y2min = y;
|
|
@@ -601,7 +601,7 @@ export default class TsGraph {
|
|
|
601
601
|
// 如果缩放至没有数据点(无法计算出 ymin 和 ymax),则不更新 domain
|
|
602
602
|
if (ymin !== -Infinity && ymax !== Infinity) {
|
|
603
603
|
this.yAxis.setDomain(this.yScales, { ymin, ymax });
|
|
604
|
-
if (yAxis2.visible && yAxis2.
|
|
604
|
+
if (yAxis2.visible && yAxis2.matchRefId) {
|
|
605
605
|
this.yAxis2.setDomain(this.y2Scales, { y2min, y2max });
|
|
606
606
|
}
|
|
607
607
|
}
|
|
@@ -790,8 +790,8 @@ export default class TsGraph {
|
|
|
790
790
|
if (typeof y === "number" && !isNaN(y)) {
|
|
791
791
|
if (
|
|
792
792
|
yAxis2.visible &&
|
|
793
|
-
yAxis2.
|
|
794
|
-
yAxis2.
|
|
793
|
+
yAxis2.matchRefId &&
|
|
794
|
+
yAxis2.matchRefId === serie.refId
|
|
795
795
|
) {
|
|
796
796
|
if (typeof y2min !== "number" || y < y2min) {
|
|
797
797
|
y2min = y;
|
|
@@ -896,7 +896,7 @@ export default class TsGraph {
|
|
|
896
896
|
this.yAxis = yAxis;
|
|
897
897
|
this.yScales = yAxis.init();
|
|
898
898
|
|
|
899
|
-
if (this.options.yAxis2.visible && this.options.yAxis2.
|
|
899
|
+
if (this.options.yAxis2.visible && this.options.yAxis2.matchRefId) {
|
|
900
900
|
const yAxis2 = new YAxis2(this.options, this.backContext);
|
|
901
901
|
this.yAxis2 = yAxis2;
|
|
902
902
|
this.y2Scales = yAxis2.init();
|
package/src/interface.ts
CHANGED
|
@@ -82,7 +82,7 @@ export type YAxis = {
|
|
|
82
82
|
plotLines: PlotLine[];
|
|
83
83
|
plotLinesFixed?: boolean;
|
|
84
84
|
tickValueFormatter?: (value: number) => string;
|
|
85
|
-
|
|
85
|
+
matchRefId?: string; // 用于匹配 y 轴,如果不填则默认匹配第一个 y 轴
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
export type SerieDataItemMarker = {
|
|
@@ -98,6 +98,7 @@ export type SerieDataItem = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
export interface Serie {
|
|
101
|
+
refId: string;
|
|
101
102
|
name: string;
|
|
102
103
|
color: string;
|
|
103
104
|
visible: boolean;
|
package/src/line.ts
CHANGED
|
@@ -38,10 +38,10 @@ export default class Line {
|
|
|
38
38
|
const x = xScales(new Date(xVal));
|
|
39
39
|
return x;
|
|
40
40
|
};
|
|
41
|
-
const yAccessor = (d: SerieDataItem, ykey: any,
|
|
41
|
+
const yAccessor = (d: SerieDataItem, ykey: any, refId: string) => {
|
|
42
42
|
const val = d[ykey];
|
|
43
43
|
const yScalesFunc =
|
|
44
|
-
yAxis2.visible && yAxis2.
|
|
44
|
+
yAxis2.visible && yAxis2.matchRefId && refId === yAxis2.matchRefId
|
|
45
45
|
? y2Scales
|
|
46
46
|
: yScales;
|
|
47
47
|
if (typeof val === "number" && !isNaN(val)) {
|
|
@@ -78,7 +78,7 @@ export default class Line {
|
|
|
78
78
|
.x(xAccessor)
|
|
79
79
|
.y0((d: SerieDataItem) => {
|
|
80
80
|
if (ykey2 && ykey2 in d) {
|
|
81
|
-
return yAccessor(d, ykey, serie.
|
|
81
|
+
return yAccessor(d, ykey, serie.refId);
|
|
82
82
|
}
|
|
83
83
|
if (xAxis.visible) {
|
|
84
84
|
return height - xAxis.tickpadding - xAxis.labels.fontSize - 5;
|
|
@@ -87,9 +87,9 @@ export default class Line {
|
|
|
87
87
|
})
|
|
88
88
|
.y1((d: SerieDataItem) => {
|
|
89
89
|
if (ykey2 && ykey2 in d) {
|
|
90
|
-
return yAccessor(d, ykey2, serie.
|
|
90
|
+
return yAccessor(d, ykey2, serie.refId);
|
|
91
91
|
}
|
|
92
|
-
return yAccessor(d, ykey, serie.
|
|
92
|
+
return yAccessor(d, ykey, serie.refId);
|
|
93
93
|
})
|
|
94
94
|
.defined(definedAccessor)
|
|
95
95
|
.context(ctx);
|
|
@@ -115,7 +115,7 @@ export default class Line {
|
|
|
115
115
|
.line()
|
|
116
116
|
.x(xAccessor)
|
|
117
117
|
.y((d: SerieDataItem) => {
|
|
118
|
-
return yAccessor(d, ykey, serie.
|
|
118
|
+
return yAccessor(d, ykey, serie.refId);
|
|
119
119
|
})
|
|
120
120
|
.defined(definedAccessor)
|
|
121
121
|
.context(ctx);
|
package/src/tooltip.ts
CHANGED
|
@@ -109,7 +109,7 @@ export default class Tooltip {
|
|
|
109
109
|
|
|
110
110
|
nearestPoints = tempNearestPoints.map((item: any) => {
|
|
111
111
|
const yScalesFunc =
|
|
112
|
-
yAxis2.visible && yAxis2.
|
|
112
|
+
yAxis2.visible && yAxis2.matchRefId && item.refId === yAxis2.matchRefId
|
|
113
113
|
? y2Scales
|
|
114
114
|
: yScales;
|
|
115
115
|
return {
|