@fc-plot/ts-graph 0.6.0

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.
@@ -0,0 +1,2 @@
1
+ !function(e){var t={};function r(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,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){return"X"===t?1e3*e:e}function a(e){var t,r=e.series,n=e.x,o=e.xkey,i=e.ykey,a=e.timestamp,c=e.fillNull,f=(t=function(e,t){return(r=u(e[o],a))<(n=t)?-1:r>n?1:r>=n?0:NaN;var r,n},{left:function(e,r,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var i=n+o>>>1;t(e[i],r)<0?n=i+1:o=i}return n},right:function(e,r,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var i=n+o>>>1;t(e[i],r)>0?o=i:n=i+1}return n}}).left,s=new Date(n).getTime(),p=[];return"[object Array]"!==Object.prototype.toString.call(r)?[]:(r.forEach((function(e,t){if(!1!==e.visible){var r=e.name,y=e.color,b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&"[object Function]"===Object.prototype.toString.call(t)&&t(n)&&(r[n]=e[n]);return r}(e,(function(e){return"data"!==e})),d=e.data,v=void 0===d?[]:d;if("[object Array]"===Object.prototype.toString.call(v)&&0!==(v=v.filter((function(e){return"number"==typeof e[i]||"number"==typeof c}))).length){var O,m=f(v,n),j=v[m-1],g=v[m];if(j&&g){var x=u(j[o],a),P=u(g[o],a),h=j[i],S=g[i];null===h&&void 0!==c&&(h=c),null===S&&void 0!==c&&(S=c),O=s-x<P-s?l(l({},j),{},{name:r,color:y,timestamp:x,value:h,serieIndex:t,serieOptions:b}):l(l({},g),{},{name:r,color:y,timestamp:P,value:S,serieIndex:t,serieOptions:b}),p.push(O)}else if(j){var w=u(j[o],a),_=j[i];null===_&&void 0!==c&&(_=c),O=l(l({},j),{},{name:r,color:y,timestamp:w,value:_,serieIndex:t,serieOptions:b}),p.push(O)}else if(g){var k=u(g[o],a),M=g[i];null===M&&void 0!==c&&(M=c),O=l(l({},g),{},{name:r,color:y,timestamp:k,value:M,serieIndex:t,serieOptions:b}),p.push(O)}}}})),p)}var c={},f={},s=self;s.addEventListener("message",(function(e){var t=e.data;t.id&&(c[t.id]&&t.flag||(c[t.id]=t.str,f[t.id]=JSON.parse(t.str)));var r=a({x:t.x,xkey:t.xkey,ykey:t.ykey,timestamp:t.timestamp,series:f[t.id],fillNull:t.fillNull});s.postMessage(r)}));t.default=s}]);
2
+ //# sourceMappingURL=bada1e7aed43b740339b.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bada1e7aed43b740339b.worker.js","sources":["webpack:///bada1e7aed43b740339b.worker.js"],"mappings":"AAAA","sourceRoot":""}
package/dist/index.css ADDED
@@ -0,0 +1,101 @@
1
+ .d3-graph-container {
2
+ user-select: none;
3
+ }
4
+ .ts-graph-tooltip {
5
+ visibility: hidden;
6
+ position: fixed;
7
+ pointer-events: none;
8
+ user-select: none;
9
+ width: 100%;
10
+ }
11
+ .ts-graph-tooltip-content {
12
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
13
+ font-size: 12px;
14
+ color: #333333;
15
+ margin-left: 0px;
16
+ margin-top: 0px;
17
+ background: rgba(255, 255, 255, 0.85);
18
+ border: 1px solid silver;
19
+ border-radius: 3px;
20
+ box-shadow: 1px 1px 1px #888;
21
+ white-space: nowrap;
22
+ padding: 5px;
23
+ position: fixed;
24
+ z-index: 9999;
25
+ }
26
+ .ts-graph-tooltip ul {
27
+ list-style: none;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+ .ts-graph-tooltip ul li {
32
+ table-layout: fixed;
33
+ word-wrap: break-word;
34
+ white-space: normal;
35
+ }
36
+ .ts-graph-zoom {
37
+ position: relative;
38
+ }
39
+ .ts-graph-legend {
40
+ position: relative;
41
+ padding: 0 10px;
42
+ }
43
+ .ts-graph-legend-item {
44
+ cursor: pointer;
45
+ display: inline-block;
46
+ margin-right: 10px;
47
+ word-break: break-all;
48
+ }
49
+ .ts-graph-legend-item-symbol {
50
+ position: relative;
51
+ display: inline-block;
52
+ vertical-align: middle;
53
+ text-align: center;
54
+ width: 20px;
55
+ height: 20px;
56
+ margin: 0 5px;
57
+ }
58
+ .ts-graph-legend-item-symbol-line {
59
+ position: absolute;
60
+ display: inline-block;
61
+ width: 20px;
62
+ top: 9px;
63
+ left: 0;
64
+ border-width: 1px;
65
+ border-style: solid;
66
+ }
67
+ .ts-graph-legend-item-symbol-point {
68
+ position: absolute;
69
+ display: inline-block;
70
+ width: 10px;
71
+ height: 10px;
72
+ top: 5px;
73
+ left: 5px;
74
+ border-radius: 10px;
75
+ }
76
+ .ts-graph-zoom-marker {
77
+ position: absolute;
78
+ background: rgba(51, 92, 173, 0.25);
79
+ }
80
+ .ts-graph-zoom-resetBtn {
81
+ display: none;
82
+ position: absolute;
83
+ z-index: 1;
84
+ top: 10px;
85
+ right: 10px;
86
+ background: #f7f7f7;
87
+ font-size: 12px;
88
+ text-align: center;
89
+ width: 84px;
90
+ height: 31px;
91
+ line-height: 31px;
92
+ border: 1px solid #ccc;
93
+ cursor: pointer;
94
+ color: #333;
95
+ }
96
+ .ts-graph-zoom-resetBtn:hover {
97
+ background: #e6e6e6;
98
+ }
99
+
100
+
101
+ /*# sourceMappingURL=index.css.map*/
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.css","sources":["webpack:///./assets/style.less","webpack:///style.less"],"sourcesContent":[".d3-graph-container {\n user-select: none;\n}\n\n.ts-graph-tooltip {\n visibility: hidden;\n position: fixed;\n pointer-events: none;\n user-select: none;\n width: 100%;\n}\n.ts-graph-tooltip-content {\n font-size: 12px;\n font-family: \"Lucida Grande\", \"Lucida Sans Unicode\", Arial, Helvetica, sans-serif;\n font-size: 12px;\n white-space: nowrap;\n color: rgb(51, 51, 51);\n margin-left: 0px;\n margin-top: 0px;\n background: rgba(255, 255, 255, 0.85);\n border: 1px solid silver;\n border-radius: 3px;\n box-shadow: 1px 1px 1px #888;\n white-space: nowrap;\n padding: 5px;\n position: fixed;\n z-index: 9999;\n}\n.ts-graph-tooltip ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.ts-graph-tooltip ul li {\n table-layout: fixed;\n word-wrap: break-word;\n white-space: normal;\n}\n.ts-graph-zoom {\n position: relative;\n}\n.ts-graph-legend {\n position: relative;\n padding: 0 10px;\n}\n.ts-graph-legend-item {\n cursor: pointer;\n display: inline-block;\n margin-right: 10px;\n word-break: break-all;\n}\n.ts-graph-legend-item-symbol {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n width: 20px;\n height: 20px;;\n margin: 0 5px;\n}\n.ts-graph-legend-item-symbol-line {\n position: absolute;\n display: inline-block;\n width: 20px;\n top: 9px;\n left: 0;\n border-width: 1px;\n border-style: solid;\n}\n.ts-graph-legend-item-symbol-point {\n position: absolute;\n display: inline-block;\n width: 10px;\n height: 10px;\n top: 5px;\n left: 5px;\n border-radius: 10px;\n}\n.ts-graph-zoom-marker {\n position: absolute;\n background: rgba(51,92,173,0.25);\n}\n.ts-graph-zoom-resetBtn {\n display: none;\n position: absolute;\n z-index: 1;\n top: 10px;\n right: 10px;\n background: #f7f7f7;\n font-size: 12px;\n text-align: center;\n width: 84px;\n height: 31px;\n line-height: 31px;\n border: 1px solid #ccc;\n cursor: pointer;\n color: #333;\n}\n.ts-graph-zoom-resetBtn:hover {\n background: #e6e6e6;\n}\n\n",".d3-graph-container {\n user-select: none;\n}\n.ts-graph-tooltip {\n visibility: hidden;\n position: fixed;\n pointer-events: none;\n user-select: none;\n width: 100%;\n}\n.ts-graph-tooltip-content {\n font-family: \"Lucida Grande\", \"Lucida Sans Unicode\", Arial, Helvetica, sans-serif;\n font-size: 12px;\n color: #333333;\n margin-left: 0px;\n margin-top: 0px;\n background: rgba(255, 255, 255, 0.85);\n border: 1px solid silver;\n border-radius: 3px;\n box-shadow: 1px 1px 1px #888;\n white-space: nowrap;\n padding: 5px;\n position: fixed;\n z-index: 9999;\n}\n.ts-graph-tooltip ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.ts-graph-tooltip ul li {\n table-layout: fixed;\n word-wrap: break-word;\n white-space: normal;\n}\n.ts-graph-zoom {\n position: relative;\n}\n.ts-graph-legend {\n position: relative;\n padding: 0 10px;\n}\n.ts-graph-legend-item {\n cursor: pointer;\n display: inline-block;\n margin-right: 10px;\n word-break: break-all;\n}\n.ts-graph-legend-item-symbol {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n width: 20px;\n height: 20px;\n margin: 0 5px;\n}\n.ts-graph-legend-item-symbol-line {\n position: absolute;\n display: inline-block;\n width: 20px;\n top: 9px;\n left: 0;\n border-width: 1px;\n border-style: solid;\n}\n.ts-graph-legend-item-symbol-point {\n position: absolute;\n display: inline-block;\n width: 10px;\n height: 10px;\n top: 5px;\n left: 5px;\n border-radius: 10px;\n}\n.ts-graph-zoom-marker {\n position: absolute;\n background: rgba(51, 92, 173, 0.25);\n}\n.ts-graph-zoom-resetBtn {\n display: none;\n position: absolute;\n z-index: 1;\n top: 10px;\n right: 10px;\n background: #f7f7f7;\n font-size: 12px;\n text-align: center;\n width: 84px;\n height: 31px;\n line-height: 31px;\n border: 1px solid #ccc;\n cursor: pointer;\n color: #333;\n}\n.ts-graph-zoom-resetBtn:hover {\n background: #e6e6e6;\n}\n"],"mappings":"AAAA;AACA;ACCA;ADEA;AACA;AACA;AACA;AACA;AACA;ACAA;ADEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;ACFA;ADIA;AACA;ACFA;ADIA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;AACA;ACFA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACFA;ADIA;AACA;ACFA;;","sourceRoot":""}
package/dist/index.js ADDED
@@ -0,0 +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 n="object"==typeof exports?t(require("d3"),require("lodash")):t(e.d3,e._);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(t,n){t.exports=e},function(e,n){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.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e.exports=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var i=n(8),o=n(9),r=n(10),s=n(11);e.exports=function(e){return i(e)||o(e)||r(e)||s()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){e.exports=function(){return n(12)('!function(e){var t={};function r(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,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){return"X"===t?1e3*e:e}function a(e){var t,r=e.series,n=e.x,o=e.xkey,i=e.ykey,a=e.timestamp,c=e.fillNull,f=(t=function(e,t){return(r=u(e[o],a))<(n=t)?-1:r>n?1:r>=n?0:NaN;var r,n},{left:function(e,r,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var i=n+o>>>1;t(e[i],r)<0?n=i+1:o=i}return n},right:function(e,r,n,o){for(null==n&&(n=0),null==o&&(o=e.length);n<o;){var i=n+o>>>1;t(e[i],r)>0?o=i:n=i+1}return n}}).left,s=new Date(n).getTime(),p=[];return"[object Array]"!==Object.prototype.toString.call(r)?[]:(r.forEach((function(e,t){if(!1!==e.visible){var r=e.name,y=e.color,b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&"[object Function]"===Object.prototype.toString.call(t)&&t(n)&&(r[n]=e[n]);return r}(e,(function(e){return"data"!==e})),d=e.data,v=void 0===d?[]:d;if("[object Array]"===Object.prototype.toString.call(v)&&0!==(v=v.filter((function(e){return"number"==typeof e[i]||"number"==typeof c}))).length){var O,m=f(v,n),j=v[m-1],g=v[m];if(j&&g){var x=u(j[o],a),P=u(g[o],a),h=j[i],S=g[i];null===h&&void 0!==c&&(h=c),null===S&&void 0!==c&&(S=c),O=s-x<P-s?l(l({},j),{},{name:r,color:y,timestamp:x,value:h,serieIndex:t,serieOptions:b}):l(l({},g),{},{name:r,color:y,timestamp:P,value:S,serieIndex:t,serieOptions:b}),p.push(O)}else if(j){var w=u(j[o],a),_=j[i];null===_&&void 0!==c&&(_=c),O=l(l({},j),{},{name:r,color:y,timestamp:w,value:_,serieIndex:t,serieOptions:b}),p.push(O)}else if(g){var k=u(g[o],a),M=g[i];null===M&&void 0!==c&&(M=c),O=l(l({},g),{},{name:r,color:y,timestamp:k,value:M,serieIndex:t,serieOptions:b}),p.push(O)}}}})),p)}var c={},f={},s=self;s.addEventListener("message",(function(e){var t=e.data;t.id&&(c[t.id]&&t.flag||(c[t.id]=t.str,f[t.id]=JSON.parse(t.str)));var r=a({x:t.x,xkey:t.xkey,ykey:t.ykey,timestamp:t.timestamp,series:f[t.id],fillNull:t.fillNull});s.postMessage(r)}));t.default=s}]);\n//# sourceMappingURL=bada1e7aed43b740339b.worker.js.map',n.p+"bada1e7aed43b740339b.worker.js")}},function(e,t,n){var i=n(6);e.exports=function(e){if(Array.isArray(e))return i(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var i=n(6);e.exports=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},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.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var i=window.URL||window.webkitURL;e.exports=function(e,t){try{try{var n;try{(n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),n=n.getBlob()}catch(t){n=new Blob([e])}return new Worker(i.createObjectURL(n))}catch(t){return new Worker("data:application/javascript,"+encodeURIComponent(e))}}catch(e){if(!t)throw Error("Inline worker is not supported");return new Worker(t)}}},function(e,t,n){},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return F}));var i=n(5),o=n.n(i),r=n(4),s=n.n(r),a=n(2),l=n.n(a),c=n(3),d=n.n(c),u=n(0),h=n(1);let f=null;let p=null;function v(e,t={}){let n=document.createElement(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n}function m(e,t,n){return(window.getComputedStyle(e,n||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 _(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=x.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){let{offsetWidth:t,offsetHeight:n}=e,i=new ResizeObserver(()=>{(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==t||e.offsetHeight!==n))&&k(e)}),{detached:o,rendered:r}=y(e);e.__resize_observer_triggered__=!1===o&&!1===r,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){k(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 n=v("div",{className:"resize-triggers"}),i=v("div",{className:"resize-expand-trigger"}),o=v("div"),r=v("div",{className:"resize-contract-trigger"});i.appendChild(o),n.appendChild(i),n.appendChild(r),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:i,expandChild:o,contract:r},C(e),e.addEventListener("scroll",w,!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 x(){let{rendered:e,detached:t}=y(this);e!==this.__resize_rendered__&&(!t&&this.__resize_triggers__&&(C(this),this.addEventListener("scroll",w,!0)),this.__resize_rendered__=e,k(this))}function w(){var e,t;C(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:n}=e.__resize_last__,{offsetWidth:i,offsetHeight:o}=e;return i!==t||o!==n?{width:i,height:o}:null}(this);e&&(this.__resize_last__=e,k(this))},f||(f=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),f(t))}function k(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach(t=>{t.call(e,e)})}function C(e){let{expand:t,expandChild:n,contract:i}=e.__resize_triggers__,{scrollWidth:o,scrollHeight:r}=i,{offsetWidth:s,offsetHeight:a,scrollWidth:l,scrollHeight:c}=t;i.scrollLeft=o,i.scrollTop=r,n.style.width=s+1+"px",n.style.height=a+1+"px",t.scrollLeft=l,t.scrollTop=c}function S(e,t){var n=e.length;return t<n?e[t]:S(e,t-n)}function O(e,t){return"X"===t?1e3*e:e}function z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e.getBoundingClientRect(),o=t.touches[n].clientX,r=t.touches[n].clientY,s=o-i.left,a=r-i.top;return{offsetX:s,offsetY:a,clientX:o,clientY:r}}var j=function(){function e(t,n){l()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=n}return d()(e,[{key:"init",value:function(){var e=this.options,t=e.chart.width,n=e.timestamp,i=e.xmin,o=e.xmax,r=u.scaleTime().range([0,t]);return r.domain([O(o,n)+(i===o?1e3:0),O(i,n)-(i===o?1e3:0)]),r}},{key:"draw",value:function(e){var t=this.ctx,n=this.options,i=n.chart,o=n.xAxis,r=n.time,s=e.ticks(Math.floor(i.width/90));o.ticks&&(s=o.ticks);var a=i.height-o.tickpadding-o.labels.fontSize;t.beginPath(),s.forEach((function(n){var i=e(n);i&&(t.moveTo(i,a),t.lineTo(i,a-o.tickLength))})),t.lineWidth=1,t.strokeStyle=o.tickColor,t.stroke(),t.beginPath(),t.moveTo(0,a-o.tickLength),t.lineTo(i.width,a-o.tickLength),t.lineWidth=1,t.strokeStyle=o.lineColor,t.stroke(),t.textAlign="center",t.textBaseline="bottom",t.fillStyle=o.labels.color,t.font="".concat(o.labels.fontSize,"px Palantino"),s.forEach((function(n,a){var l="%H:%M";0!==n.getSeconds()&&(l="%H:%M:%S"),0===n.getHours()&&0===n.getMinutes()&&0===n.getSeconds()&&(l="%m-%d"),o.labels.timeFormat&&(l=o.labels.timeFormat);var c=n;if(r&&r.timezoneOffset){var d=n.getTimezoneOffset(),h=n.getTime()+60*d*1e3+60*r.timezoneOffset*1e3;c=new Date(h)}if(o.ticks&&o.ticks.length>1){var f=e(n);0===a?f+=l.length*o.labels.fontSize/4+1:a===s.length-1&&(f-=l.length*o.labels.fontSize/4-1),t.fillText(u.timeFormat(l)(c),f,i.height)}else e(n)&&t.fillText(u.timeFormat(l)(c),e(n),i.height)}))}},{key:"drawPlotLines",value:function(e){var t=this.ctx,n=this.options,i=n.chart,o=n.xAxis,r=n.xAxis.plotLines,s=i.height-o.tickpadding-o.labels.fontSize;Array.isArray(r)&&r.forEach((function(n){var i=e(n.value);t.setLineDash([5,3]),t.beginPath(),t.moveTo(i,0),t.lineTo(i,s-o.tickLength),t.strokeStyle=n.color,t.stroke(),t.setLineDash([])}))}}]),e}(),A=function(){function e(t,n){l()(this,e),this.options=void 0,this.ctx=void 0,this.tickLength=void 0,this.ticks=void 0,this.options=t,this.ctx=n,this.tickLength=Math.floor(t.chart.height/50),this.ticks=[]}return d()(e,[{key:"init",value:function(){var e=this.options,t=e.chart,n=e.xAxis,i=u.scaleLinear().range([t.height-(n.labels.fontSize+n.tickpadding+n.tickLength),20]);return this.setDomain(i,this.options),i}},{key:"getRealData",value:function(e){var t=this.options,n=t.yAxis.plotLines,i=t.ykey,o=t.fillNull;return Array.isArray(e)?(Array.isArray(n)&&n.forEach((function(t){"number"==typeof t.value&&e.push(s()({},i,t.value))})),"number"==typeof o&&e.push(s()({},i,o)),e):[]}},{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 n=t.ymin,i=t.ymax,o=this.getPlotLinesMaxAbs(),r=this.tickLength;if(n===i){var s=(i-n)/(this.tickLength-1),a=s/2||i||1;r=0===s?1:this.tickLength,n-=a,i+=a}if(n>i){var l=n;n=i,i=l}o&&(o<n&&(n=o),o>i&&(i=o)),e.domain([n,i]),e.nice(r),this.ticks=e.ticks(r)}},{key:"draw",value:function(e){var t=this.ctx,n=this.options.yAxis;t.textAlign="left",t.textBaseline="bottom",t.shadowColor=n.labels.shadowColor,t.shadowBlur=1,t.lineWidth=1,t.fillStyle=n.labels.color,t.font="".concat(n.labels.fontSize,"px Palantino"),this.ticks.forEach((function(n){var i=String(n);if(n>=1e3){i=u.format(".5s")(n);var o=/[kMGTPEZY]$/;if(o.test(i)){var r=i[i.length-1];i=i.replace(o,""),i=parseFloat(i)+r}}var s=e(n);t.strokeText(i,0,s),t.fillText(i,0,s)}))}},{key:"drawGridLine",value:function(e){var t=this.ctx,n=this.options,i=n.chart,o=n.yAxis;t.beginPath(),this.ticks.forEach((function(n){var o=e(n);t.moveTo(0,o),t.lineTo(i.width,o)})),t.strokeStyle=o.gridLineColor,t.stroke()}},{key:"drawPlotLines",value:function(e){var t=this.ctx,n=this.options,i=n.chart,o=n.yAxis,r=n.yAxis.plotLines;Array.isArray(r)&&r.forEach((function(n){var r=e(n.value);t.setLineDash([5,3]),t.beginPath(),t.moveTo(0,r),t.lineTo(i.width,r),t.strokeStyle=n.color,t.stroke(),t.setLineDash([]),t.textAlign="right",t.textBaseline="top",t.shadowColor="#fff",t.shadowBlur=1,t.lineWidth=1,t.fillStyle=n.color,t.font="".concat(o.labels.fontSize,"px Palantino"),t.strokeText(String(n.value),i.width-10,r),t.fillText(String(n.value),i.width-10,r)}))}}]),e}(),E=n(7);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=new(n.n(E).a),M=function(){function e(t,n,i,o){l()(this,e),this.options=void 0,this.ctx=void 0,this.flag=void 0,this.isMouserover=void 0,this.options=t,this.ctx=n,this.flag=!1,this.init(i,o),this.isMouserover=!1}return d()(e,[{key:"init",value:function(e,t){var n=this.options.chart.id,i=document.createElement("div");i.id="".concat(n,"-tooltip"),i.className="ts-graph-tooltip",document.getElementById(i.id)||document.body.append(i)}},{key:"clear",value:function(){var e=this.options,t=e.ratio,n=e.chart,i=n.id,o=n.containerWidth,r=n.containerHeight,s=document.getElementById("".concat(i,"-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,n,i){var o=this,r=this.options,s=r.series,a=void 0===s?[]:s,l=r.chart,c=l.id,d=l.colors,u=r.tooltip.shared,f=r.xkey,p=r.ykey,v=r.timestamp,m=r.fillNull,y=t.invert(e.offsetX),g=[],b={x:y,xkey:f,ykey:p,timestamp:v,fillNull:m};this.flag?(b.id=c,b.flag=this.flag,P.postMessage(b)):(b.id=c,b.str=JSON.stringify(a),b.flag=this.flag,P.postMessage(b),this.flag=!0),P.onmessage=function(r){if(!1!==o.isMouserover){"[object Array]"===Object.prototype.toString.call(r.data)&&(g=r.data.map((function(e){return T(T({},e),{},{x:t(e.timestamp),y:n(e.value),color:e.color||S(d,e.serieIndex)})})));var s,a,l=Object(h.groupBy)(g,"x");if(Object(h.keys)(l).length>1){var c=Number.POSITIVE_INFINITY;for(var f in l)if(Object.prototype.hasOwnProperty.call(l,f)){var p=(s=e.offsetX,a=Number(f),Math.sqrt(Math.pow(a-s,2)));p<c&&(c=p,g=l[f])}}if(!u){var v=Number.POSITIVE_INFINITY;g.forEach((function(t){var n,i,o=(n={x:e.offsetX,y:e.offsetY},i=t,Math.sqrt(Math.pow(i.x-n.x,2)+Math.pow(i.y-n.y,2)));o<v&&(v=o,g=[t])}))}i(g)}}}},{key:"draw",value:function(e,t,n,i){var o=this;this.isMouserover=!0,this.getNearestPoints(e,t,n,(function(t){o.clear(),t.length&&(o.drawCrosshair(t[0].x),o.drawSymbol(t),o.drawModal(t,e)),i&&"[object Function]"===Object.prototype.toString.call(i)&&i(t)}))}},{key:"drawModal",value:function(e,t){var n=this.options,i=n.chart,r=i.id,s=i.renderTo,a=n.tooltip,l=n.time,c=s.offsetWidth,d=s.offsetHeight,f=document.getElementById("".concat(r,"-tooltip")),p=document.createElement("div"),v=e,m=((d=window.innerHeight/1.5)-18-100)/15,y=!1;if(a.sharedSortDirection&&(e=Object(h.orderBy)(e,(function(e){return e.value}),a.sharedSortDirection)),e.length>m&&(e=e.slice(0,m),y=!0),p.className="ts-graph-tooltip-content",f.appendChild(p),"[object Function]"===Object.prototype.toString.call(a.formatter))p.innerHTML=a.formatter(o()(e),o()(v));else{var g=e[0],b=document.createDocumentFragment(),_=document.createElement("ul"),x=document.createElement("li"),w=new Date(g.timestamp);if(l&&l.timezoneOffset){var k=w.getTimezoneOffset(),C=w.getTime()+60*k*1e3+60*l.timezoneOffset*1e3;w=new Date(C)}var S=document.createTextNode(u.timeFormat("%Y-%m-%d %H:%M:%S")(w));if(x.appendChild(S),x.style.color="#666",_.style.maxWidth="".concat(window.innerWidth/1.5,"px"),_.appendChild(x),b.appendChild(_),e.forEach((function(e){var t=e.color,n=e.name,i=e.value,o=e.filledNull,r=document.createElement("li");if(t){var s=document.createElement("span"),l=document.createTextNode("● ");s.style.color=t,s.appendChild(l),r.appendChild(s)}if(n){var c=document.createTextNode("".concat(n,": "));r.appendChild(c)}if(Object(h.isNumber)(i)){var d,f=document.createElement("strong");if("origin"===a.precision)d=i;else if("short"===a.precision){d=function(e){e:for(var t,n=e.length,i=1,o=-1;i<n;++i)switch(e[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;default:if(o>0){if(!+e[i])break e;o=0}}return o>0?e.slice(0,o)+e.slice(t+1):e}(u.format(".5s")(i))}else d=a.precision>0?u.format(",."+a.precision+"f")(i):u.format(",.3f")(i);d+=o?"(空值填补,仅限看图使用)":"";var p=document.createTextNode(d);f.appendChild(p),r.appendChild(f)}_.appendChild(r)})),y){var O=document.createElement("li"),z=document.createTextNode("......");O.appendChild(z),_.appendChild(O)}p.appendChild(b)}var j=p.offsetWidth,A=p.offsetHeight;f.style.left="".concat(t.clientX-j-20,"px"),f.style.top="".concat(t.clientY+20,"px"),t.clientX-j-20<0&&(f.style.left="".concat(t.clientX+20,"px"),t.clientX+20+j>c&&(f.style.left="0px")),t.clientY+20+A>d&&(t.clientY-A-20<0?f.style.top="0px":f.style.top="".concat(t.clientY-A-20,"px")),f.style.zIndex="9999",f.style.visibility="visible"}},{key:"drawSymbol",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.ctx;e.forEach((function(e){var n=e.x,i=e.y,o=e.color;t.beginPath(),t.arc(n,i,5,0,360,!1),t.lineWidth=1,t.fillStyle=o,t.fill(),t.beginPath(),t.arc(n,i,3,0,360,!1),t.lineWidth=1,t.fillStyle="white",t.fill()}))}},{key:"drawCrosshair",value:function(e){var t=this.ctx,n=this.options,i=n.chart,o=n.xAxis,r=i.height-o.tickpadding-o.labels.fontSize-o.tickLength;t.beginPath(),t.moveTo(e,0),t.lineTo(e,r),t.lineWidth=1,t.strokeStyle=o.lineColor,t.stroke()}},{key:"destroy",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-tooltip"));t&&t.parentNode&&t.parentNode.removeChild(t)}}]),e}(),N=function(){function e(t,n){l()(this,e),this.options=void 0,this.ctx=void 0,this.options=t,this.ctx=n}return d()(e,[{key:"draw",value:function(e,t){var n=this,i=this.options,o=i.type,r=i.series,s=i.chart,a=s.colors,l=(s.width,s.height),c=i.xAxis,d=i.xkey,f=i.ykey,p=i.timestamp,v=i.fillNull,m=i.notDisplayedSeries,y=this.ctx;Object(h.sortBy)(r,"zIndex").forEach((function(i,r){if(!1!==i.visible&&!(m.indexOf(i.name)>-1)){var s=i.color||S(a,r);if(i.color=s,"area"===o||"lineAndArea"===o){y.beginPath(),u.area().x((function(t){var n="X"===p?1e3*t[d]:t[d];return e(new Date(n))})).y0(l-c.tickpadding-c.labels.fontSize-5).y1((function(e){var n=e[f];return"number"==typeof n?t(n):"number"==typeof v?t(v):void 0})).defined((function(e){return"number"==typeof e[f]||"number"==typeof v})).context(y)(i.data||[]);var h=y.createLinearGradient(0,0,0,l);h.addColorStop(0,s),h.addColorStop(.2,s),h.addColorStop(1,"rgb(255,255,255, 0)"),y.fillStyle=h,y.fill(),y.closePath()}if("line"===o||"lineAndArea"===o){y.beginPath();var g=u.line().x((function(t){var n="X"===p?1e3*t[d]:t[d];return e(new Date(n))})).y((function(e){var n=e[f];return"number"==typeof n?t(n):"number"==typeof v?t(v):void 0})).defined((function(e){return"number"==typeof e[f]||"number"==typeof v})).context(y);y.lineTo(0,0),g(i.data||[]),y.lineJoin="round",y.lineWidth=n.options.line.width,y.strokeStyle=s,y.lineCap="round",y.setLineDash(i.lineDash||[]),y.stroke(),y.closePath()}}}))}}]),e}(),I=function(){function e(t,n,i,o){l()(this,e),this.options=void 0,this.reset=void 0,this.options=t,this.init(i,o),this.reset=n}return d()(e,[{key:"init",value:function(e,t){var n=this.options.chart,i=n.id,o=n.containerHeight,r=document.createElement("div"),s=document.createElement("div"),a=document.createElement("a"),l=document.createTextNode("Reset zoom");r.id="".concat(i,"-zoom"),r.className="ts-graph-zoom",s.id="".concat(i,"-zoom-marker"),s.className="ts-graph-zoom-marker",s.style.height="".concat(o,"px"),a.id="".concat(i,"-zoom-resetBtn"),a.className="ts-graph-zoom-resetBtn",a.appendChild(l),r.appendChild(s),r.appendChild(a),e.insertBefore(r,t),this.onReset()}},{key:"onReset",value:function(){var e=this,t=this.options.chart.id;document.getElementById("".concat(t,"-zoom-resetBtn")).addEventListener("click",(function(t){t.stopPropagation(),e.reset(),e.clearResetBtn()}))}},{key:"onZoom",value:function(e,t,n){var i=this.options.chart.width,o=t.offsetX-e.offsetX;if(o){var r=i/Math.abs(o),s=t.offsetX>e.offsetX?e.offsetX:t.offsetX,a=u.zoomIdentity.translate(-s*r,0).scale(r);this.drawResetBtn(),n(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 n=this.options.chart.marginLeft,i=e.offsetX,o=t.offsetX,r=this.options.chart,s=r.id,a=r.containerWidth,l=document.getElementById("".concat(s,"-zoom-marker"));l.style.display="block",l.style.top="0px",i<o?(l.style.right="unset",l.style.left="".concat(i+n,"px"),l.style.width="".concat(o-i,"px")):(l.style.left="unset",l.style.right="".concat(a-i-n,"px"),l.style.width="".concat(i-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}();function B(e){for(var t=-1,n=e;n;){if(!("previousSibling"in n)){t=-1;break}n=n.previousSibling,t+=1}return t}var D=function(){function e(t,n,i,o){var r=this;l()(this,e),this.options=void 0,this.onLegendItemClick=void 0,this.handelLegendItemClick=function(e){for(var t=e.currentTarget,n=e.target;n!==t;){if(n&&"ts-graph-legend-item"===n.className){var i=r.options.series,o=B(n);r.onLegendItemClick(i[o].name)}n.parentNode&&(n=n.parentNode)}},this.options=t,this.init(i,o),this.onLegendItemClick=n}return d()(e,[{key:"init",value:function(e,t){var n=this.options.chart.id,i=document.createElement("div");i.id="".concat(n,"-legend"),i.className="ts-graph-legend",document.getElementById(i.id)||e.insertBefore(i,t),this.initEvent()}},{key:"initEvent",value:function(){var e=this.options.chart.id,t=document.getElementById("".concat(e,"-legend"));t.removeEventListener("click",this.handelLegendItemClick),t.addEventListener("click",this.handelLegendItemClick)}},{key:"updateOptions",value:function(e){this.options=e}},{key:"draw",value:function(){var e=this.options,t=e.chart.id,n=e.series,i=e.legend,o=document.getElementById("".concat(t,"-legend"));if(i.enabled&&"[object Array]"===Object.prototype.toString.call(n)){o.innerHTML="";var r=document.createDocumentFragment();n.forEach((function(e){var t=document.createElement("span"),n=document.createElement("span"),i=document.createElement("span"),o=document.createElement("span"),s=document.createTextNode(e.name);t.className="ts-graph-legend-item",n.className="ts-graph-legend-item-symbol",i.className="ts-graph-legend-item-symbol-line",i.style.borderColor=e.color,o.className="ts-graph-legend-item-symbol-point",o.style.backgroundColor=e.color,n.appendChild(i),n.appendChild(o),t.appendChild(n),t.appendChild(s),r.appendChild(t)})),o.appendChild(r)}}}]),e}();n(13);function W(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(){function e(t){var n=this;l()(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.yScales=void 0,this.line=void 0,this.legend=void 0,this.tooltip=void 0,this.zoom=void 0,this.transform=void 0,this.getZoomedSeries=function(){var e=n.options,t=e.chart.renderTo,i=e.series,o=e.timestamp,r=e.xkey,s=t.offsetWidth;return i.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],i=n.xScales(new Date(t));return i>=0&&i<=s}));return H(H({},e),{},{data:t})}return e}))},this.handleResize=function(){var e=n.options.chart,t=e.renderTo.offsetWidth,i=e.renderTo.offsetHeight;n.options.chart.width=t-e.marginLeft-e.marginRight,n.options.chart.height=i-e.marginTop-e.marginBottom,n.options.chart.containerWidth=t,n.options.chart.containerHeight=i,n.container.style.width="".concat(t,"px"),n.container.style.height="".concat(i,"px"),n.retinaScaled(n.backCanvas,"back"),n.retinaScaled(n.frontCanvas,"front"),n.retinaScaled(n.eventCanvas,"event"),n.initScales(),n.draw()},this.handleZoom=function(e){var t=n.options,i=t.ykey,o=t.yAxis,r=n.options.series;if(e?(n.transform=e,n.xScales=e.rescaleX(n.xScales),r=n.getZoomedSeries()):(n.transform=void 0,n.xScales=n.xAxis.init()),Array.isArray(r)){var s,a=o.min||-1/0,l=o.max||1/0,c=W(r);try{for(c.s();!(s=c.n()).done;){var d=s.value,u=Array.isArray(d.data)?d.data:[],h=void 0;for(h=0;h<u.length;h++){var f=u[h][i];null!==f&&(a<f&&(a=f),l>f&&(l=f))}}}catch(e){c.e(e)}finally{c.f()}n.yAxis.setDomain(n.yScales,{ymin:a,ymax:l})}n.draw(),n.options.onZoom(n.getZoomedSeries)},this.handleLegendItemClick=function(e){var t=n.options.notDisplayedSeries;-1===t.indexOf(e)?t.push(e):(n.options.notDisplayedSeries=t.filter((function(t){return t!==e})),n.update(n.options))};var i={type:"line",ratio:window.devicePixelRatio||1,xkey:0,ykey:1,timestamp:"x",chart:{id:Object(h.uniqueId)("ts-graph-"),colors:["#3399CC","#CC9933","#9966CC","#66CC66","#CC3333","#99CCCC","#CCCC66","#CC99CC","#99CC99","#CC6666","#336699","#996633","#993399","#339966","#993333"],width:t.chart.renderTo.offsetWidth,height:t.chart.renderTo.offsetHeight||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:{visible:!0,lineColor:"#ccc",lineWidth:1,tickLength:5,tickpadding:5,tickColor:"#ccc",gridLineColor:"#efefef",labels:{color:"#999",shadowColor:"#fff",fontSize:11,style:{fontSize:11,color:"#999"}}},line:{width:2},tooltip:{shared:!0},series:[],legend:{align:"center",verticalAlign:"top",enabled:!1},fillNull:void 0,onClick:function(){},onZoom:function(){}},o=Object(h.merge)({},i,t);void 0===t.chart.marginTop&&o.legend.enabled&&(o.chart.marginTop=20),this.handleResize=Object(h.debounce)(this.handleResize,300),this.init(o)}return d()(e,[{key:"init",value:function(e){var t=e.chart;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.initEvent(),this.initLine(),this.initLegend(),this.initTooltip(),this.initZoom(),this.initSeries(),this.initScales(),this.draw()}},{key:"clearRect",value:function(e){var t=this.options.chart,n=t.containerWidth,i=t.containerHeight;e.clearRect(0,0,n,i)}},{key:"draw",value:function(){this.clearRect(this.backContext),this.options.xAxis.visible&&this.yAxis.drawGridLine(this.yScales),this.line.draw(this.xScales,this.yScales),this.options.xAxis.visible&&this.xAxis.draw(this.xScales),this.options.yAxis.visible&&this.yAxis.draw(this.yScales),this.xAxis.drawPlotLines(this.xScales),this.yAxis.drawPlotLines(this.yScales),this.legend.draw()}},{key:"update",value:function(e){var t=Object(h.assign)({},this.options,e);e.series&&(t.series=e.series),this.options=t,this.initSeries(),this.initLine(),this.initTooltip(),this.initScales(),this.legend.updateOptions(t),this.draw()}},{key:"getSeries",value:function(){return o()(this.options.series)}},{key:"initEvent",value:function(){var e,t=!1,n={},i={},o=!1,r=this,s=Object(h.debounce)((function(e){o&&(r.tooltip.draw(e,r.xScales,r.yScales),t&&r.zoom.drawMarker(n,e))}),10),a=Object(h.throttle)((function(){r.tooltip.clear()}),10);u.select(this.eventCanvas).on("mousemove",(function(){o=!0,s(u.event)})).on("mouseleave",(function(){e=u.event,o=!1,a()})).on("mousedown",(function(){t=!0,n=u.event})).on("mouseup",(function(){u.event.stopPropagation();var e=u.event;n&&n.offsetX!==e.offsetX?(r.zoom.clearMarker(),r.zoom.onZoom(n,e,(function(e){r.handleZoom(e)}))):r.options.onClick(u.event),t=!1,n={}})).on("touchstart",(function(){u.event.touches.length>1&&(t=!0)})).on("touchmove",(function(){var e=z(r.eventCanvas,u.event);1===u.event.touches.length&&r.tooltip.draw(e,r.xScales,r.yScales),t&&(n=e,i=z(r.eventCanvas,u.event,1),r.zoom.drawMarker(n,i))})).on("touchend",(function(){o=!1,a(),n&&n.offsetX!==i.offsetX?(r.zoom.clearMarker(),r.zoom.onZoom(n,i,(function(e){r.handleZoom(e)}))):r.options.onClick(u.event),t=!1,n={},i={}})),window.addEventListener("mouseup",(function(){if(!Object(h.isEmpty)(n)){var i=e;t=!1,r.zoom.clearMarker(),r.zoom.onZoom(n,i,(function(e){r.handleZoom(e)})),n={}}})),_(this.options.chart.renderTo,this.handleResize)}},{key:"retinaScaled",value:function(e,t){var n=this.options,i=n.chart,o=n.ratio,r=e.getContext("2d"),s="front"===t?i.containerWidth:i.width,a="front"===t?i.containerHeight:i.height,l="front"===t?"0px":"".concat(i.marginLeft,"px"),c="front"===t?"0px":"".concat(i.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=l,e.style.top=c,"front"===t&&r.translate(i.marginLeft*o,i.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 n=document.createElement("canvas"),i=n.getContext("2d");n.setAttribute("id","".concat(e,"-").concat(t,"Canvas")),this.container.appendChild(n),this["".concat(t,"Canvas")]=n,this["".concat(t,"Context")]=i,this.retinaScaled(n,t)}t.call(this,"back"),t.call(this,"front"),t.call(this,"event")}},{key:"initSeries",value:function(){var e=this.options,t=e.fillNull,n=e.series,i=e.xkey,o=e.ykey,r=e.yAxis,s=-1/0,a=1/0,l=r.min,c=r.max;if(Array.isArray(n)){var d,u=[],h=W(n);try{for(h.s();!(d=h.n()).done;){var f=d.value,p=Array.isArray(f.data)?f.data:[],v=[],m=!1,y=void 0;for(y=0;y<p.length;y++){var g=p[y],b=g[i],_=g[o];void 0===t?0===y||y===p.length-1||y>0&&y<p.length-1&&"number"==typeof _?(v.push(g),m=!0):m&&(v.push(g),m=!1):v.push(g),s<b&&(s=b),a>b&&(a=b),"number"==typeof _?(("number"!=typeof l||_<l)&&(l=_),("number"!=typeof c||_>c)&&(c=_)):"number"==typeof t&&(t<l&&(l=t),t>c&&(c=t))}u.push(H(H({},f),{},{data:v}))}}catch(e){h.e(e)}finally{h.f()}this.options.series=u,this.options.xmin=s,this.options.xmax=a,this.options.ymin=l,this.options.ymax=c}}},{key:"initLine",value:function(){this.line=new N(this.options,this.backContext)}},{key:"initTooltip",value:function(){this.tooltip=new M(this.options,this.frontContext,this.container,this.eventCanvas)}},{key:"initZoom",value:function(){this.zoom=new I(this.options,this.handleZoom,this.container,this.eventCanvas)}},{key:"initLegend",value:function(){this.legend=new D(this.options,this.handleLegendItemClick,this.container,this.eventCanvas)}},{key:"initScales",value:function(){var e=new j(this.options,this.backContext),t=new A(this.options,this.backContext);this.xAxis=e;var n=e.init();this.transform&&(n=this.transform.rescaleX(n)),this.xScales=n,this.yAxis=t,this.yScales=t.init()}},{key:"destroy",value:function(){this.tooltip.destroy(),u.select(this.eventCanvas).on("mousemove",null).on("mouseleave",null).on("mousedown",null).on("mouseup",null).on("touchmove",null),u.select(this.container).remove(),function(e,t){let n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.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",w),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)}}]),e}()}])}));
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["webpack:///index.js"],"mappings":"AAAA","sourceRoot":""}
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>d3-graph</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, shrink-to-fit=no, user-scalable=no" />
7
+ </head>
8
+ <body>
9
+ <a id="destroyBtn">destroy</a>
10
+ <script type="text/javascript">
11
+ document.documentElement.addEventListener('touchmove', function(event) {
12
+ if (event.touches.length > 1) {
13
+ event.preventDefault();
14
+ }
15
+ }, false);
16
+ window.addEventListener('gesturestart', function (event) {
17
+ event.preventDefault();
18
+ });
19
+ window.addEventListener('gesturechange', function (event) {
20
+ event.preventDefault();
21
+ });
22
+ window.addEventListener('gestureend', function (event) {
23
+ event.preventDefault();
24
+ });
25
+ </script>
26
+ </body>
27
+ </html>
@@ -0,0 +1,93 @@
1
+ import { random } from 'lodash';
2
+ import TsGraph from '../src/index';
3
+ import '../assets/style.less';
4
+
5
+ function generateSeries(idx, seriesCount = 1) {
6
+ const series = [];
7
+
8
+ for (let n = 1; n <= seriesCount; n++) {
9
+ const seriesData = [];
10
+ const seriesDataCount = 60;
11
+
12
+ for (let m = 1; m <= seriesDataCount; m++) {
13
+ seriesData.push({
14
+ timestamp: 1609430399000 + (m * 7776000000),
15
+ value: Math.ceil(Math.random()*100),
16
+ });
17
+ }
18
+
19
+ series.push({
20
+ name: `cpu.idle${idx}`,
21
+ data: seriesData,
22
+ color: '#D8DAE5'
23
+ // lineDash: [4, 4],
24
+ });
25
+ }
26
+
27
+ return series;
28
+ }
29
+
30
+ const graphsCount = 2;
31
+ const charts = [];
32
+
33
+ for (let i = 0; i < graphsCount; i++) {
34
+ const id = `c${i}`;
35
+ const renderTo = document.createElement('div');
36
+ renderTo.id = id;
37
+ renderTo.style.width = '300px'
38
+ renderTo.style.height = '100px';
39
+ renderTo.style.margin = '50px';
40
+ // renderTo.style.border = '1px solid #ccc';
41
+ document.body.appendChild(renderTo);
42
+ const graph = new TsGraph({
43
+ type: 'lineAndArea',
44
+ timestamp: 'x',
45
+ xkey: 'timestamp',
46
+ ykey: 'value',
47
+ chart: {
48
+ renderTo: renderTo,
49
+ },
50
+ series: generateSeries(i + 1),
51
+ tooltip: {
52
+ precision: 'short',
53
+ shared: true,
54
+ },
55
+ line: {
56
+ width: 1,
57
+ },
58
+ xAxis: {
59
+ visible: false,
60
+ labels: {
61
+ timeFormat: '%Y:%m:%d %H:%M:%S'
62
+ },
63
+ ticks: [
64
+ // new Date(1617206399000),
65
+ // new Date(1625068799000),
66
+ // new Date(1633017599000),
67
+ new Date(1640966399000)
68
+ ],
69
+ },
70
+ yAxis: {
71
+ visible: false,
72
+ }
73
+ });
74
+
75
+ charts.push(graph);
76
+
77
+ graph.on('plotmove', (eventPosition) => {
78
+ charts.forEach((chart) => {
79
+ chart.showTooltip(eventPosition);
80
+ });
81
+ });
82
+
83
+ graph.on('plotleave', () => {
84
+ charts.forEach((chart) => {
85
+ chart.hideTooltip();
86
+ });
87
+ })
88
+
89
+ document.getElementById('destroyBtn').addEventListener('click', () => {
90
+ graph.destroy()
91
+ })
92
+ }
93
+
package/fetk.config.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ devEntry: {
3
+ index: './examples/index.js',
4
+ },
5
+ template: './examples/index.html',
6
+ eslintFix: true,
7
+ hmr: false,
8
+ port: 8002,
9
+ };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@fc-plot/ts-graph",
3
+ "version": "0.6.0",
4
+ "scripts": {
5
+ "commit": "npx git-cz",
6
+ "compile": "fetk run compile",
7
+ "dev": "npm run start",
8
+ "lint": "fetk run lint",
9
+ "start": "fetk run devServer",
10
+ "tsc": "tsc"
11
+ },
12
+ "main": "./dist/index.js",
13
+ "description": "a time series graph using D3.js",
14
+ "devDependencies": {
15
+ "@typescript-eslint/parser": "^5.7.0",
16
+ "babel-plugin-import": "^1.12.0",
17
+ "d3": "^4.10.0",
18
+ "eslint": "^5.3.0",
19
+ "eslint-config-airbnb": "^17.1.1",
20
+ "eslint-config-airbnb-typescript": "^16.1.0",
21
+ "eslint-plugin-import": "^2.18.2",
22
+ "eslint-plugin-jsx-a11y": "^6.2.3",
23
+ "eslint-plugin-react": "^7.14.3",
24
+ "fetk": "^0.1.0",
25
+ "lodash": "4.x",
26
+ "worker-loader": "^2.0.0"
27
+ },
28
+ "dependencies": {
29
+ "resize-detector": "^0.2.0"
30
+ },
31
+ "peerDependencies": {
32
+ "d3": "^4.10.0",
33
+ "lodash": "4.x"
34
+ }
35
+ }
@@ -0,0 +1,10 @@
1
+ declare module "lodash";
2
+
3
+ declare module 'd3';
4
+
5
+ declare module "worker-loader?*" {
6
+ class WebpackWorker extends Worker {
7
+ constructor();
8
+ }
9
+ export default WebpackWorker;
10
+ }
@@ -0,0 +1,139 @@
1
+ import { GetNearestPointsFnParam, Serie, SerieDataItem, NearestPoint } from './interface';
2
+
3
+ function getMsTs(ts: number, type: string) {
4
+ return type === 'X' ? ts * 1000 : ts;
5
+ }
6
+
7
+ function ascending(a: number | Date, b: number | Date): number {
8
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
9
+ }
10
+
11
+ function pickBy<T extends object>(obj: T, predicate: (key: keyof T) => boolean) {
12
+ const newObj: any = {};
13
+ for (const key in obj) {
14
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
15
+ if (Object.prototype.toString.call(predicate) === '[object Function]' && predicate(key)) {
16
+ newObj[key] = obj[key];
17
+ }
18
+ }
19
+ }
20
+ return newObj;
21
+ }
22
+
23
+ function bisector(compare: (d: SerieDataItem, x: Date) => number) {
24
+ return {
25
+ left: (a: any[], x: any, lo?: any, hi?: any) => {
26
+ if (lo == null) lo = 0;
27
+ if (hi == null) hi = a.length;
28
+ while (lo < hi) {
29
+ const mid = lo + hi >>> 1;
30
+ if (compare(a[mid], x) < 0) lo = mid + 1;
31
+ else hi = mid;
32
+ }
33
+ return lo;
34
+ },
35
+ right: (a: any[], x: any, lo?: any, hi?: any) => {
36
+ if (lo == null) lo = 0;
37
+ if (hi == null) hi = a.length;
38
+ while (lo < hi) {
39
+ const mid = lo + hi >>> 1;
40
+ if (compare(a[mid], x) > 0) hi = mid;
41
+ else lo = mid + 1;
42
+ }
43
+ return lo;
44
+ },
45
+ };
46
+ }
47
+
48
+ export default function getNearestPoints(dat: GetNearestPointsFnParam) {
49
+ const { series, x, xkey, ykey, timestamp, fillNull } = dat;
50
+ const xBisect = bisector(
51
+ (d, x) => {
52
+ return ascending(getMsTs(d[xkey], timestamp), x);
53
+ }
54
+ ).left;
55
+ const tsX = (new Date(x)).getTime();
56
+ const nearestPoints: NearestPoint[] = [];
57
+
58
+ if (Object.prototype.toString.call(series) !== '[object Array]') return [];
59
+ series.forEach((serie, i) => {
60
+ if (serie.visible === false) return;
61
+ const { name, color } = serie;
62
+ const serieWithEffective = pickBy<Serie>(serie, (key) => {
63
+ return key !== 'data';
64
+ });
65
+ let { data = [] } = serie;
66
+ if (Object.prototype.toString.call(data) !== '[object Array]') return;
67
+ data = data.filter(item => typeof item[ykey] === 'number' || typeof fillNull === 'number');
68
+
69
+ if (data.length === 0) return;
70
+
71
+ let nearestPoint: NearestPoint;
72
+ const pos = xBisect(data, x);
73
+ const smaller = data[pos - 1];
74
+ const larger = data[pos];
75
+
76
+ if (smaller && larger) {
77
+ const smallerX = getMsTs(smaller[xkey], timestamp);
78
+ const largerX = getMsTs(larger[xkey], timestamp);
79
+ let smallerY = smaller[ykey];
80
+ let largerY = larger[ykey];
81
+
82
+ if (smallerY === null && fillNull !== undefined) smallerY = fillNull;
83
+ if (largerY === null && fillNull !== undefined) largerY = fillNull;
84
+
85
+ if (tsX - smallerX < largerX - tsX) {
86
+ nearestPoint = {
87
+ ...smaller,
88
+ name,
89
+ color,
90
+ timestamp: smallerX,
91
+ value: smallerY,
92
+ serieIndex: i,
93
+ serieOptions: serieWithEffective,
94
+ };
95
+ } else {
96
+ nearestPoint = {
97
+ ...larger,
98
+ name,
99
+ color,
100
+ timestamp: largerX,
101
+ value: largerY,
102
+ serieIndex: i,
103
+ serieOptions: serieWithEffective,
104
+ };
105
+ }
106
+ nearestPoints.push(nearestPoint);
107
+ } else if (smaller) {
108
+ const smallerX = getMsTs(smaller[xkey], timestamp);
109
+ let smallerY = smaller[ykey];
110
+ if (smallerY === null && fillNull !== undefined) smallerY = fillNull;
111
+ nearestPoint = {
112
+ ...smaller,
113
+ name,
114
+ color,
115
+ timestamp: smallerX,
116
+ value: smallerY,
117
+ serieIndex: i,
118
+ serieOptions: serieWithEffective,
119
+ };
120
+ nearestPoints.push(nearestPoint);
121
+ } else if (larger) {
122
+ const largerX = getMsTs(larger[xkey], timestamp);
123
+ let largerY = larger[ykey];
124
+ if (largerY === null && fillNull !== undefined) largerY = fillNull;
125
+ nearestPoint = {
126
+ ...larger,
127
+ name,
128
+ color,
129
+ timestamp: largerX,
130
+ value: largerY,
131
+ serieIndex: i,
132
+ serieOptions: serieWithEffective,
133
+ };
134
+ nearestPoints.push(nearestPoint);
135
+ }
136
+ });
137
+
138
+ return nearestPoints;
139
+ }