jmgraph 3.2.7 → 3.2.9
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/README.md +0 -1
- package/build/npminstall-debug.log +199 -0
- package/dist/jmgraph.core.min.js +1 -1
- package/dist/jmgraph.core.min.js.map +1 -1
- package/dist/jmgraph.js +3631 -2076
- package/dist/jmgraph.min.js +1 -1
- package/example/ball.html +8 -14
- package/example/cell.html +1 -1
- package/example/controls/arc.html +10 -7
- package/example/controls/arrowline.html +1 -0
- package/example/controls/img.html +30 -23
- package/example/controls/label.html +6 -4
- package/example/controls/line.html +54 -51
- package/example/controls/resize.html +47 -10
- package/example/index.html +2 -1
- package/example/music.html +101 -82
- package/example/webgl.html +48 -25
- package/package.json +56 -56
- package/src/core/jmControl.js +214 -116
- package/src/core/jmEvents.js +2 -2
- package/src/core/jmGradient.js +5 -3
- package/src/core/jmGraph.js +12 -22
- package/src/core/jmPath.js +1 -17
- package/src/core/jmUtils.js +7 -1
- package/src/lib/webgl/base.js +253 -1
- package/src/lib/webgl/core/buffer.js +2 -1
- package/src/lib/webgl/core/program.js +2 -2
- package/src/lib/webgl/core/texture.js +8 -8
- package/src/lib/webgl/gradient.js +11 -38
- package/src/lib/webgl/path.js +118 -235
- package/src/shapes/jmImage.js +18 -3
- package/src/shapes/jmLabel.js +84 -38
- package/src/shapes/jmRect.js +5 -2
- package/src/shapes/jmResize.js +70 -16
- package/build/package-lock.json +0 -19282
- package/docs/_config.yml +0 -1
- package/docs/about.html +0 -41
- package/docs/api/jmGraph.md +0 -2302
- package/docs/css/index.css +0 -131
- package/docs/images/ball.gif +0 -0
- package/docs/images/bezier.gif +0 -0
- package/docs/images/cell.gif +0 -0
- package/docs/images/chart.gif +0 -0
- package/docs/images/editor.gif +0 -0
- package/docs/images/sort.gif +0 -0
- package/docs/index.html +0 -80
- package/docs/js/helper.js +0 -89
- package/docs/js/jquery.min.js +0 -6
- package/example/love/img/music/bg.mp3 +0 -0
- package/example/love/img/music/bg_2019130144035.mp3 +0 -0
- package/example/love/img/music/f.mp3 +0 -0
- package/example/love/img/music/fail.mp3 +0 -0
- package/example/love/img/music/s.mp3 +0 -0
- package/example/love/img/music/s_201913014415.mp3 +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@ jmGraph
|
|
|
9
9
|
|
|
10
10
|
- 主页:[https://jiamao.github.io/jmgraph/](https://jiamao.github.io/jmgraph/)
|
|
11
11
|
- 示例:[https://jiamao.github.io/jmgraph/example/index.html](https://jiamao.github.io/jmgraph/example/index.html)
|
|
12
|
-
- API: [https://github.com/jiamao/jmgraph/blob/master/api/jmGraph.md](https://github.com/jiamao/jmgraph/blob/master/api/jmGraph.md)
|
|
13
12
|
|
|
14
13
|
基于它的图表应用:[https://github.com/jiamao/jmchart](https://github.com/jiamao/jmchart)
|
|
15
14
|
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
root: 'F:\\code\\github\\jmgraph\\build',
|
|
3
|
+
registry: 'https://registry.npmmirror.com',
|
|
4
|
+
pkgs: [],
|
|
5
|
+
production: false,
|
|
6
|
+
cacheStrict: false,
|
|
7
|
+
cacheDir: 'C:\\Users\\jintengtech\\.npminstall_tarball',
|
|
8
|
+
env: {
|
|
9
|
+
npm_config_registry: 'https://registry.npmmirror.com',
|
|
10
|
+
npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\jintengtech\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","-g","gulp-core"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\jintengtech\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","-g","gulp-core"]}',
|
|
11
|
+
npm_config_user_agent: 'npminstall/7.12.0 npm/? node/v20.16.0 win32 x64',
|
|
12
|
+
npm_config_cache: 'C:\\Users\\jintengtech\\.npminstall_tarball',
|
|
13
|
+
NODE: 'D:\\nodejs\\node.exe',
|
|
14
|
+
npm_node_execpath: 'D:\\nodejs\\node.exe',
|
|
15
|
+
npm_execpath: 'D:\\nodejs\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
|
|
16
|
+
npm_config_userconfig: 'C:\\Users\\jintengtech\\.cnpmrc',
|
|
17
|
+
npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
|
|
18
|
+
npm_config_r: 'https://registry.npmmirror.com',
|
|
19
|
+
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
|
20
|
+
EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
|
|
21
|
+
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
|
22
|
+
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
|
23
|
+
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
|
24
|
+
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
|
25
|
+
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
|
26
|
+
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
|
27
|
+
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
|
28
|
+
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
|
29
|
+
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
|
30
|
+
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
|
31
|
+
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
|
32
|
+
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
|
33
|
+
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
|
34
|
+
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
|
35
|
+
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
|
36
|
+
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
|
37
|
+
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
|
38
|
+
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
|
39
|
+
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
|
40
|
+
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
|
41
|
+
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
|
42
|
+
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
|
43
|
+
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
|
44
|
+
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
|
|
45
|
+
npm_rootpath: 'F:\\code\\github\\jmgraph\\build',
|
|
46
|
+
INIT_CWD: 'F:\\code\\github\\jmgraph\\build'
|
|
47
|
+
},
|
|
48
|
+
binaryMirrors: {
|
|
49
|
+
ENVS: {
|
|
50
|
+
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
|
51
|
+
EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
|
|
52
|
+
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
|
53
|
+
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
|
54
|
+
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
|
55
|
+
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
|
56
|
+
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
|
57
|
+
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
|
58
|
+
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
|
59
|
+
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
|
60
|
+
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
|
61
|
+
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
|
62
|
+
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
|
63
|
+
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
|
64
|
+
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
|
65
|
+
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
|
66
|
+
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
|
67
|
+
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
|
68
|
+
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
|
69
|
+
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
|
70
|
+
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
|
71
|
+
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
|
72
|
+
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
|
73
|
+
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
|
74
|
+
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
|
75
|
+
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
|
|
76
|
+
},
|
|
77
|
+
'@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
|
|
78
|
+
sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
|
|
79
|
+
'@tensorflow/tfjs-node': {
|
|
80
|
+
replaceHostFiles: [Array],
|
|
81
|
+
replaceHostRegExpMap: [Object],
|
|
82
|
+
replaceHostMap: [Object]
|
|
83
|
+
},
|
|
84
|
+
cypress: {
|
|
85
|
+
host: 'https://cdn.npmmirror.com/binaries/cypress',
|
|
86
|
+
newPlatforms: [Object]
|
|
87
|
+
},
|
|
88
|
+
'utf-8-validate': {
|
|
89
|
+
host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
|
|
90
|
+
},
|
|
91
|
+
xprofiler: {
|
|
92
|
+
remote_path: './xprofiler/v{version}/',
|
|
93
|
+
host: 'https://cdn.npmmirror.com/binaries'
|
|
94
|
+
},
|
|
95
|
+
leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
|
|
96
|
+
couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
|
|
97
|
+
gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
|
|
98
|
+
sqlite3: {
|
|
99
|
+
host: 'https://cdn.npmmirror.com/binaries/sqlite3',
|
|
100
|
+
remote_path: 'v{version}'
|
|
101
|
+
},
|
|
102
|
+
'@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
|
|
103
|
+
grpc: {
|
|
104
|
+
host: 'https://cdn.npmmirror.com/binaries',
|
|
105
|
+
remote_path: '{name}/v{version}'
|
|
106
|
+
},
|
|
107
|
+
'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
|
|
108
|
+
wrtc: {
|
|
109
|
+
host: 'https://cdn.npmmirror.com/binaries',
|
|
110
|
+
remote_path: '{name}/v{version}'
|
|
111
|
+
},
|
|
112
|
+
fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
|
|
113
|
+
nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
|
|
114
|
+
canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
|
|
115
|
+
'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
|
|
116
|
+
'flow-bin': {
|
|
117
|
+
replaceHost: 'https://github.com/facebook/flow/releases/download/v',
|
|
118
|
+
host: 'https://cdn.npmmirror.com/binaries/flow/v'
|
|
119
|
+
},
|
|
120
|
+
'jpegtran-bin': {
|
|
121
|
+
replaceHost: [Array],
|
|
122
|
+
host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
|
|
123
|
+
},
|
|
124
|
+
'cwebp-bin': {
|
|
125
|
+
replaceHost: [Array],
|
|
126
|
+
host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
|
|
127
|
+
},
|
|
128
|
+
'zopflipng-bin': {
|
|
129
|
+
replaceHost: [Array],
|
|
130
|
+
host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
|
|
131
|
+
},
|
|
132
|
+
'optipng-bin': {
|
|
133
|
+
replaceHost: [Array],
|
|
134
|
+
host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
|
|
135
|
+
},
|
|
136
|
+
mozjpeg: {
|
|
137
|
+
replaceHost: [Array],
|
|
138
|
+
host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
|
|
139
|
+
},
|
|
140
|
+
gifsicle: {
|
|
141
|
+
replaceHost: [Array],
|
|
142
|
+
host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
|
|
143
|
+
},
|
|
144
|
+
'pngquant-bin': {
|
|
145
|
+
replaceHost: [Array],
|
|
146
|
+
host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
|
|
147
|
+
replaceHostMap: [Object]
|
|
148
|
+
},
|
|
149
|
+
'pngcrush-bin': {
|
|
150
|
+
replaceHost: [Array],
|
|
151
|
+
host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
|
|
152
|
+
},
|
|
153
|
+
'jpeg-recompress-bin': {
|
|
154
|
+
replaceHost: [Array],
|
|
155
|
+
host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
|
|
156
|
+
},
|
|
157
|
+
'advpng-bin': {
|
|
158
|
+
replaceHost: [Array],
|
|
159
|
+
host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
|
|
160
|
+
},
|
|
161
|
+
'pngout-bin': {
|
|
162
|
+
replaceHost: [Array],
|
|
163
|
+
host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
|
|
164
|
+
},
|
|
165
|
+
'jpegoptim-bin': {
|
|
166
|
+
replaceHost: [Array],
|
|
167
|
+
host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
|
|
168
|
+
},
|
|
169
|
+
argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
|
|
170
|
+
'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
|
|
171
|
+
'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
|
|
172
|
+
'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' },
|
|
173
|
+
'libpg-query': { host: 'https://cdn.npmmirror.com/binaries' }
|
|
174
|
+
},
|
|
175
|
+
forbiddenLicenses: null,
|
|
176
|
+
flatten: false,
|
|
177
|
+
proxy: undefined,
|
|
178
|
+
prune: false,
|
|
179
|
+
disableFallbackStore: false,
|
|
180
|
+
workspacesMap: Map(0) {},
|
|
181
|
+
enableWorkspace: false,
|
|
182
|
+
workspaceRoot: 'F:\\code\\github\\jmgraph\\build',
|
|
183
|
+
isWorkspaceRoot: true,
|
|
184
|
+
isWorkspacePackage: false,
|
|
185
|
+
offline: false,
|
|
186
|
+
strictSSL: true,
|
|
187
|
+
ignoreScripts: false,
|
|
188
|
+
foregroundScripts: false,
|
|
189
|
+
ignoreOptionalDependencies: false,
|
|
190
|
+
detail: true,
|
|
191
|
+
forceLinkLatest: false,
|
|
192
|
+
trace: false,
|
|
193
|
+
engineStrict: false,
|
|
194
|
+
registryOnly: false,
|
|
195
|
+
client: false,
|
|
196
|
+
autoFixVersion: [Function: autoFixVersion],
|
|
197
|
+
targetDir: null,
|
|
198
|
+
binDir: null
|
|
199
|
+
}
|
package/dist/jmgraph.core.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jmGraph={})}(this,function(t){"use strict";function e(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function n(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?e(Object(r),!0).forEach(function(t){var e,n;e=i,t=r[n=t],n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function a(t,e,n){return(a=s()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&o(i,n.prototype),i}).apply(null,arguments)}function f(t){var n="function"==typeof Map?new Map:void 0;return function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return a(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)}(t)}function d(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function v(n){var i=s();return function(){var t,e=r(n);return d(this,i?(t=r(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function p(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||y(t)||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.")}()}function y(t,e){if(t){if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function g(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,e=function(){};return{s:e,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e}}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,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}var b=function(){c(a,f(Array));var s=v(a);function a(){var t;h(this,a);for(var e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(i&&i.length&&Array.isArray(i[0])){for(var o=0;o<i[0].length;o++)e.push(i[0][o]);t=s.call.apply(s,[this].concat(e))}else t=s.call(this);return t.option={},t.type="jmList",d(t)}return u(a,[{key:"add",value:function(t){if(t&&Array.isArray(t)){for(var e=0;e<t.length;e++)this.includes(t[e])||this.push(t[e]);return t}return"object"==l(t)&&this.includes(t)||this.push(t),t}},{key:"remove",value:function(t){for(var e=this.length-1;0<=e;e--)this[e]==t&&this.removeAt(e)}},{key:"removeAt",value:function(t){var e;this.length>t&&(e=this[t],this.splice(t,1),this.option.removeHandler&&this.option.removeHandler.call(this,e,t))}},{key:"contain",value:function(t){return this.includes(t)}},{key:"get",value:function(t){return"function"==typeof t?this.find(t):this[t]}},{key:"each",value:function(t,e){if(t&&"function"==typeof t)if(e){for(var n=this.length-1;0<=n;n--)if(!1===t.call(this,n,this[n]))break}else for(var i=this.length,r=0;r<i;r++)if(!1===t.call(this,r,this[r]))break}},{key:"count",value:function(t){if(t&&"function"==typeof t){for(var e=0,n=this.length,i=0;i<n;i++)t(this[i])&&e++;return e}return this.length}},{key:"clear",value:function(){this.splice(0,this.length)}}]),a}(),x={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",transparent:"rgba(0,0,0,0)"},w=function(){function t(){h(this,t)}return u(t,null,[{key:"clone",value:function(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0;if("function"==typeof r){var s=r(t,i,o);if(s)return s}if("boolean"==typeof e&&(i=e,e=void 0),100<++o)return e;if(t&&"object"===l(t)){if(e=e||{},this.isType(t,b))return new b(t);if(Array.isArray(t)){if(i){for(var a=[],h=0;h<t.length;h++)a.push(this.clone(t[h],e[h],i,r,o));return a}return t.slice(0)}for(var u in t.__proto__&&(e.__proto__=t.__proto__),t)"constructor"!==u&&((n=t[u])&&(n.tagName||n.getContext)?e[u]=n:"object"!==l(e[u])&&void 0!==e[u]||(e[u]=this.clone(n,e[u],i,r,o)));return e}return void 0!==e?e:t}},{key:"bindEvent",value:function(t,e,n,i){if(e&&e.indexOf&&-1!=e.indexOf(" "))for(var r=e.split(" "),o=0;o<r.length;o++)this.bindEvent(t,r[o],n,i);return t.attachEvent?t.attachEvent("on"+e,n,i):t.addEventListener&&t.addEventListener(e,n,i),{name:e,target:t,fun:n}}},{key:"removeEvent",value:function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?(t.detachEvent("on"+e,n),!0):void(t["on"+e]=null)}},{key:"getElementPosition",value:function(t){var e={top:0,left:0};if(!t)return e;if(t.offsetParent)for(;t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft,t=t.offsetParent;else t.x?e.left+=t.x:t.x&&(e.top+=t.y);return e}},{key:"getEventPosition",value:function(t,e){var n=!1,i=(t=t||event).changedTouches||t.targetTouches||t.touches,r=t.target||t.srcElement;i&&i.length&&((t=i[0]).target||(t.target=r),n=!0);var o=t.pageX||t.x;void 0===o&&(o=t.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var s=t.pageY||t.y;void 0===s&&(s=t.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var a=t.offsetX,h=t.offsetY;return void 0===a&&void 0===h&&(a=o-(r=this.getElementPosition(r)).left,h=s-r.top),e&&(e.x&&(a/=e.x),e.y&&(h/=e.y)),{pageX:o,pageY:s,clientX:t.clientX,clientY:t.clientY,offsetX:a,offsetY:h,layerX:t.layerX,layerY:t.layerY,screenX:t.screenX,screenY:t.screenY,x:a,y:h,isTouch:n,touches:i}}},{key:"isType",value:function(t,e){return!(!t||"object"!==l(t))&&t.constructor===e}},{key:"pointInPolygon",value:function(t,e,n){n=n||1,n/=2;var i,r,o=e.length,s=!1,a=!0;if(!e||0==o)return 0;if(1==o)return Math.abs(e[0].x-t.x)<=n&&Math.abs(e[0].y-t.y)<=n;if(2==o){if(Math.min(e[0].x,e[1].x)-t.x>n||t.x-Math.max(e[0].x,e[1].x)>n)return 0;if(Math.min(e[0].y,e[1].y)-t.y>n||t.y-Math.max(e[0].y,e[1].y)>n)return 0;if(e[0].x==e[1].x)return Math.abs(e[0].x-t.x)<=n&&(t.y-e[0].y)*(t.y-e[1].y)<=0?1:0;if(e[0].y==e[1].y)return Math.abs(e[0].y-t.y)<=n&&(t.x-e[0].x)*(t.x-e[1].x)<=0?1:0;if(Math.abs(e[0].x-t.x)<n&&Math.abs(e[0].y-t.y)<n)return 1;if(Math.abs(e[1].x-t.x)<n&&Math.abs(e[1].y-t.y)<n)return 1;if(t.y==e[0].y||t.y==e[1].y)return 0;var h=(e[1].x-e[0].x)/(e[1].y-e[0].y)*(t.y-e[0].y),h=(t.y-e[0].y)/Math.sqrt(h*h+(t.y-e[0].y)*(t.y-e[0].y))*(t.x-e[0].x-h);return Math.abs(h)<=n?1:0}for(i=0;i<o;++i)if(e[i].x==t.x&&e[i].y==t.y)return 1;for(;a;)for(s=a=!1,i=0,r=o-1;i<o;r=i++)if(e[i].y<t.y&&t.y<e[r].y||e[r].y<t.y&&t.y<e[i].y){if(t.x<=e[i].x||t.x<=e[r].x){var u=(t.y-e[i].y)*(e[r].x-e[i].x)/(e[r].y-e[i].y)+e[i].x;if(t.x<u)s=!s;else if(t.x==u)return 1}}else if(t.y==e[i].y){if(t.x<e[i].x){e[i].y>e[r].y?--t.y:++t.y,a=!0;break}}else if(e[i].y==e[r].y&&t.y==e[i].y&&(e[i].x<t.x&&t.x<e[r].x||e[r].x<t.x&&t.x<e[i].x)){s=!0;break}return s?2:0}},{key:"checkOutSide",value:function(t,e,n){var i={left:0,right:0,top:0,bottom:0};return n.x<0?i.left=e.left+n.x-t.left:0<n.x&&(i.right=e.right+n.x-t.right),n.y<0?i.top=e.top+n.y-t.top:0<n.y&&(i.bottom=e.bottom+n.y-t.bottom),i}},{key:"rotatePoints",value:function(t,e,n){if(!n||!t)return t;var i=Math.cos(n),r=Math.sin(n);if(t.length)for(var o,s,a=0;a<t.length;a++)t[a]&&(o=t[a].x-e.x,s=t[a].y-e.y,t[a].x=o*i-s*r+e.x,t[a].y=o*r+s*i+e.y);else{var h=t.x-e.x,n=t.y-e.y;t.x=h*i-n*r+e.x,t.y=h*r+n*i+e.y}return t}},{key:"trimStart",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[0];if(n===e||0<=e.indexOf(n))return t=t.substring(1),this.trimStart(t,e)}return t}},{key:"trimEnd",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[t.length-1];if(n===e||0<=e.indexOf(n))return t=t.substring(0,t.length-1),this.trimStart(t,e)}return t}},{key:"trim",value:function(t,e){return this.trimEnd(this.trimStart(t,e),e)}},{key:"checkPercent",value:function(t){if("string"==typeof t&&"%"==(t=this.trim(t))[t.length-1])return t}},{key:"percentToNumber",value:function(t){var e;return"string"!=typeof t||(e=this.checkPercent(t))&&(t=this.trim(e,"% "),t/=100),t}},{key:"hexToNumber",value:function(t){if("string"!=typeof t)return t;for(var e=0,n=(t=t.toLowerCase()).length,i=0;i<n;i++){var r="0123456789abcdef".indexOf(t[i]);if(0!=r){for(var o=1;o<n-i;o++)r*=16;e+=r}}return e}},{key:"numberToHex",value:function(t){for(var e="";0<t;){e="0123456789abcdef"[t%16]+e;t=Math.floor(t/16)}return e}},{key:"hexToRGBA",value:function(t){if("string"!=typeof t)return t;if(t=this.trim(t),this.__hexToRGBA_Cache=this.__hexToRGBA_Cache||{},this.__hexToRGBA_Cache[t])return this.__hexToRGBA_Cache[t];var e,n=t;return"#"==(n=x[n]?x[n]:n)[0]&&(e={a:1},8<=n.length?(e.a=n.substr(1,2),e.g=n.substr(5,2),e.b=n.substr(7,2),e.r=n.substr(3,2),e.a=Number((this.hexToNumber(e.a)/255).toFixed(4)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),n=e):7===n.length||4===n.length?(4===n.length?(e.g=n.substr(2,1),e.g=e.g+e.g,e.b=n.substr(3,1),e.b=e.b+e.b,e.r=n.substr(1,1),e.r=e.r+e.r):(e.g=n.substr(3,2),e.b=n.substr(5,2),e.r=n.substr(1,2)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),n=e):5===n.length&&(e.a=n.substr(1,1),e.g=n.substr(3,1),e.b=n.substr(4,1),e.r=n.substr(2,1),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e.a=Number((this.hexToNumber(e.a)/255).toFixed(4)),n=e)),"string"!=typeof n||(e=n.match(/rgb(a)?\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)\s*,\s*([\d\.]+)\s*(,\s*[\d\.]+)?\s*\)/i))&&6===e.length&&(n={r:Number(e[2]),g:Number(e[3]),b:Number(e[4]),a:Number(this.trimStart(e[5]||"1",","))}),this.__hexToRGBA_Cache[t]=n}},{key:"rgbToDecimal",value:function(t){return(t=this.clone(t)).r=this.byteToDecimal(t.r),t.g=this.byteToDecimal(t.g),t.b=this.byteToDecimal(t.b),t}},{key:"byteToDecimal",value:function(t){return t/255}},{key:"toColor",value:function(t,e,n,i){if("string"==typeof t&&t){if("#"===(t=this.trim(t))[0]&&(4===t.length||7===t.length))return t;var r=this.hexToRGBA(t);if("string"==typeof r)return r;t=void 0!==r.r?r.r:t,e=void 0!==r.g?r.g:e,n=void 0!==r.b?r.b:n,i=void 0!==r.a?r.a:i}return void 0!==t&&void 0!==e&&void 0!==n?void 0!==i?"rgba("+t+","+e+","+n+","+i+")":"rgb("+t+","+e+","+n+")":t}},{key:"requestAnimationFrame",value:function(t,e){return(e&&e.requestAnimationFrame?e.requestAnimationFrame:"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:setTimeout)(t,20)}},{key:"cancelAnimationFrame",value:function(t,e){return(e&&e.cancelAnimationFrame?e.cancelAnimationFrame:"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout)(t)}}]),t}(),k=0,_=function(){function e(t){h(this,e),t&&"jmGraph"==t.type&&(this.graph=t),this.id=++k}return u(e,[{key:"is",value:function(t){return"string"==typeof t?this.type==t:this instanceof t}},{key:"animate",value:function(){if(this.is("jmGraph")){if(1<arguments.length){this.animateHandles||(this.animateHandles=new b);var t=[];if(2<arguments.length)for(var e=2;e<arguments.length;e++)t.push(e<0||arguments.length<=e?void 0:arguments[e]);this.animateHandles.add({millisec:(arguments.length<=1?void 0:arguments[1])||20,handle:arguments.length<=0?void 0:arguments[0],params:t})}var o;this.animateHandles&&0<this.animateHandles.count()&&((o=this).dispatcher=setTimeout(function(n){n=n||o;var t,i=[],r=(new Date).getTime();for(t in n.animateHandles.each(function(t,e){try{e&&e.handle&&(!e.times||r-e.times>=e.millisec)&&(!1===e.handle.apply(n,e.params)&&i.push(e),e.times=r)}catch(t){window.console&&window.console.info&&window.console.info(t.toString()),e&&i.push(e)}}),i)n.animateHandles.remove(i[t]);n.animate()},10,this))}else{var n=this.graph;n&&n.animate.apply(n,arguments)}}}]),e}(),E=Symbol("properties"),S=function(){c(i,_);var n=v(i);function i(t){var e;return h(this,i),(e=n.call(this))[E]={},t&&t.mode&&(e.mode=t.mode),e}return u(i,[{key:"property",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e){var i=this[E],r=e[0];if(1<e.length){var o=e[1],o={oldValue:i[r],newValue:o};return i[r]=e[1],this.emit&&this.emit("propertyChange",r,o),e[1]}if(r)return i[r]}}},{key:"needUpdate",get:function(){return this.property("needUpdate")},set:function(t){this.property("needUpdate",t),t&&!this.is("jmGraph")&&this.graph&&(this.graph.needUpdate=!0)}},{key:"graph",get:function(){return this.property("graph")||this.property("graph",this.findParent("jmGraph"))},set:function(t){return this.property("graph",t)}},{key:"mode",get:function(){var t=this.property("mode");return t||(this.is("jmGraph")?this.property("mode"):this.graph.mode)},set:function(t){return this.property("mode",t)}},{key:"requestAnimationFrame",value:function(t){return w.requestAnimationFrame(t,this.graph?this.graph.canvas:null)}},{key:"cancelAnimationFrame",value:function(t){return w.cancelAnimationFrame(t,this.graph?this.graph.canvas:null)}}]),i}(),A=function(){function r(t,e,n,i){h(this,r),"string"!=typeof t||e||n||i?(this.x=t,this.y=e,this.blur=n,this.color=i):this.fromString(t)}return u(r,[{key:"fromString",value:function(t){if(t){t=t.match(/\s*([^,]+)\s*,\s*([^,]+)\s*(,[^,]+)?\s*(,[\s\S]+)?\s*/i);return t&&(this.x=t[1]||0,this.y=t[2]||0,t[3]&&(t[3]=w.trim(t[3],", "),0===t[3].indexOf("#")||/^rgb/i.test(t[3])?this.color=t[3]:this.blur=w.trim(t[3],", ")),t[4]&&(this.color=w.trim(t[4],", "))),this}}},{key:"toString",value:function(){var t=this.x+","+this.y;return this.blur&&(t+=","+this.blur),this.color&&(t+=","+this.color),t}}]),r}(),N=function(){function i(t){if(h(this,i),this.stops=new b,t&&"object"==l(t)){for(var e in t)"stops"!==e&&(this[e]=t[e]);var n;t.stops&&Array.isArray(t.stops)&&(n=this.stops).push.apply(n,p(t.stops))}else"string"==typeof t&&this.fromString(t)}return u(i,[{key:"addStop",value:function(t,e){this.stops.add({offset:Number(t),color:e})}},{key:"toGradient",value:function(t){var i,e=t.context||t,n=t.absoluteBounds||t.getAbsoluteBounds(),r=this.x1||0,o=this.y1||0,s=this.x2,a=this.y2,h=t.getLocation(),u=0,u=(u=h.radius?2*h.radius:u)||Math.min(h.width,h.height);w.checkPercent(r)&&(r=w.percentToNumber(r)*(n.width||u)),w.checkPercent(s)&&(s=w.percentToNumber(s)*(n.width||u)),w.checkPercent(o)&&(o=w.percentToNumber(o)*(n.height||u)),w.checkPercent(a)&&(a=w.percentToNumber(a)*(n.height||u));var c=Number(r)+n.left,l=Number(o)+n.top,f=Number(s)+n.left,d=Number(a)+n.top;if("linear"===this.type?"webgl"===t.mode&&t.webglControl?i=t.webglControl.createLinearGradient(r,o,s,a,n):e.createLinearGradient&&(i=e.createLinearGradient(c,l,f,d)):"radial"===this.type&&(h=this.r1||0,v=this.r2,w.checkPercent(h)&&(h=w.percentToNumber(h),h*=u),w.checkPercent(v)&&(v=w.percentToNumber(v),v*=u),"webgl"===t.mode&&t.webglControl?i=t.webglControl.createRadialGradient(r,o,h,s,a,v,n):e.createRadialGradient?i=e.createRadialGradient(c,l,h,f,d,v):e.createCircularGradient&&(i=e.createCircularGradient(c,l,v))),i)return this.stops.each(function(t,e){var n=w.toColor(e.color);i&&i.addColorStop(e.offset,n)}),i;var v=this.stops.get(0);return v&&v.color||"#000"}},{key:"fromString",value:function(t){if(t){var e=t.match(/(linear|radial)-gradient\s*\(\s*([^,]+)\s*,\s*((.|\s)+)\)/i);if(e&&!(e.length<3)){this.type=e[1].toLowerCase();t=w.trim(e[2]).split(/\s+/);"linear"==this.type?t.length<=2?(this.x2=t[0],this.y2=t[1]||0):(this.x1=t[0],this.y1=t[1],this.x2=t[2],this.y2=t[3]):t.length<=3?(this.x2=t[0],this.y2=t[1]||0,this.r2=t[2]||0):(this.x1=t[0],this.y1=t[1],this.r1=t[2],this.x2=t[3],this.y2=t[3],this.r2=t[3]);var n=e[3].match(/((rgb(a)?\s*\([\d,\.\s]+\))|(#[a-zA-Z\d]+))\s+([\d\.]+)/gi);if(n&&n.length)for(var i=0;i<n.length;i++){var r,o=w.trim(n[i]),s=o.lastIndexOf(" ");-1<s&&(r=Number(o.substr(s+1)),s=w.trim(o.substr(0,s)),!isNaN(r)&&s&&this.addStop(r,s))}}}}},{key:"toString",value:function(){var n=this.type+"-gradient(";return"linear"==this.type?n+=this.x1.toFixed(2)+" "+this.y1.toFixed(2)+" "+this.x2.toFixed(2)+" "+this.y2.toFixed(2):n+=this.x1.toFixed(2)+" "+this.y1.toFixed(2)+" "+this.r1.toFixed(2)+" "+this.x2.toFixed(2)+" "+this.y2.toFixed(2)+" "+this.r2.toFixed(2),this.stops.each(function(t,e){n+=","+e.color+" "+e.offset.toFixed(2)}),n+")"}}]),i}(),P=function(){function n(t,e){h(this,n),this.container=t,this.target=e||t,this.mouseHandler=new T(this,t,e),this.keyHandler=new M(this,t,e)}return u(n,[{key:"touchStart",value:function(t){if((t=t||window.event).eventName="touchstart",this.container.raiseEvent("touchstart",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchMove",value:function(t){if((t=t||window.event).eventName="touchmove",this.container.raiseEvent("touchmove",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchEnd",value:function(t){if((t=t||window.event).eventName="touchend",this.container.raiseEvent("touchend",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchCancel",value:function(t){if((t=t||window.event).eventName="touchcancel",this.container.raiseEvent("touchcancel",t),(t.target||t.srcElement)==this.target)return!1}},{key:"destroy",value:function(){this.mouseHandler.destroy(),this.keyHandler.destroy()}}]),n}(),T=function(){function i(t,e,n){h(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(t,e,n)}return u(i,[{key:"init",value:function(e,n,t){var i=this.target,r="undefined"!=typeof document?document:null;this.eventEvents.mousedown=w.bindEvent(this.target,"mousedown",function(t){(t=t||window.event).eventName="mousedown",n.raiseEvent("mousedown",t)}),this.eventEvents.mousedown=w.bindEvent(this.target,"mousemove",function(t){if((t=t||window.event).eventName="mousemove",(t.target||t.srcElement)==i)return n.raiseEvent("mousemove",t),t.preventDefault&&t.preventDefault(),!1}),this.eventEvents.mousedown=w.bindEvent(this.target,"mouseover",function(t){(t=t||window.event).eventName="mouseover",n.raiseEvent("mouseover",t)}),this.eventEvents.mouseleave=w.bindEvent(this.target,"mouseleave",function(t){(t=t||window.event).eventName="mouseleave",n.raiseEvent("mouseleave",t)}),this.eventEvents.mouseout=w.bindEvent(this.target,"mouseout",function(t){(t=t||window.event).eventName="mouseout",n.raiseEvent("mouseout",t)}),r&&(this.eventEvents.mouseup=w.bindEvent(r,"mouseup",function(t){if(!((t=t||window.event).eventName="mouseup")===n.raiseEvent("mouseup",t))return t.preventDefault&&t.preventDefault(),!1})),this.eventEvents.dblclick=w.bindEvent(this.target,"dblclick",function(t){(t=t||window.event).eventName="dblclick",n.raiseEvent("dblclick",t)}),this.eventEvents.click=w.bindEvent(this.target,"click",function(t){(t=t||window.event).eventName="click",n.raiseEvent("click",t)}),r&&(this.eventEvents.resize=w.bindEvent(r,"resize",function(t){return(t=t||window.event).eventName="resize",n.raiseEvent("resize",t)})),this.eventEvents.touchstart=w.bindEvent(this.target,"touchstart",function(t){return t.eventName="touchstart",e.touchStart(t)},{passive:!1}),this.eventEvents.touchmove=w.bindEvent(this.target,"touchmove",function(t){return t.eventName="touchmove",e.touchMove(t)},{passive:!1}),r&&(this.eventEvents.touchend=w.bindEvent(r,"touchend",function(t){return t.eventName="touchend",e.touchEnd(t)},{passive:!1})),r&&(this.eventEvents.touchcancel=w.bindEvent(r,"touchcancel",function(t){return t.eventName="touchcancel",e.touchCancel(t)},{passive:!1}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&w.removeEvent(e.target,t,e.fun)}}}]),i}(),M=function(){function i(t,e,n){h(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(e,n)}return u(i,[{key:"init",value:function(n,t){function i(t){return!(t=t.srcElement||t.target)||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"ANCHOR"!=t.tagName&&"FORM"!=t.tagName&&"FILE"!=t.tagName&&"IMG"!=t.tagName&&"HIDDEN"!=t.tagName&&"RADIO"!=t.tagName&&"TEXT"!=t.tagName}var e="undefined"!=typeof document?document:null;e&&(this.eventEvents.keypress=w.bindEvent(e,"keypress",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keypress",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keydown=w.bindEvent(e,"keydown",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keydown",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keyup=w.bindEvent(e,"keyup",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keyup",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&w.removeEvent(e.target,t,e.fun)}}}]),i}(),O={fill:"fillStyle",fillImage:"fillImage",stroke:"strokeStyle","shadow.blur":"shadowBlur","shadow.x":"shadowOffsetX","shadow.y":"shadowOffsetY","shadow.color":"shadowColor",lineWidth:"lineWidth",miterLimit:"miterLimit",fillStyle:"fillStyle",strokeStyle:"strokeStyle",font:"font",opacity:"globalAlpha",textAlign:"textAlign",textBaseline:"textBaseline",shadowBlur:"shadowBlur",shadowOffsetX:"shadowOffsetX",shadowOffsetY:"shadowOffsetY",shadowColor:"shadowColor",lineJoin:"lineJoin",lineCap:"lineCap"},j=function(){c(r,S);var i=v(r);function r(t,e){var n;return h(this,r),(n=i.call(this,t=t||{})).property("type",e||(this instanceof r?this.constructor:void 0).name),n.style=t&&t.style?t.style:{},n.width=t.width||0,n.height=t.height||0,t.position&&(n.position=t.position),n.graph=t.graph||null,n.zIndex=t.zIndex||0,n.interactive=void 0===t.interactive||t.interactive,n.initializing(),n.on=n.bind,n.option=t,n}return u(r,[{key:"type",get:function(){return this.property("type")}},{key:"context",get:function(){var t=this.property("context");if(t)return t;if(this.is("jmGraph")&&this.canvas&&this.canvas.getContext)return this.context=this.canvas.getContext(this.mode||"2d");t=this.graph;return t?t.context:t.canvas.getContext(this.mode||"2d")},set:function(t){return this.property("context",t)}},{key:"style",get:function(){return this.property("style")||this.property("style",{})},set:function(t){return this.needUpdate=!0,this.property("style",t)}},{key:"visible",get:function(){var t=this.property("visible");return t=void 0===t?this.property("visible",!0):t},set:function(t){return this.needUpdate=!0,this.property("visible",t)}},{key:"interactive",get:function(){return this.property("interactive")},set:function(t){return this.property("interactive",t)}},{key:"children",get:function(){return this.property("children")||this.property("children",new b)},set:function(t){return this.needUpdate=!0,this.property("children",t)}},{key:"width",get:function(){var t=this.property("width");return t=void 0===t?this.property("width",0):t},set:function(t){return this.needUpdate=!0,this.property("width",t)}},{key:"height",get:function(){var t=this.property("height");return t=void 0===t?this.property("height",0):t},set:function(t){return this.needUpdate=!0,this.property("height",t)}},{key:"zIndex",get:function(){return this.property("zIndex")||this.property("zIndex",0)},set:function(t){return this.needUpdate=!0,this.property("zIndex",t),this.children.sort(),this.needUpdate=!0,t}},{key:"cursor",get:function(){var t=this.graph;if(t)return t.css("cursor")},set:function(t){var e=this.graph;e&&e.css("cursor",t)}},{key:"initializing",value:function(){var e=this;this.children=this.children||new b;var n=this.children.add;this.children.add=function(t){if("object"===l(t))return t.parent&&t.parent!=e&&t.parent.children&&t.parent.children.remove(t),t.parent=e,this.contain(t)&&this.oremove(t),n.call(this,t),t.emit("add",t),e.needUpdate=!0,e.graph&&(t.graph=e.graph),this.sort(),t},this.children.oremove=this.children.remove,this.children.remove=function(t){"object"===l(t)&&(t.parent=null,t.graph=null,t.remove(!0),this.oremove(t),e.needUpdate=!0)},this.children.sort=function(){var t,i={};for(t in this.each(function(t,e){var n;e&&(!(n=e.zIndex)&&e.style&&e.style.zIndex&&(n=Number(e.style.zIndex),isNaN(n)&&(n=e.style.zIndex||0)),(i[n]||(i[n]=[])).push(e))}),this.splice(0,this.length),i)n.call(this,i[t])},this.children.clear=function(){this.each(function(t,e){this.remove(e)},!0)},this.needUpdate=!0}},{key:"setStyle",value:function(t){var c=this;if(t=t||w.clone(this.style,!0)){var e,n,i=function t(e,n,i){if(e){if("function"==typeof(a=e))try{a=a.call(c)}catch(t){return void console.warn(t)}var r=l(a),i=O[i||n];if(a instanceof N||"string"==r&&-1<a.indexOf("-gradient"))t((a="string"==r&&-1<a.indexOf("-gradient")?new N(a):a).toGradient(c),i||n);else if(i)c.webglControl?("string"==r&&-1<["fillStyle","strokeStyle","shadowColor"].indexOf(i)&&(a=w.hexToRGBA(a)),c.webglControl.setStyle(i,a)):("string"==r&&-1<["fillStyle","strokeStyle","shadowColor"].indexOf(i)&&(a=w.toColor(a)),c.context[i]=a);else switch(n){case"shadow":if("string"==r){t(new A(a),n);break}for(var o in a)t(a[o],o,n+"."+o);break;case"translate":c.context.translate&&c.context.translate(a.x,a.y);break;case"rotation":if(!a.angle)break;var s,a,h=0,u=0;a.point&&(s=c.absoluteBounds||c.getAbsoluteBounds(),h=(a=c.getRotation(a)).rotateX+s.left,u=a.rotateY+s.top),0==h&&0==u||c.context.translate&&c.context.translate(h,u),c.context.rotate(a.angle),0==h&&0==u||c.context.translate&&c.context.translate(-h,-u);break;case"transform":Array.isArray(a)?c.context.transform.apply(c.context,a):"object"==l(a)&&c.context.transform(a.scaleX,a.skewX,a.skewY,a.scaleY,a.offsetX,a.offsetY);break;case"cursor":c.cursor=a}}};for(e in this.translate&&i(this.translate,"translate"),this.transform&&i(this.transform,"transform"),t)"constructor"!==e&&("string"==(n=l(t[e]))&&-1<t[e].indexOf("-gradient")?t[e]=new N(t[e]):"string"==n&&"shadow"==e&&(t[e]=new A(t[e])),i(t[e],e))}}},{key:"getBounds",value:function(t){if(this.bounds&&!t)return this.bounds;var e={};if("jmGraph"==this.type&&this.canvas)"function"==typeof this.canvas.width?e.right=this.canvas.width():this.width&&(e.right=this.width),"function"==typeof this.canvas.height?e.bottom=this.canvas.height():this.height&&(e.bottom=this.height);else if(this.points&&0<this.points.length)for(var n in this.points){n=this.points[n];(void 0===e.left||e.left>n.x)&&(e.left=n.x),(void 0===e.top||e.top>n.y)&&(e.top=n.y),(void 0===e.right||e.right<n.x)&&(e.right=n.x),(void 0===e.bottom||e.bottom<n.y)&&(e.bottom=n.y)}else!this.getLocation||(t=this.getLocation())&&(e.left=t.left,e.top=t.top,e.right=t.left+t.width,e.bottom=t.top+t.height);return e.left||(e.left=0),e.top||(e.top=0),e.right||(e.right=0),e.bottom||(e.bottom=0),e.width=e.right-e.left,e.height=e.bottom-e.top,this.bounds=e}},{key:"getLocation",value:function(){var t=this.location={left:0,top:0,width:0,height:0};t.position="function"==typeof this.position?this.position():w.clone(this.position),t.center=this.center&&"function"==typeof this.center?this.center():w.clone(this.center),t.start=this.start&&"function"==typeof this.start?this.start():w.clone(this.start),t.end=this.end&&"function"==typeof this.end?this.end():w.clone(this.end),t.radius=this.radius,t.width=this.width,t.height=this.height;var e=w.clone(this.style.margin,{});if(e.left=e.left||0,e.top=e.top||0,e.right=e.right||0,e.bottom=e.bottom||0,t.position?(t.left=t.position.x,t.top=t.position.y):(t.left=e.left,t.top=e.top),!this.parent)return t;e=this.parent.getBounds();return w.checkPercent(t.left)&&(t.left=w.percentToNumber(t.left)*e.width),w.checkPercent(t.top)&&(t.top=w.percentToNumber(t.top)*e.height),w.checkPercent(t.width)&&(t.width=w.percentToNumber(t.width)*e.width),w.checkPercent(t.height)&&(t.height=w.percentToNumber(t.height)*e.height),t.center&&(w.checkPercent(t.center.x)&&(t.center.x=w.percentToNumber(t.center.x)*e.width),w.checkPercent(t.center.y)&&(t.center.y=w.percentToNumber(t.center.y)*e.height)),t.radius&&w.checkPercent(t.radius)&&(t.radius=w.percentToNumber(t.radius)*Math.min(e.width,e.height)),t}},{key:"getRotation",value:function(t){var e;return(t=t||this.style.rotation)?(e=this.getBounds(),t.rotateX=t.point.x,w.checkPercent(t.rotateX)&&(t.rotateX=w.percentToNumber(t.rotateX)*e.width),t.rotateY=t.point.y,w.checkPercent(t.rotateY)&&(t.rotateY=w.percentToNumber(t.rotateY)*e.height)):(t=this.parent&&this.parent.getRotation?this.parent.getRotation():null)&&(e=this.getBounds(),t.rotateX-=e.left,t.rotateY-=e.top),t}},{key:"remove",value:function(){this.parent&&this.parent.children.remove(this)}},{key:"offset",value:function(t,e,n,i){n=!1!==n;var r=this.getLocation(!0),o=!1;if(r.position&&(r.left+=t,r.top+=e,this.position.x=r.left,this.position.y=r.top,o=!0),r.center&&(this.center.x=r.center.x+t,this.center.y=r.center.y+e,o=!0),r.start&&"object"==l(r.start)&&(this.start.x=r.start.x+t,this.start.y=r.start.y+e,o=!0),r.end&&"object"==l(r.end)&&(this.end.x=r.end.x+t,this.end.y=r.end.y+e,o=!0),0==o&&this.cpoints){var s=(this.cpoints,this.cpoints);if(s){for(var a=s.length,h=0;h<a;h++)s[h].x+=t,s[h].y+=e;o=!0}}if(0==o&&this.points){for(var u=this.points.length,c=0;c<u;c++)this.points[c].x+=t,this.points[c].y+=e;o=!0}this.emit("move",{offsetX:t,offsetY:e,trans:n,evt:i}),this.needUpdate=!0}},{key:"rotate",value:function(t,e){this.style.rotation={angle:t,point:e},this.needUpdate=!0}},{key:"getAbsoluteBounds",value:function(){var t=this.getBounds();if(this.parent&&this.parent.absoluteBounds){var e=this.parent.absoluteBounds||this.parent.getAbsoluteBounds();return{left:e.left+t.left,top:e.top+t.top,right:e.left+t.right,bottom:e.top+t.bottom,width:t.width,height:t.height}}return t}},{key:"beginDraw",value:function(){this.getLocation(!0),this.context.beginPath&&this.context.beginPath()}},{key:"endDraw",value:function(){this.style.close&&this.context.closePath&&this.context.closePath();var t=this.style.fill||this.style.fillStyle;t&&this.context.fill&&this.context.fill(),(this.style.stroke||!t&&!this.is("jmGraph"))&&this.context.stroke&&this.context.stroke(),this.needUpdate=!1}},{key:"draw",value:function(){if(this.points&&0<this.points.length){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(this.context&&this.context.moveTo){this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top);for(var e=this.points.length,n=1;n<e;n++){var i=this.points[n];i.m?this.context.moveTo(i.x+t.left,i.y+t.top):this.context.lineTo(i.x+t.left,i.y+t.top)}}}}},{key:"paint",value:function(t){!1!==t&&!1!==this.visible&&(this.initPoints&&this.initPoints(),this.bounds=null,this.absoluteBounds=this.getAbsoluteBounds(),t=!0,!this.is("jmGraph")&&this.graph&&(this.absoluteBounds.left>=this.graph.width||this.absoluteBounds.top>=this.graph.height||this.absoluteBounds.right<=0||this.absoluteBounds.bottom<=0)&&(t=!1),this.context.save&&this.context.save(),this.emit("beginDraw",this),this.setStyle(),t&&this.beginDraw&&this.beginDraw(),t&&this.draw&&this.draw(),t&&this.endDraw&&this.endDraw(),this.children&&this.children.each(function(t,e){e&&e.paint&&e.paint()}),this.emit("endDraw",this),this.context.restore&&this.context.restore(),this.needUpdate=!1)}},{key:"getEvent",value:function(t){return this.__events?this.__events[t]:null}},{key:"bind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=g(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.bind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t)||function(t,e){return this.__events||(this.__events={}),this.__events[t]=e}.call(this,t,new b);t.contain(e)||t.add(e)}}},{key:"unbind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=g(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.unbind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t);t&&(e?t.remove(e):t.clear())}}},{key:"emit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.runEventHandle(e[0],e.slice(1)),this}},{key:"runEventHandle",value:function(t,n){var i,t=this.getEvent(t);return t&&(i=this,Array.isArray(n)||(n=[n]),t.each(function(t,e){!1===e.apply(i,n)&&(n.cancel=!0)})),n.cancel}},{key:"checkPoint",value:function(t,e){if("jmGraph"==this.type){var n=this.getPosition(),i=n.left+this.width,r=n.top+this.height;return t.pageX>i||t.pageX<n.left?!1:!(t.pageY>r||t.pageY<n.top)}var r=this.getBounds(),n=this.getRotation(),o=this.points;if(o&&o.length||((o=[]).push({x:r.left,y:r.top}),o.push({x:r.right,y:r.top}),o.push({x:r.right,y:r.bottom}),o.push({x:r.left,y:r.bottom}),o.push({x:r.left,y:r.top})),e=Number(e||this.style.touchPadding||this.style.lineWidth||1),o&&o.length){if(n&&0!=n.angle&&(o=w.clone(o,!0),o=w.rotatePoints(o,{x:n.rotateX+r.left,y:n.rotateY+r.top},n.angle)),2<o.length&&(!this.style.fill||this.style.stroke)){for(var s=0,a=o.length,h=s+1;h<=a;h=++s+1)if(h==a){if(this.style.close)if(w.pointInPolygon(t,[o[s],o[0]],e))return!0}else if(w.pointInPolygon(t,[o[s],o[h]],e))return!0;if(!this.style.fill)return!1}return w.pointInPolygon(t,o,e)}return!(t.x>r.right||t.x<r.left)&&!(t.y>r.bottom||t.y<r.top)}},{key:"raiseEvent",value:function(n,i){if(!1!==this.visible){var t;i.position||(t=this.graph,e=i.srcElement||i.target,t=w.getEventPosition(i,t.scaleSize),i={position:t,button:0==i.button||t.isTouch?1:i.button,keyCode:i.keyCode||i.charCode||i.which,ctrlKey:i.ctrlKey,cancel:!1,event:i,srcElement:e}),i.path=i.path||[];var r=!1;if(this.children&&this.children.each(function(t,e){if(!0!==i.cancel&&(r=!1===e.raiseEvent(n,i)||r))return!1},!0),r)return!1;var e=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(!e)return!1;i.position.x=i.position.offsetX-e.left,i.position.y=i.position.offsetY-e.top;e=!1!==this.interactive&&this.checkPoint(i.position);return e?(i.target||(i.target=this),this.runEventAndPopEvent(n,i),this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!0,this.raiseEvent("mousemove"===n?"mouseover":"touchover",i))):!1===this.interactive||e||!this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!1,this.runEventHandle("mousemove"===n?"mouseleave":"touchleave",i)),!1===i.cancel}}},{key:"runEventAndPopEvent",value:function(t,e){!0!==e.cancel&&(e.path.push(this),this.runEventHandle(t,e))}},{key:"clearEvents",value:function(t){t=this.getEvent(t);t&&t.clear}},{key:"findParent",value:function(t){if("string"==typeof t){if(this.type==t)return this}else if(this.is(t))return this;return this.parent?this.parent.findParent(t):null}},{key:"canMove",value:function(t,e){var s;return this.__mvMonitor||(this.__mvMonitor={},this.__mvMonitor.mouseDown=!1,this.__mvMonitor.curposition={x:0,y:0},(s=this).__mvMonitor.mv=function(t){var e=s;if(e.__mvMonitor.mouseDown){e.parent.bounds=null;var n,i=e.parent.getAbsoluteBounds(),r=t.position.offsetX-e.__mvMonitor.curposition.x,o=t.position.offsetY-e.__mvMonitor.curposition.y;return e.lockSide&&(n=e.bounds||e.getAbsoluteBounds(),(n=w.checkOutSide(i,n,{x:r,y:o})).left<0?e.lockSide.left&&(r-=n.left):0<n.right&&e.lockSide.right&&(r-=n.right),n.top<0?e.lockSide.top&&(o-=n.top):0<n.bottom&&e.lockSide.bottom&&(o-=n.bottom)),(r||o)&&(e.offset(r,o,!0,t),e.__mvMonitor.curposition.x=t.position.offsetX,e.__mvMonitor.curposition.y=t.position.offsetY),!1}},this.__mvMonitor.mu=function(t){var e=s;e.__mvMonitor.mouseDown&&(e.__mvMonitor.mouseDown=!1,e.emit("moveend",{position:e.__mvMonitor.curposition}))},this.__mvMonitor.ml=function(){var t=s;if(t.__mvMonitor.mouseDown)return t.__mvMonitor.mouseDown=!1,t.emit("moveend",{position:t.__mvMonitor.curposition}),!1},this.__mvMonitor.md=function(t){if(!this.__mvMonitor.mouseDown)return 0==t.button||1==t.button?(this.__mvMonitor.mouseDown=!0,this.__mvMonitor.curposition.x=t.position.offsetX,this.__mvMonitor.curposition.y=t.position.offsetY,this.emit("movestart",{position:this.__mvMonitor.curposition}),!(t.cancel=!0)):void 0}),e=e||this.graph,!1!==t?(e.bind("mousemove",this.__mvMonitor.mv),e.bind("mouseup",this.__mvMonitor.mu),e.bind("mouseleave",this.__mvMonitor.ml),this.bind("mousedown",this.__mvMonitor.md),e.bind("touchmove",this.__mvMonitor.mv),e.bind("touchend",this.__mvMonitor.mu),this.bind("touchstart",this.__mvMonitor.md)):(e.unbind("mousemove",this.__mvMonitor.mv),e.unbind("mouseup",this.__mvMonitor.mu),e.unbind("mouseleave",this.__mvMonitor.ml),this.unbind("mousedown",this.__mvMonitor.md),e.unbind("touchmove",this.__mvMonitor.mv),e.unbind("touchend",this.__mvMonitor.mu),this.unbind("touchstart",this.__mvMonitor.md)),this}}]),r}(),z=function(){c(i,j);var n=v(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPath";return h(this,i),(e=n.call(this,t,e)).points=t&&t.points?t.points:[],e.polygonIndices=t&&t.polygonIndices?t.polygonIndices:[],e}return u(i,[{key:"points",get:function(){return this.property("points")},set:function(t){return this.needUpdate=!0,this.property("points",t)}},{key:"polygonIndices",get:function(){return this.property("polygonIndices")},set:function(t){return this.needUpdate=!0,this.property("polygonIndices",t)}}]),i}(),R=function(){c(s,j);var o=v(s);function s(t,e,n){var i,r;return h(this,s),"function"==typeof e&&(n=e,e={}),(e=e||{}).mode="2d",e.interactive=!0,e.isRegular=!0,(i=o.call(this,e,"jmGraph")).option=e||{},i.devicePixelRatio=1,i.util=i.utils=w,i.mode=e.mode,"undefined"!=typeof wx&&wx.canIUse&&wx.canIUse("canvas")?("string"==typeof t&&(t=wx.createSelectorQuery().select("#"+t)),i.isWXMiniApp=!0,i.container=t):("string"==typeof t&&"undefined"!=typeof document?t=document.getElementById(t):t.length&&(t=t[0]),t.getContext||"undefined"==typeof document?i.container=t.parentElement:(i.container=t,r=document.createElement("canvas"),t.appendChild(r),r.width=t.offsetWidth||t.clientWidth,r.height=t.offsetHeight||t.clientHeight,t=r)),i.canvas=t,i.context=t.getContext(i.mode),i.textureCanvas=e.textureCanvas||null,"webgl"===i.mode&&(i.context.enable(i.context.BLEND),i.context.blendFunc(i.context.SRC_ALPHA,i.context.ONE_MINUS_SRC_ALPHA),w.bindEvent(t,"webglcontextlost",function(t){console.log("canvas webglcontextlost",t),i.emit("webglcontextlost",t)}),w.bindEvent(t,"webglcontextrestored",function(t){console.log("canvas webglcontextrestored",t),i.emit("webglcontextrestored",t)})),i.__init(n),i}return u(s,[{key:"__init",value:function(t){this.shapes=Object.assign({path:z},this.option.shapes),this.on("beginDraw",function(){this.context.translate&&this.context.translate(.5,.5)}),this.on("endDraw",function(){this.context.translate&&this.context.translate(-.5,-.5)});var e="undefined"!=typeof window&&1<window.devicePixelRatio?window.devicePixelRatio:1;this.isWXMiniApp&&(e=wx.getSystemInfoSync().pixelRatio||1),this.devicePixelRatio=e,this.dprScaleSize=1<this.devicePixelRatio?this.devicePixelRatio:2,0<this.option.width&&(this.width=this.option.width),0<this.option.height&&(this.height=this.option.height),this.resize(),this.eventHandler=new P(this,this.canvas.canvas||this.canvas),this.option.autoRefresh&&this.autoRefresh(),t&&t(this)}},{key:"resize",value:function(t,e){this.canvas&&(this.__normalSize=this.__normalSize||{width:0,height:0},t=t||this.__normalSize.width||this.width,e=e||this.__normalSize.height||this.height,t&&(this.__normalSize.width=t),e&&(this.__normalSize.height=e),this.css("width",t+"px"),this.css("height",e+"px"),"2d"===this.mode?(this.canvas.height=e*this.dprScaleSize,this.canvas.width=t*this.dprScaleSize,1!==this.dprScaleSize&&this.context.scale&&this.context.scale(this.dprScaleSize,this.dprScaleSize)):(this.canvas.width=t,this.canvas.height=e),this.context.viewport&&this.context.viewport(0,0,t,e))}},{key:"pointToPixes",value:function(t){return t=this.dprScaleSize&&1!==this.dprScaleSize?Object.assign({},t,{x:t.x/this.dprScaleSize,y:t.y/this.dprScaleSize}):t}},{key:"width",get:function(){return this.__normalSize&&this.__normalSize.width?this.__normalSize.width:this.canvas?this.canvas.width:0},set:function(t){return this.needUpdate=!0,this.canvas&&this.resize(t),t}},{key:"height",get:function(){return this.__normalSize&&this.__normalSize.height?this.__normalSize.height:this.canvas?this.canvas.height:0},set:function(t){return this.needUpdate=!0,this.canvas&&this.resize(0,t),t}},{key:"getPosition",value:function(){var t=w.getElementPosition(this.canvas.canvas||this.canvas);return t.width=this.width,t.height=this.height,t.right=t.left+t.width,t.bottom=t.top+t.height,t}},{key:"registerShape",value:function(t,e){this.shapes[t]=e}},{key:"createShape",value:function(t,e){if(t="string"==typeof t?this.shapes[t]:t)return(e=e||{}).graph=this,new t(e)}},{key:"createShadow",value:function(t,e,n,i){return new A(t,e,n,i)}},{key:"createLinearGradient",value:function(t,e,n,i){return new N({type:"linear",x1:t,y1:e,x2:n,y2:i,stops:4<arguments.length&&void 0!==arguments[4]?arguments[4]:[]})}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return new N({type:"radial",x1:t,y1:e,r1:n,x2:i,y2:r,r2:o,stops:6<arguments.length&&void 0!==arguments[6]?arguments[6]:[]})}},{key:"refresh",value:function(){this.redraw()}},{key:"redraw",value:function(t,e){this.clear(t||this.width,e||this.height),this.paint()}},{key:"clear",value:function(t,e){t&&e||(t=this.width,e=this.height),this.context.clearRect?(this.style&&this.style.fill&&(this.points=[{x:0,y:0},{x:t,y:0},{x:t,y:e},{x:0,y:e}],this.style.close=!0),this.context.clearRect(0,0,t,e)):"webgl"===this.mode&&this.context.clear&&(e=this.style&&this.style.fill?this.utils.hexToRGBA(this.style.fill):{r:0,g:0,b:0,a:0},this.context.clearColor(e.r,e.g,e.b,e.a),this.context.clear(this.context.COLOR_BUFFER_BIT))}},{key:"css",value:function(t,e){if(this.canvas&&this.canvas.style)return void 0!==e&&(this.canvas.style[t]=e),this.canvas.style[t]}},{key:"createPath",value:function(t,e){return this.createShape("path",n({points:t,style:e},2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}))}},{key:"createLine",value:function(t,e,n){return this.createShape("line",{start:t,end:e,style:n})}},{key:"zoomOut",value:function(){this.scale(.9,.9)}},{key:"zoomIn",value:function(){this.scale(1.1,1.1)}},{key:"zoomActual",value:function(){this.scaleSize?this.scale(1/this.scaleSize.x,1/this.scaleSize.y):this.scale(1,1)}},{key:"scale",value:function(t,e){this.normalSize||(this.normalSize={width:this.canvas.width,height:this.canvas.height}),this.context.scale(t,e),this.scaleSize?this.scaleSize={x:t*this.scaleSize.x,y:e*this.scaleSize.y}:this.scaleSize={x:t,y:e},this.refresh()}},{key:"toDataURL",value:function(){return this.canvas.toDataURL?this.canvas.toDataURL():""}},{key:"autoRefresh",value:function(e){if(!this.___isAutoRefreshing){var n=this;return this.___isAutoRefreshing=!0,n.__requestAnimationFrameFunHandler&&this.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=this.requestAnimationFrame(function t(){n.destroyed?n.___isAutoRefreshing=!1:(n.needUpdate&&n.redraw(),n.emit("update"),n.__requestAnimationFrameFunHandler&&n.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=n.requestAnimationFrame(t),e&&e())}),this}}},{key:"destroy",value:function(){this.eventHandler.destroy(),this.destroyed=!0}}],[{key:"create",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return a(s,e)}}]),s}();t.default=R,t.jmControl=j,t.jmEvents=P,t.jmGradient=N,t.jmGraph=R,t.jmList=b,t.jmPath=z,t.jmProperty=S,t.jmShadow=A,t.jmUtils=w,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jmGraph={})})(this,function(t){function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e,n){e=o(e);var i=t,e=s()?Reflect.construct(e,n||[],o(t).constructor):e.apply(t,n);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return a(i)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e,n){var i;return s()?Reflect.construct.apply(null,arguments):((i=[null]).push.apply(i,e),e=new(t.bind.apply(t,i)),n&&v(e,n.prototype),e)}function I(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,z(i.key),i)}}function e(t,e,n){return e&&I(t.prototype,e),n&&I(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){var n,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return r=!(i=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return i=t.done,t},e:function(t){r=!0,n=t},f:function(){try{i||null==s.return||s.return()}finally{if(r)throw n}}};if(Array.isArray(t)||(s=F(t))||e&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:e=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function L(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function f(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach(function(t){var e,n;e=i,n=r[t=t],(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){return(t=>{if(Array.isArray(t))return i(t)})(t)||(t=>{if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)})(t)||F(t)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function z(t){t=((t,e)=>{if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=typeof(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==typeof t?t:t+""}function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,e){var n;if(t)return"string"==typeof t?i(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}function j(t){var n="function"==typeof Map?new Map:void 0;return function(t){if(null===t||!(e=>{try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}})(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return r(t,arguments,o(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),v(e,t)}(t)}var p=(()=>{function s(){l(this,s);for(var t,e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(i&&i.length&&Array.isArray(i[0])){for(var o=0;o<i[0].length;o++)e.push(i[0][o]);t=h(this,s,[].concat(e))}else t=h(this,s);return t.option={},t.type="jmList",a(t)}return c(s,j(Array)),e(s,[{key:"add",value:function(t){if(t&&Array.isArray(t))for(var e=0;e<t.length;e++)this.includes(t[e])||this.push(t[e]);else"object"==y(t)&&this.includes(t)||this.push(t);return t}},{key:"remove",value:function(t){for(var e=this.length-1;0<=e;e--)this[e]==t&&this.removeAt(e)}},{key:"removeAt",value:function(t){var e;this.length>t&&(e=this[t],this.splice(t,1),this.option.removeHandler)&&this.option.removeHandler.call(this,e,t)}},{key:"contain",value:function(t){return this.includes(t)}},{key:"get",value:function(t){return"function"==typeof t?this.find(t):this[t]}},{key:"each",value:function(t,e){if(t&&"function"==typeof t)if(e){for(var n=this.length-1;0<=n;n--)if(!1===t.call(this,n,this[n]))break}else for(var i=this.length,r=0;r<i;r++)if(!1===t.call(this,r,this[r]))break}},{key:"count",value:function(t){if(t&&"function"==typeof t){for(var e=0,n=this.length,i=0;i<n;i++)t(this[i])&&e++;return e}return this.length}},{key:"clear",value:function(){this.splice(0,this.length)}}])})(),U={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",transparent:"rgba(0,0,0,0)"},g=(()=>e(function t(){l(this,t)},null,[{key:"clone",value:function(t,e){var n,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0;if("function"==typeof r){var s=r(t,i,o);if(s)return s}if("boolean"==typeof e&&(i=e,e=void 0),100<++o)return e;if(t&&"object"===y(t)){if(e=e||{},this.isType(t,p))return new p(t);if(Array.isArray(t)){if(i){for(var a=[],h=0;h<t.length;h++)a.push(this.clone(t[h],e[h],i,r,o));return a}return t.slice(0)}for(var l in t.__proto__&&(e.__proto__=t.__proto__),t)"constructor"!==l&&((n=t[l])&&(n.tagName||n.getContext)?e[l]=n:"object"!==y(e[l])&&void 0!==e[l]||(e[l]=this.clone(n,e[l],i,r,o)));return e}return void 0!==e?e:t}},{key:"bindEvent",value:function(t,e,n,i){if(e&&e.indexOf&&-1!=e.indexOf(" "))for(var r=e.split(" "),o=0;o<r.length;o++)this.bindEvent(t,r[o],n,i);return t.attachEvent?t.attachEvent("on"+e,n,i):t.addEventListener&&t.addEventListener(e,n,i),{name:e,target:t,fun:n}}},{key:"removeEvent",value:function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?(t.detachEvent("on"+e,n),!0):void(t["on"+e]=null)}},{key:"getElementPosition",value:function(t){var e={top:0,left:0};if(t)if(t.offsetParent)for(;t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft,t=t.offsetParent;else t.x&&(e.left+=t.x);return e}},{key:"getEventPosition",value:function(t,e){var n=!1,i=(t=t||event).changedTouches||t.targetTouches||t.touches,r=t.target||t.srcElement,o=(i&&i.length&&((t=i[0]).target||(t.target=r),n=!0),t.pageX||t.x),s=(void 0===o&&(o=t.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),t.pageY||t.y),a=(void 0===s&&(s=t.clientY+(document.documentElement.scrollTop||document.body.scrollTop)),t.offsetX),h=t.offsetY;return void 0===a&&void 0===h&&(a=o-(r=this.getElementPosition(r)).left,h=s-r.top),e&&(e.x&&(a/=e.x),e.y)&&(h/=e.y),{pageX:o,pageY:s,clientX:t.clientX,clientY:t.clientY,offsetX:a,offsetY:h,layerX:t.layerX,layerY:t.layerY,screenX:t.screenX,screenY:t.screenY,x:a,y:h,isTouch:n,touches:i}}},{key:"isType",value:function(t,e){return!(!t||"object"!==y(t))&&t.constructor===e}},{key:"pointInPolygon",value:function(t,e,n){n=n||1,n/=2;var i,r,o,s=e.length,a=!1,h=!0;if(!e||0==s)return 0;if(1==s)return Math.abs(e[0].x-t.x)<=n&&Math.abs(e[0].y-t.y)<=n;if(2==s)return Math.min(e[0].x,e[1].x)-t.x>n||t.x-Math.max(e[0].x,e[1].x)>n||Math.min(e[0].y,e[1].y)-t.y>n||t.y-Math.max(e[0].y,e[1].y)>n?0:e[0].x==e[1].x?Math.abs(e[0].x-t.x)<=n&&(t.y-e[0].y)*(t.y-e[1].y)<=0?1:0:e[0].y==e[1].y?Math.abs(e[0].y-t.y)<=n&&(t.x-e[0].x)*(t.x-e[1].x)<=0?1:0:Math.abs(e[0].x-t.x)<n&&Math.abs(e[0].y-t.y)<n||Math.abs(e[1].x-t.x)<n&&Math.abs(e[1].y-t.y)<n||t.y!=e[0].y&&t.y!=e[1].y&&(o=(e[1].x-e[0].x)/(e[1].y-e[0].y)*(t.y-e[0].y),o=(t.y-e[0].y)/Math.sqrt(o*o+(t.y-e[0].y)*(t.y-e[0].y))*(t.x-e[0].x-o),Math.abs(o)<=n)?1:0;for(i=0;i<s;++i)if(e[i].x==t.x&&e[i].y==t.y)return 1;for(;h;)for(a=h=!1,i=0,r=s-1;i<s;r=i++)if(e[i].y<t.y&&t.y<e[r].y||e[r].y<t.y&&t.y<e[i].y){if(t.x<=e[i].x||t.x<=e[r].x){var l=(t.y-e[i].y)*(e[r].x-e[i].x)/(e[r].y-e[i].y)+e[i].x;if(t.x<l)a=!a;else if(t.x==l)return 1}}else if(t.y==e[i].y){if(t.x<e[i].x){e[i].y>e[r].y?--t.y:++t.y,h=!0;break}}else if(e[i].y==e[r].y&&t.y==e[i].y&&(e[i].x<t.x&&t.x<e[r].x||e[r].x<t.x&&t.x<e[i].x)){a=!0;break}return a?2:0}},{key:"checkOutSide",value:function(t,e,n){var i={left:0,right:0,top:0,bottom:0};return n.x<0?i.left=e.left+n.x-t.left:0<n.x&&(i.right=e.right+n.x-t.right),n.y<0?i.top=e.top+n.y-t.top:0<n.y&&(i.bottom=e.bottom+n.y-t.bottom),i}},{key:"rotatePoints",value:function(t,e,n){if(n&&t){var i=Math.cos(n),r=Math.sin(n);if(Array.isArray(t))for(var o,s,a=0;a<t.length;a++)t[a]&&(o=t[a].x-e.x,s=t[a].y-e.y,t[a].x=o*i-s*r+e.x,t[a].y=o*r+s*i+e.y);else{var n=t.x-e.x,h=t.y-e.y;t.x=n*i-h*r+e.x,t.y=n*r+h*i+e.y}}return t}},{key:"trimStart",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[0];if(n===e||0<=e.indexOf(n))return t=t.substring(1),this.trimStart(t,e)}return t}},{key:"trimEnd",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[t.length-1];if(n===e||0<=e.indexOf(n))return t=t.substring(0,t.length-1),this.trimStart(t,e)}return t}},{key:"trim",value:function(t,e){return this.trimEnd(this.trimStart(t,e),e)}},{key:"checkPercent",value:function(t){if("string"==typeof t&&"%"==(t=this.trim(t))[t.length-1])return t}},{key:"percentToNumber",value:function(t){var e;return"string"==typeof t&&(e=this.checkPercent(t))&&(t=this.trim(e,"% "),t/=100),t}},{key:"hexToNumber",value:function(t){if("string"!=typeof t)return t;for(var e=0,n=(t=t.toLowerCase()).length,i=0;i<n;i++){var r="0123456789abcdef".indexOf(t[i]);if(0!=r){for(var o=1;o<n-i;o++)r*=16;e+=r}}return e}},{key:"numberToHex",value:function(t){for(var e="";0<t;){e="0123456789abcdef"[t%16]+e;t=Math.floor(t/16)}return e}},{key:"hexToRGBA",value:function(t){var e,n;return"string"!=typeof t?t:(t=this.trim(t),this.__hexToRGBA_Cache=this.__hexToRGBA_Cache||{},this.__hexToRGBA_Cache[t]||("#"==(n=U[n=t]?U[n]:n)[0]&&(e={a:1},8<=n.length?(e.a=n.substr(1,2),e.g=n.substr(5,2),e.b=n.substr(7,2),e.r=n.substr(3,2),e.a=Number((this.hexToNumber(e.a)/255).toFixed(4)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),n=e):7===n.length||4===n.length?(4===n.length?(e.g=n.substr(2,1),e.g=e.g+e.g,e.b=n.substr(3,1),e.b=e.b+e.b,e.r=n.substr(1,1),e.r=e.r+e.r):(e.g=n.substr(3,2),e.b=n.substr(5,2),e.r=n.substr(1,2)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),n=e):5===n.length&&(e.a=n.substr(1,1),e.g=n.substr(3,1),e.b=n.substr(4,1),e.r=n.substr(2,1),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e.a=Number((this.hexToNumber(e.a)/255).toFixed(4)),n=e)),"string"==typeof n&&(e=n.match(/rgb(a)?\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)\s*,\s*([\d\.]+)\s*(,\s*[\d\.]+)?\s*\)/i))&&6===e.length&&(n={r:Number(e[2]),g:Number(e[3]),b:Number(e[4]),a:Number(this.trimStart(e[5]||"1",","))}),this.__hexToRGBA_Cache[t]=n))}},{key:"rgbToDecimal",value:function(t){return(t=this.clone(t)).r=this.byteToDecimal(t.r),t.g=this.byteToDecimal(t.g),t.b=this.byteToDecimal(t.b),t}},{key:"byteToDecimal",value:function(t){return t/255}},{key:"toColor",value:function(t,e,n,i){if("string"==typeof t&&t){if("#"===(t=this.trim(t))[0]&&(4===t.length||7===t.length))return t;var r=this.hexToRGBA(t);if("string"==typeof r)return r;t=void 0!==r.r?r.r:t,e=void 0!==r.g?r.g:e,n=void 0!==r.b?r.b:n,i=void 0!==r.a?r.a:i}return t&&"object"===y(t)&&(e=t.g,n=t.b,i=t.a||1,t=t.r),void 0!==t&&void 0!==e&&void 0!==n?void 0!==i?"rgba("+t+","+e+","+n+","+i+")":"rgb("+t+","+e+","+n+")":t}},{key:"requestAnimationFrame",value:function(t,e){return(e&&e.requestAnimationFrame?e.requestAnimationFrame:"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:setTimeout)(t,20)}},{key:"cancelAnimationFrame",value:function(t,e){return(e&&e.cancelAnimationFrame?e.cancelAnimationFrame:"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout)(t)}}]))(),G=0,q=(()=>e(function t(e){l(this,t),e&&"jmGraph"==e.type&&(this.graph=e),this.id=++G},[{key:"is",value:function(t){return"string"==typeof t?this.type==t:this instanceof t}},{key:"animate",value:function(){if(this.is("jmGraph")){if(1<arguments.length){this.animateHandles||(this.animateHandles=new p);var t=[];if(2<arguments.length)for(var e=2;e<arguments.length;e++)t.push(e<0||arguments.length<=e?void 0:arguments[e]);this.animateHandles.add({millisec:(arguments.length<=1?void 0:arguments[1])||20,handle:arguments.length<=0?void 0:arguments[0],params:t})}var o;this.animateHandles&&0<this.animateHandles.count()&&((o=this).dispatcher=setTimeout(function(n){n=n||o;var t,i=[],r=(new Date).getTime();for(t in n.animateHandles.each(function(t,e){try{e&&e.handle&&(!e.times||r-e.times>=e.millisec)&&(!1===e.handle.apply(n,e.params)&&i.push(e),e.times=r)}catch(t){window.console&&window.console.info&&window.console.info(t.toString()),e&&i.push(e)}}),i)n.animateHandles.remove(i[t]);n.animate()},10,this))}else{var n=this.graph;n&&n.animate.apply(n,arguments)}}}]))(),X=Symbol("properties"),H=(()=>{function n(t){var e;return l(this,n),(e=h(this,n))[X]={},t&&t.mode&&(e.mode=t.mode),e}return c(n,q),e(n,[{key:"property",value:function(){for(var t,e,n,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];if(r)return t=this[X],e=r[0],1<r.length?(n=r[1],n={oldValue:t[e],newValue:n},t[e]=r[1],this.emit&&this.emit("propertyChange",e,n),r[1]):e?t[e]:void 0}},{key:"needUpdate",get:function(){return this.property("needUpdate")},set:function(t){this.property("needUpdate",t),t&&!this.is("jmGraph")&&this.graph&&(this.graph.needUpdate=!0)}},{key:"graph",get:function(){return this.property("graph")||this.property("graph",this.findParent("jmGraph"))},set:function(t){return this.property("graph",t)}},{key:"mode",get:function(){var t=this.property("mode");return t||(this.is("jmGraph")?this.property("mode"):this.graph.mode)},set:function(t){return this.property("mode",t)}},{key:"requestAnimationFrame",value:function(t){return g.requestAnimationFrame(t,this.graph?this.graph.canvas:null)}},{key:"cancelAnimationFrame",value:function(t){return g.cancelAnimationFrame(t,this.graph?this.graph.canvas:null)}}])})(),m=(()=>e(function t(e,n,i,r){l(this,t),"string"!=typeof e||n||i||r?(this.x=e,this.y=n,this.blur=i,this.color=r):this.fromString(e)},[{key:"fromString",value:function(t){if(t)return(t=t.match(/\s*([^,]+)\s*,\s*([^,]+)\s*(,[^,]+)?\s*(,[\s\S]+)?\s*/i))&&(this.x=t[1]||0,this.y=t[2]||0,t[3]&&(t[3]=g.trim(t[3],", "),0===t[3].indexOf("#")||/^rgb/i.test(t[3])?this.color=t[3]:this.blur=g.trim(t[3],", ")),t[4])&&(this.color=g.trim(t[4],", ")),this}},{key:"toString",value:function(){var t=this.x+","+this.y;return this.blur&&(t+=","+this.blur),this.color&&(t+=","+this.color),t}}]))(),x=(()=>e(function t(e){if(l(this,t),this.stops=new p,e&&"object"==y(e)){for(var n in e)"stops"!==n&&(this[n]=e[n]);var i;e.stops&&Array.isArray(e.stops)&&(i=this.stops).push.apply(i,d(e.stops))}else"string"==typeof e&&this.fromString(e)},[{key:"addStop",value:function(t,e){this.stops.add({offset:Number(t),color:e})}},{key:"toGradient",value:function(t){var i,e,n,r=t.context||t,o=t.absoluteBounds||t.getAbsoluteBounds(),s=this.x1||0,a=this.y1||0,h=this.x2,l=this.y2,u=t.getLocation(),c=0,u=(c=(c=u.radius?2*u.radius:c)||Math.min(u.width,u.height),g.checkPercent(s)&&(s=g.percentToNumber(s)*(o.width||c)),g.checkPercent(h)&&(h=g.percentToNumber(h)*(o.width||c)),g.checkPercent(a)&&(a=g.percentToNumber(a)*(o.height||c)),g.checkPercent(l)&&(l=g.percentToNumber(l)*(o.height||c)),Number(s)+o.left),f=Number(a)+o.top,v=Number(h)+o.left,d=Number(l)+o.top;return"linear"===this.type?"webgl"===t.mode&&t.webglControl?(i=t.webglControl.createLinearGradient(s,a,h,l,o)).key=this.toString():r.createLinearGradient&&(i=r.createLinearGradient(u,f,v,d)):"radial"===this.type&&(e=this.r1||0,n=this.r2,g.checkPercent(e)&&(e=g.percentToNumber(e),e*=c),g.checkPercent(n)&&(n=g.percentToNumber(n),n*=c),"webgl"===t.mode&&t.webglControl?(i=t.webglControl.createRadialGradient(s,a,e,h,l,n,o)).key=this.toString():r.createRadialGradient?i=r.createRadialGradient(u,f,e,v,d,n):r.createCircularGradient&&(i=r.createCircularGradient(u,f,n))),i?(this.stops.each(function(t,e){var n=g.toColor(e.color);i&&i.addColorStop(e.offset,n)}),i):(c=this.stops.get(0))&&c.color||"#000"}},{key:"fromString",value:function(t){if(t){t=t.match(/(linear|radial)-gradient\s*\(\s*([^,]+)\s*,\s*((.|\s)+)\)/i);if(t&&!(t.length<3)){this.type=t[1].toLowerCase();var e=g.trim(t[2]).split(/\s+/),n=("linear"==this.type?e.length<=2?(this.x2=e[0],this.y2=e[1]||0):(this.x1=e[0],this.y1=e[1],this.x2=e[2],this.y2=e[3]):e.length<=3?(this.x2=e[0],this.y2=e[1]||0,this.r2=e[2]||0):(this.x1=e[0],this.y1=e[1],this.r1=e[2],this.x2=e[3],this.y2=e[3],this.r2=e[3]),t[3].match(/((rgb(a)?\s*\([\d,\.\s]+\))|(#[a-zA-Z\d]+))\s+([\d\.]+)/gi));if(n&&n.length)for(var i=0;i<n.length;i++){var r,o=g.trim(n[i]),s=o.lastIndexOf(" ");-1<s&&(r=Number(o.substr(s+1)),o=g.trim(o.substr(0,s)),!isNaN(r))&&o&&this.addStop(r,o)}}}}},{key:"toString",value:function(){var n=this.type+"-gradient(";return"linear"==this.type?n+=this.x1+" "+this.y1+" "+this.x2+" "+this.y2:n+=this.x1+" "+this.y1+" "+this.r1+" "+this.x2+" "+this.y2+" "+this.r2,this.stops.each(function(t,e){n+=","+e.color+" "+e.offset}),n+")"}}]))(),Y=(()=>e(function t(e,n){l(this,t),this.container=e,this.target=n||e,this.mouseHandler=new Z(this,e,n),this.keyHandler=new V(this,e,n)},[{key:"touchStart",value:function(t){if((t=t||window.event).eventName="touchstart",this.container.raiseEvent("touchstart",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchMove",value:function(t){if((t=t||window.event).eventName="touchmove",this.container.raiseEvent("touchmove",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchEnd",value:function(t){if((t=t||window.event).eventName="touchend",this.container.raiseEvent("touchend",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchCancel",value:function(t){if((t=t||window.event).eventName="touchcancel",this.container.raiseEvent("touchcancel",t),(t.target||t.srcElement)==this.target)return!1}},{key:"destroy",value:function(){this.mouseHandler.destroy(),this.keyHandler.destroy()}}]))(),Z=(()=>e(function t(e,n,i){l(this,t),this.instance=e,this.container=n,this.target=i||n,this.eventEvents={},this.init(e,n,i)},[{key:"init",value:function(e,n,t){var i=this.target,r="undefined"!=typeof document?document:null;this.eventEvents.mousedown=g.bindEvent(this.target,"mousedown",function(t){(t=t||window.event).eventName="mousedown",n.raiseEvent("mousedown",t)}),this.eventEvents.mousemove=g.bindEvent(this.target,"mousemove",function(t){if((t=t||window.event).eventName="mousemove",(t.target||t.srcElement)==i)return n.raiseEvent("mousemove",t),t.preventDefault&&t.preventDefault(),!1}),this.eventEvents.mouseover=g.bindEvent(this.target,"mouseover",function(t){(t=t||window.event).eventName="mouseover",n.raiseEvent("mouseover",t)}),this.eventEvents.mouseleave=g.bindEvent(this.target,"mouseleave",function(t){(t=t||window.event).eventName="mouseleave",n.raiseEvent("mouseleave",t)}),this.eventEvents.mouseout=g.bindEvent(this.target,"mouseout",function(t){(t=t||window.event).eventName="mouseout",n.raiseEvent("mouseout",t)}),r&&(this.eventEvents.mouseup=g.bindEvent(r,"mouseup",function(t){if(!((t=t||window.event).eventName="mouseup")===n.raiseEvent("mouseup",t))return t.preventDefault&&t.preventDefault(),!1})),this.eventEvents.dblclick=g.bindEvent(this.target,"dblclick",function(t){(t=t||window.event).eventName="dblclick",n.raiseEvent("dblclick",t)}),this.eventEvents.click=g.bindEvent(this.target,"click",function(t){(t=t||window.event).eventName="click",n.raiseEvent("click",t)}),r&&(this.eventEvents.resize=g.bindEvent(r,"resize",function(t){return(t=t||window.event).eventName="resize",n.raiseEvent("resize",t)})),this.eventEvents.touchstart=g.bindEvent(this.target,"touchstart",function(t){return t.eventName="touchstart",e.touchStart(t)},{passive:!1}),this.eventEvents.touchmove=g.bindEvent(this.target,"touchmove",function(t){return t.eventName="touchmove",e.touchMove(t)},{passive:!1}),r&&(this.eventEvents.touchend=g.bindEvent(r,"touchend",function(t){return t.eventName="touchend",e.touchEnd(t)},{passive:!1})),r&&(this.eventEvents.touchcancel=g.bindEvent(r,"touchcancel",function(t){return t.eventName="touchcancel",e.touchCancel(t)},{passive:!1}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&g.removeEvent(e.target,t,e.fun)}}}]))(),V=(()=>e(function t(e,n,i){l(this,t),this.instance=e,this.container=n,this.target=i||n,this.eventEvents={},this.init(n,i)},[{key:"init",value:function(n,t){function i(t){return!(t=t.srcElement||t.target)||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"ANCHOR"!=t.tagName&&"FORM"!=t.tagName&&"FILE"!=t.tagName&&"IMG"!=t.tagName&&"HIDDEN"!=t.tagName&&"RADIO"!=t.tagName&&"TEXT"!=t.tagName}var e="undefined"!=typeof document?document:null;e&&(this.eventEvents.keypress=g.bindEvent(e,"keypress",function(t){var e;if(t=t||window.event,i(t))return!1===(e=n.raiseEvent("keypress",t))&&t.preventDefault&&t.preventDefault(),e})),e&&(this.eventEvents.keydown=g.bindEvent(e,"keydown",function(t){var e;if(t=t||window.event,i(t))return!1===(e=n.raiseEvent("keydown",t))&&t.preventDefault&&t.preventDefault(),e})),e&&(this.eventEvents.keyup=g.bindEvent(e,"keyup",function(t){var e;if(t=t||window.event,i(t))return!1===(e=n.raiseEvent("keyup",t))&&t.preventDefault&&t.preventDefault(),e}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&g.removeEvent(e.target,t,e.fun)}}}]))();function n(t,e,n){n=n||2;var i,r,o,s,a,h=e&&e.length,l=h?e[0]*n:t.length,u=W(t,0,l,n,!0),c=[];if(u&&u.next!==u.prev){if(h&&(u=((t,e,n,i)=>{var r,o,s,a,h=[];for(r=0,o=e.length;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,(a=W(t,a,s,i,!1))===a.next&&(a.steiner=!0),h.push((t=>{for(var e=t,n=t;(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),(e=e.next)!==t;);return n})(a));for(h.sort(K),r=0;r<h.length;r++)n=((t,e)=>{var n=((t,e)=>{var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}}while((i=i.next)!==e);if(!n)return null;var h,l=n,u=n.x,c=n.y,f=1/0;for(i=n;r>=i.x&&i.x>=u&&r!==i.x&&S(o<c?r:s,o,u,c,o<c?s:r,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(r-i.x),N(i,t))&&(h<f||h===f&&(i.x>n.x||i.x===n.x&&((t,e)=>C(t.prev,t,e.prev)<0&&C(e.next,t,t.next)<0)(n,i)))&&(n=i,f=h),(i=i.next)!==l;);return n})(t,e);return n?(T(t=Q(n,t),t.next),T(n,n.next)):e})(h[r],n);return n})(t,e,u,n)),t.length>80*n){for(var f=i=t[0],v=r=t[1],d=n;d<l;d+=n)(o=t[d])<f&&(f=o),(s=t[d+1])<v&&(v=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-f,r-v))?32767/a:0}A(u,c,n,f,v,a,0)}return c}function W(t,e,n,i,r){var o,s;if(r===0<k(t,e,n,i))for(o=e;o<n;o+=i)s=$(o,t[o],t[o+1],s);else for(o=n-i;e<=o;o-=i)s=$(o,t[o],t[o+1],s);return s&&R(s,s.next)&&(M(s),s=s.next),s}function T(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!R(i,i.next)&&0!==C(i.prev,i,i.next))i=i.next;else{if(M(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function A(t,e,n,i,r,o,s){if(t){if(!s&&o){for(var a=t,h=i,l=r,u=o,c=a;0===c.z&&(c.z=P(c.x,c.y,h,l,u)),c.prevZ=c.prev,c.nextZ=c.next,(c=c.next)!==a;);c.prevZ.nextZ=null,c.prevZ=null;var f,v,d,y,p,g,m,x,b=c,w=1;do{for(v=b,p=b=null,g=0;v;){for(g++,d=v,f=m=0;f<w&&(m++,d=d.nextZ);f++);for(x=w;0<m||0<x&&d;)0!==m&&(0===x||!d||v.z<=d.z)?(v=(y=v).nextZ,m--):(d=(y=d).nextZ,x--),p?p.nextZ=y:b=y,y.prevZ=p,p=y;v=d}}while(p.nextZ=null,w*=2,1<g)}for(var _,k,E=t;t.prev!==t.next;)if(_=t.prev,k=t.next,o?((t,e,n,i)=>{var r=t.prev,o=t,s=t.next;if(!(0<=C(r,o,s))){for(var a=r.x,h=o.x,l=s.x,u=r.y,c=o.y,f=s.y,v=a<h?a<l?a:l:h<l?h:l,d=u<c?u<f?u:f:c<f?c:f,y=h<a?l<a?a:l:l<h?h:l,p=c<u?f<u?u:f:f<c?c:f,g=P(v,d,e,n,i),m=P(y,p,e,n,i),x=t.prevZ,b=t.nextZ;x&&x.z>=g&&b&&b.z<=m;){if(x.x>=v&&x.x<=y&&x.y>=d&&x.y<=p&&x!==r&&x!==s&&S(a,u,h,c,l,f,x.x,x.y)&&0<=C(x.prev,x,x.next))return;if(x=x.prevZ,b.x>=v&&b.x<=y&&b.y>=d&&b.y<=p&&b!==r&&b!==s&&S(a,u,h,c,l,f,b.x,b.y)&&0<=C(b.prev,b,b.next))return;b=b.nextZ}for(;x&&x.z>=g;){if(x.x>=v&&x.x<=y&&x.y>=d&&x.y<=p&&x!==r&&x!==s&&S(a,u,h,c,l,f,x.x,x.y)&&0<=C(x.prev,x,x.next))return;x=x.prevZ}for(;b&&b.z<=m;){if(b.x>=v&&b.x<=y&&b.y>=d&&b.y<=p&&b!==r&&b!==s&&S(a,u,h,c,l,f,b.x,b.y)&&0<=C(b.prev,b,b.next))return;b=b.nextZ}return 1}})(t,i,r,o):(t=>{var e=t.prev,n=t,t=t.next;if(!(0<=C(e,n,t))){for(var i=e.x,r=n.x,o=t.x,s=e.y,a=n.y,h=t.y,l=i<r?i<o?i:o:r<o?r:o,u=s<a?s<h?s:h:a<h?a:h,c=r<i?o<i?i:o:o<r?r:o,f=a<s?h<s?s:h:h<a?a:h,v=t.next;v!==e;){if(v.x>=l&&v.x<=c&&v.y>=u&&v.y<=f&&S(i,s,r,a,o,h,v.x,v.y)&&0<=C(v.prev,v,v.next))return;v=v.next}return 1}})(t))e.push(_.i/n|0),e.push(t.i/n|0),e.push(k.i/n|0),M(t),t=k.next,E=k.next;else if((t=k)===E){s?1===s?A(t=((t,e,n)=>{var i=t;do{var r=i.prev,o=i.next.next}while(!R(r,o)&&J(r,i,i.next,o)&&N(r,o)&&N(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),M(i),M(i.next),i=t=o),(i=i.next)!==t);return T(i)})(T(t),e,n),e,n,i,r,o,2):2===s&&((t,e,n,i,r,o)=>{var s=t;do{for(var a,h=s.next.next;h!==s.prev;){if(s.i!==h.i&&((t,e)=>t.next.i!==e.i&&t.prev.i!==e.i&&!((t,e)=>{var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&J(n,n.next,t,e))return 1}while((n=n.next)!==t)})(t,e)&&(N(t,e)&&N(e,t)&&((t,e)=>{for(var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),(n=n.next)!==t;);return i})(t,e)&&(C(t.prev,t,e.prev)||C(t,e.prev,e))||R(t,e)&&0<C(t.prev,t,t.next)&&0<C(e.prev,e,e.next)))(s,h))return a=Q(s,h),s=T(s,s.next),a=T(a,a.next),A(s,e,n,i,r,o,0),A(a,e,n,i,r,o,0);h=h.next}}while((s=s.next)!==t)})(t,e,n,i,r,o):A(T(t),e,n,i,r,o,1);break}}}function K(t,e){return t.x-e.x}function P(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function S(t,e,n,i,r,o,s,a){return(t-s)*(o-a)<=(r-s)*(e-a)&&(n-s)*(e-a)<=(t-s)*(i-a)&&(r-s)*(i-a)<=(n-s)*(o-a)}function C(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function R(t,e){return t.x===e.x&&t.y===e.y}function J(t,e,n,i){var r=w(C(t,e,n)),o=w(C(t,e,i)),s=w(C(n,i,t)),a=w(C(n,i,e));return r!==o&&s!==a||0===r&&b(t,n,e)||0===o&&b(t,i,e)||0===s&&b(n,t,i)||!(0!==a||!b(n,e,i))}function b(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function w(t){return 0<t?1:t<0?-1:0}function N(t,e){return C(t.prev,t,t.next)<0?0<=C(t,e,t.next)&&0<=C(t,t.prev,e):C(t,e,t.prev)<0||C(t,t.next,e)<0}function Q(t,e){var n=new _(t.i,t.x,t.y),i=new _(e.i,e.x,e.y),r=t.next,o=e.prev;return(t.next=e).prev=t,(n.next=r).prev=n,i.next=n,(o.next=n.prev=i).prev=o,i}function $(t,e,n,i){t=new _(t,e,n);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}n.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(k(t,0,o,n));if(r)for(var a=0,h=e.length;a<h;a++){var l=e[a]*n,u=a<h-1?e[a+1]*n:t.length;s-=Math.abs(k(t,l,u,n))}for(var c=0,a=0;a<i.length;a+=3){var f=i[a]*n,v=i[a+1]*n,d=i[a+2]*n;c+=Math.abs((t[f]-t[d])*(t[1+v]-t[1+f])-(t[f]-t[v])*(t[1+d]-t[1+f]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},n.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);0<r&&(i+=t[r-1].length,n.holes.push(i))}return n};var E=(()=>e(function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"linear",n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};l(this,t),this.type=e||"linear",this.x1=n.x1||0,this.y1=n.y1||0,this.r1=n.r1||0,this.x2=n.x2||0,this.y2=n.y2||0,this.r2=n.r2||0,this.bounds=n.bounds||{left:0,top:0,width:0,height:0},this.control=n.control,this.stops=[],this.init()},[{key:"init",value:function(){var t=this.x2-this.x1,e=this.y2-this.y1;"radial"===this.type?this.length=this.r2-this.r1:0==t&&0==e?this.length=0:(this.length=Math.sqrt(Math.pow(t,2),Math.pow(e,2)),this.sin=e/this.length,this.cos=t/this.length)}},{key:"addColorStop",value:function(t,e){this.stops.push({offset:t,color:e})}},{key:"toImageData",value:function(i,t){var r,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return i.textureContext?(r=null,r="linear"===this.type?i.textureContext.createLinearGradient(this.x1,this.y1,this.x2,this.y2):i.textureContext.createRadialGradient(this.x1,this.y1,this.r1,this.x2,this.y2,this.r2),this.stops.forEach(function(t,e){var n=i.graph.utils.toColor(t.color);r&&r.addColorStop(t.offset,n)}),i.toFillTexture(r,t,e)):null}},{key:"toString",value:function(){var e=this.type+"-gradient(";return"linear"==this.type?e+=this.x1+" "+this.y1+" "+this.x2+" "+this.y2:e+=this.x1+" "+this.y1+" "+this.r1+" "+this.x2+" "+this.y2+" "+this.r2,this.stops.forEach(function(t){e+=","+t.color+" "+t.offset}),e+")"}}]))();function tt(t,e,n){e=t.createShader(e);return t.shaderSource(e,n),t.compileShader(e),e}var et={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1},nt=function(t){return et[t]},B=null,it={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D"},rt=function(t,e){if(!B){var n=Object.keys(it);B={};for(var i=0;i<n.length;++i){var r=n[i];B[t[r]]=it[r]}}return B[e]};function ot(t,e,n){var e=tt(t,t.VERTEX_SHADER,e),n=tt(t,t.FRAGMENT_SHADER,n),i=t.createProgram();return t.attachShader(i,e),t.attachShader(i,n),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||(console.error("PError: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(i,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(i)&&console.warn("Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(i)),t.deleteProgram(i)),st(t,i),t.deleteShader(e),t.deleteShader(n),{program:i,attrs:((t,e)=>{for(var n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(e,r),s=rt(t,o.type);n[o.name]={attribData:o,size:nt(s),type:s,location:t.getAttribLocation(e,o.name)}}return n})(t,i),uniforms:((t,e)=>{for(var n={},i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),r=0;r<i;r++){var o=t.getActiveUniform(e,r),s=o.name.replace(/\[.*?\]/,""),a=rt(t,o.type);n[s]={uniformData:o,type:a,size:o.size,location:t.getUniformLocation(e,s)}}return n})(t,i)}}function st(t,e){t.useProgram(e)}function at(t,e,n,i){var n=2<arguments.length&&void 0!==n?n:t.ARRAY_BUFFER,i=3<arguments.length&&void 0!==i?i:t.STATIC_DRAW,r=t.createBuffer();if(r)return t.bindBuffer(n,r),t.bufferData(n,e.buffer||e,i),{type:n,drawType:i,buffer:r,unitSize:e.BYTES_PER_ELEMENT};throw Error("创建缓冲区对象失败")}function D(t){var e=t.createTexture();return t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}var ht="\n attribute vec4 a_position;\n attribute vec4 a_color;\n attribute vec2 a_text_coord;\n uniform vec2 a_center_point; // 当前canvas的中心位置\n uniform float a_point_size; // 点的大小\n uniform int a_type;\n varying vec4 v_color;\n varying vec2 v_text_coord;\n varying float v_type;\n\n ".concat("\n vec4 translatePosition(vec4 point, float x, float y) {\n point.x = (point.x-x)/x;\n point.y = (y-point.y)/y;\n return point;\n }","\n\n void main() {\n gl_PointSize = a_point_size == 0.0? 1.0 : a_point_size;\n v_type = float(a_type);\n vec4 pos = translatePosition(a_position, a_center_point.x, a_center_point.y);\n gl_Position = pos;\n v_color = a_color;\n if(a_type == 2) {\n v_text_coord = a_text_coord;\n }\n }\n"),lt="\n precision mediump float;\n uniform sampler2D u_sample;\n uniform vec4 v_texture_bounds; // 纹理的左上坐标和大小 x,y,z,w\n uniform vec4 v_single_color;\n varying float v_type;\n varying vec4 v_color;\n varying vec2 v_text_coord;\n\n ".concat("\n vec2 translateTexturePosition(in vec2 point, vec4 bounds) {\n point.x = (point.x-bounds.x)/bounds.z; // 离左上角位置的X长比上纹理宽 0-1\n point.y = 1.0-(point.y-bounds.y)/bounds.w; // 离左上角位置的Y长比上高,因为纹理坐标是左下角起,所以要用1-\n return point;\n }","\n\n void main() {\n // 如果是fill,则直接填充颜色\n if(v_type == 1.0) {\n gl_FragColor = v_single_color;\n }\n // 渐变色\n else if(v_type == 3.0) {\n gl_FragColor = v_color;\n }\n else if(v_type == 2.0) {\n vec2 pos = translateTexturePosition(v_text_coord, v_texture_bounds);\n gl_FragColor = texture2D(u_sample, pos);\n }\n else {\n float r = distance(gl_PointCoord, vec2(0.5, 0.5));\n //根据距离设置片元\n if(r <= 0.5){\n // 方形区域片元距离几何中心半径小于0.5,像素颜色设置红色\n gl_FragColor = v_single_color;\n }else {\n // 方形区域距离几何中心半径不小于0.5的片元剪裁舍弃掉:\n discard;\n }\n }\n }\n"),ut=(()=>e(function t(e,n){l(this,t),this.graph=e,this.option=n||{},this.style={globalAlpha:1}},[{key:"context",get:function(){if(this.graph)return this.graph.context}},{key:"textureCanvas",get:function(){var t=this.graph.textureCanvas;if(!t){if("undefined"==typeof document)return null;t=this.graph.textureCanvas=document.createElement("canvas")}return t}},{key:"textureContext",get:function(){return this.textureCanvas.ctx||(this.textureCanvas.ctx=this.textureCanvas.getContext("2d",{willReadFrequently:!0}))}},{key:"program",get:function(){return this.graph.context.pathProgram||(this.graph.context.pathProgram=this.createProgram(ht,lt))}},{key:"setStyle",value:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.style;"string"==typeof e&&((t={})[e]=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",e=t),this.style=f(f({},this.style),e)}},{key:"convertColor",value:function(t){return this.isGradient(t)?t:("string"==typeof t&&(t=this.graph.utils.hexToRGBA(t)),this.graph.utils.rgbToDecimal(t))}},{key:"setTextureStyle",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof t)-1<["fillStyle","strokeStyle","shadowColor"].indexOf(t)&&(e=this.graph.utils.toColor(e)),this.textureContext[t]=e;else for(var n in t)"constructor"!==n&&this.setTextureStyle(n,t[n])}},{key:"createProgram",value:function(t,e){return this.context.lineWidth(1),ot(this.context,t,e)}},{key:"useProgram",value:function(){var t=(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.program).program||t;return this.context.__curent_program!==t&&(st(this.context,t.program||t),this.context.__curent_program=t),t}},{key:"getAttribLocation",value:function(t){return this.context.getAttribLocation(this.program.program,t)}},{key:"getUniformLocation",value:function(t){return this.context.getUniformLocation(this.program.program,t)}},{key:"writeVertexAttrib",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:2,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:this.context.FLOAT;return t.attr=e,function(t,e,n,i,r,o,s){return i=3<arguments.length&&void 0!==i?i:2,r=4<arguments.length&&void 0!==r?r:0,o=5<arguments.length&&void 0!==o?o:0,s=6<arguments.length&&void 0!==s?s:t.FLOAT,t.bindBuffer(e.type,e.buffer),t.vertexAttribPointer(n.location,i,s,!1,r*e.unitSize,o),t.enableVertexAttribArray(n.location),e}(this.context,t,e,n,i,r,o)}},{key:"disableVertexAttribArray",value:function(t){try{return t?this.context.disableVertexAttribArray(t.location):t}catch(t){console.error(t)}return t}},{key:"createFloat32Buffer",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.context.ARRAY_BUFFER,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.context.STATIC_DRAW;return f({data:t},function(t,e,n,i){return n=2<arguments.length&&void 0!==n?n:t.ARRAY_BUFFER,i=3<arguments.length&&void 0!==i?i:t.STATIC_DRAW,at(t,new Float32Array(e),n,i)}(this.context,t,e,n))}},{key:"createUint16Buffer",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.context.ARRAY_BUFFER,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.context.STATIC_DRAW;return f({data:t},function(t,e,n,i){return n=2<arguments.length&&void 0!==n?n:t.ARRAY_BUFFER,i=3<arguments.length&&void 0!==i?i:t.STATIC_DRAW,at(t,new Uint16Array(e),n,i)}(this.context,t,e,n))}},{key:"deleteBuffer",value:function(e){try{if(!e)return;var t=e.buffer||e;if(t)return n=this.context,i=t,void n.deleteBuffer(i.buffer||i)}catch(t){console.log(e),console.error(t)}var n,i;return e}},{key:"create2DTexture",value:function(){return D(this.context)}},{key:"createImgTexture",value:function(t){return e=this.context,t=t,n=D(e),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),{texture:n};var e,n}},{key:"createDataTexture",value:function(t){return e=this.context,t=t,n=new Uint8Array(t.data||t),i=D(e),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.width||1,t.height||1,0,e.RGBA,e.UNSIGNED_BYTE,n),{texture:i};var e,n,i}},{key:"deleteTexture",value:function(t){try{return e=this.context,n=t.texture||t,e.deleteTexture(n)}catch(t){console.error(t)}var e,n;return t}},{key:"earCutPoints",value:function(t){return n(this.pointsToArray(t))}},{key:"earCutPointsToTriangles",value:function(t){for(var e=this.earCutPoints(t),n=[],i=0;i<e.length;i+=3){var r=t[e[i]],o=t[e[i+1]],s=t[e[i+2]];n.push([r,o,s])}return n}},{key:"pointsToArray",value:function(t){var e;return(e=[]).concat.apply(e,d(t.map(function(t){return[t.x,t.y]})))}},{key:"arrayToPoints",value:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({x:t[n],y:t[n+1]});return e}},{key:"createLinearGradient",value:function(t,e,n,i,r){return new E("linear",{x1:t,y1:e,x2:n,y2:i,bounds:r,control:this})}},{key:"createRadialGradient",value:function(t,e,n,i,r,o,s){return new E("radial",{x1:t,y1:e,r1:n,x2:i,y2:r,r2:o,bounds:s,control:this})}},{key:"isGradient",value:function(t){return t&&t instanceof E}},{key:"testSize",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.style,e=(this.textureContext.save&&this.textureContext.save(),(e.font||e.fontSize)&&(this.textureContext.font=e.font||e.fontSize+"px "+e.fontFamily),this.textureContext.measureText?this.textureContext.measureText(t):{width:15});return this.textureContext.restore&&this.textureContext.restore(),e.height=this.style.fontSize||15,e}},{key:"toFillTexture",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,i=this.textureCanvas;if(!i)return t;if(i.width=e.width,i.height=e.height,!i.width||!i.height)return t;if(this.textureContext.clearRect(0,0,i.width,i.height),this.textureContext.fillStyle=t,this.textureContext.beginPath(),n&&n.length||((n=[]).push({x:e.left,y:e.top}),n.push({x:e.left+e.width,y:e.top}),n.push({x:e.left+e.width,y:e.top+e.height}),n.push({x:e.left,y:e.top+e.height}),n.push({x:e.left,y:e.top})),n&&n.length){var r,o=u(n);try{for(o.s();!(r=o.n()).done;){var s=r.value;s.m?this.textureContext.moveTo(s.x-e.left,s.y-e.top):this.textureContext.lineTo(s.x-e.left,s.y-e.top)}}catch(t){o.e(t)}finally{o.f()}}else this.textureContext.moveTo(0,0),this.textureContext.lineTo(e.width,0),this.textureContext.lineTo(e.width,e.height),this.textureContext.lineTo(0,e.height),this.textureContext.lineTo(0,0);return this.textureContext.closePath(),this.textureContext.fill(),{data:this.textureContext.getImageData(0,0,i.width,i.height),points:n}}}]))(),ct=(()=>{function n(t,e){return l(this,n),(t=h(this,n,[t,e])).isRegular=e.isRegular||!1,t.needCut=e.needCut||!1,t.control=e.control,t.points=[],t}return c(n,ut),e(n,[{key:"setParentBounds",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.parentAbsoluteBounds;t&&(this.parentAbsoluteBounds=t),this.context.uniform2f(this.program.uniforms.a_center_point.location,this.graph.width/2,this.graph.height/2)}},{key:"setFragColor",value:function(t){if(!Array.isArray(t))return void 0===(t=this.convertColor(t)).a&&(t.a=1),this.context.uniform4f(this.program.uniforms.v_single_color.location,t.r,t.g,t.b,t.a*this.style.globalAlpha),null;var e,n=[],i=u(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;void 0===(r=this.convertColor(r)).a&&(r.a=1),n.push(r.r,r.g,r.b,r.a*this.style.globalAlpha)}}catch(t){i.e(t)}finally{i.f()}t=this.createFloat32Buffer(n);return this.writeVertexAttrib(t,this.program.attrs.a_color,4,0,0),t.attr=this.program.attrs.a_color,t}},{key:"beginDraw",value:function(){this.useProgram()}},{key:"draw",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.parentAbsoluteBounds;this.setParentBounds(e),this.points=t}},{key:"endDraw",value:function(){this.points&&delete this.points,this.pathPoints&&delete this.pathPoints}},{key:"closePath",value:function(){var t,e;this.points&&2<this.points.length&&this.points[0]!==this.points[this.points.length-1]&&((t=this.points[0])==(e=this.points[this.points.length-1])||t.x===e.x&&t.y===e.y||this.points.push(t))}},{key:"writePoints",value:function(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.program.attrs.a_position,i=[],r=u(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;i.push(o.x+this.parentAbsoluteBounds.left,o.y+this.parentAbsoluteBounds.top)}}catch(t){r.e(t)}finally{r.f()}t=this.createFloat32Buffer(i);return this.writeVertexAttrib(t,n,2,0,0),t.attr=n,t}},{key:"genLinePoints",value:function(t,e){var n=[t],i=e.x-t.x,r=e.y-t.y;if(0!=i||0!=r)for(var o=Math.sqrt(Math.pow(i,2)+Math.pow(r,2)),s=i/o,a=r/o,h=.5;h<o;h+=.5){var l=t.x+s*h;n.push({x:l,y:t.y+a*h})}return n.push(e),n}},{key:"pathToPoints",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.points,e=null,n=[],i=0;i<t.length;i++){var r,o=t[i];e&&!o.m?(r=this.genLinePoints(e,o),n.push.apply(n,d(r))):e&&!n.includes(e)&&n.push(e),e=o}return n.includes(e)||n.push(e),n}},{key:"equalPoint",value:function(t,e){return t.x===e.x&&t.y===e.y}},{key:"pathToLines",value:function(t){for(var e=null,n=[],i=0;i<t.length;i++){var r=t[i];!e||r.m||e.x==r.x&&e.y==r.y||n.push({start:e,end:r}),e=r}return n}},{key:"cutLines",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(!(t&&t.length<3))for(n=Math.max(e+1,n);e<t.length;){for(var i=t[e];n<t.length;){var r=t[n];if(this.equalPoint(i.start,r.start)||this.equalPoint(i.end,r.end)||this.equalPoint(i.start,r.end)||this.equalPoint(i.end,r.start))n++;else{var o,s,a=!1,h=this.getIntersection(i,r);if(h&&(this.equalPoint(i.start,h)||this.equalPoint(i.end,h)||(o={start:i.start,end:h},s={start:h,end:i.end},t.splice(e,1,o,s),a=!0,n++),this.equalPoint(r.start,h)||this.equalPoint(r.end,h)||(o={start:r.start,end:h},s={start:h,end:r.end},t.splice(n,1,o,s),n++)),n++,a)return this.cutLines(t,e,n)}}n=++e+1}return t}},{key:"getIntersection",value:function(t,e){var n,i;return this.equalPoint(t.start,e.start)||this.equalPoint(t.start,e.end)?t.start:this.equalPoint(t.end,e.start)||this.equalPoint(t.end,e.end)?t.end:0<(i=(t.start.x-e.start.x)*(t.end.y-e.start.y)-(t.start.y-e.start.y)*(t.end.x-e.start.x))*(n=(t.start.x-e.end.x)*(t.end.y-e.end.y)-(t.start.y-e.end.y)*(t.end.x-e.end.x))||0<(e=(e.start.x-t.start.x)*(e.end.y-t.start.y)-(e.start.y-t.start.y)*(e.end.x-t.start.x))*(e+i-n)||n==i?null:(n=(e=e/(n-i))*(t.end.x-t.start.x),i=e*(t.end.y-t.start.y),{x:t.start.x+n,y:t.start.y+i})}},{key:"getIntersectionLines",value:function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:t.end,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,s={line:t,polygons:[]};if(r.push(i),o&&this.equalPoint(o.line.start,i))r.unshift(o.line.start),o.polygons.push(r);else for(;n<e.length;n++){var a=e[n];this.equalPoint(i,a.start)?r.includes(a.end)||this.getIntersectionLines(a,e,n+1,a.end,d(r),o||s):this.equalPoint(i,a.end)&&!r.includes(a.start)&&this.getIntersectionLines(a,e,n+1,a.start,d(r),o||s)}return s}},{key:"getPolygon",value:function(t){var e=[];if((n=this.pathToLines(t))&&2<n.length)for(var n=this.cutLines(n),i=0;i<n.length-1;i++){var r=n[i],r=this.getIntersectionLines(r,n,i+1);r.polygons.length&&e.push.apply(e,d(r.polygons))}return e}},{key:"getTriangles",value:function(t){var e=[],t=this.getPolygon(t);if(t.length){var n,i=u(t);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=this.earCutPointsToTriangles(r);e.push.apply(e,d(o))}}catch(t){i.e(t)}finally{i.f()}}return e}},{key:"stroke",value:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.points,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.style.strokeStyle,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.style.lineWidth;e&&e.length&&(t=null,n&&(t=this.setFragColor(n)),i&&this.context.uniform1f(this.program.uniforms.a_point_size.location,i),this.program.uniforms.a_type&&this.context.uniform1i(this.program.uniforms.a_type.location,1===e.length?4:1),e&&e.length&&(e=(n=i<=1.2)?e:this.pathToPoints(e),i=this.writePoints(e),this.context.drawArrays(n?this.context.LINE_LOOP:this.context.POINTS,0,e.length),this.deleteBuffer(i)),t&&this.deleteBuffer(t),t)&&this.disableVertexAttribArray(t.attr)}},{key:"fill",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{left:0,top:0,width:0,height:0},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;this.points&&this.points.length&&(this.style.fillStyle&&this.fillColor(this.style.fillStyle,this.points,t,e),this.style.fillImage)&&this.fillImage(this.style.fillImage,this.points,t,e)}},{key:"fillColor",value:function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;if(this.isGradient(t))return r=t.toImageData(this,n,e),this.fillImage(r.data,r.points,n);this.context.uniform1i(this.program.uniforms.a_type.location,i);var r=this.setFragColor(t);this.fillPolygons(e),r&&this.deleteBuffer(r),r&&this.disableVertexAttribArray(r.attr)}},{key:"fillImage",value:function(t,e,n){t&&(t=t instanceof ImageData?this.createDataTexture(t):this.createImgTexture(t),this.context.uniform1i(this.program.uniforms.u_sample.location,0),this.context.uniform4f(this.program.uniforms.v_texture_bounds.location,n.left+this.parentAbsoluteBounds.left,n.top+this.parentAbsoluteBounds.top,n.width,n.height),this.fillTexture(e),this.deleteTexture(t))}},{key:"fillTexture",value:function(t){t&&t.length&&(this.context.uniform1i(this.program.uniforms.a_type.location,2),this.fillPolygons(t,!0),this.disableVertexAttribArray(this.program.attrs.a_text_coord))}},{key:"fillPolygons",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=this.writePoints(t),e=e?this.writePoints(t,this.program.attrs.a_text_coord):null;this.context.drawArrays(this.context.TRIANGLE_FAN,0,t.length),this.deleteBuffer(n),e&&this.deleteBuffer(e)}},{key:"drawImage",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:t.width,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:t.height,i=i||t.width,r=r||t.height;this.fillImage(t,this.points,{left:e,top:n,width:i,height:r})}},{key:"drawText",value:function(t,e,n,i){var r=this.textureCanvas;if(!r)return null;if(r.width=i.width,r.height=i.height,!r.width||!r.height)return null;this.textureContext.clearRect(0,0,r.width,r.height),this.textureContext.font=this.style.font||this.style.fontSize+"px "+this.style.fontFamily,e-=i.left,n-=i.top,this.setTextureStyle(this.style),this.style.fillStyle&&this.textureContext.fillText&&(this.style.maxWidth?this.textureContext.fillText(t,e,n,this.style.maxWidth):this.textureContext.fillText(t,e,n)),this.textureContext.strokeText&&(this.style.maxWidth?this.textureContext.strokeText(t,e,n,this.style.maxWidth):this.textureContext.strokeText(t,e,n));t=this.textureContext.getImageData(0,0,r.width,r.height);this.fillImage(t,this.points,i)}}])})(),ft={fill:"fillStyle",fillImage:"fillImage",stroke:"strokeStyle","shadow.blur":"shadowBlur","shadow.x":"shadowOffsetX","shadow.y":"shadowOffsetY","shadow.color":"shadowColor",lineWidth:"lineWidth",miterLimit:"miterLimit",fillStyle:"fillStyle",strokeStyle:"strokeStyle",font:"font",opacity:"globalAlpha",textAlign:"textAlign",textBaseline:"textBaseline",shadowBlur:"shadowBlur",shadowOffsetX:"shadowOffsetX",shadowOffsetY:"shadowOffsetY",shadowColor:"shadowColor",lineJoin:"lineJoin",lineCap:"lineCap"},O=(()=>{function i(t,e){var n;return l(this,i),(n=h(this,i,[t=t||{}])).property("type",e||(this instanceof i?this.constructor:void 0).name),n.style=t&&t.style?t.style:{},n.width=t.width||0,n.height=t.height||0,t.position&&(n.position=t.position),n.graph=t.graph||null,n.zIndex=t.zIndex||0,n.interactive=void 0!==t.interactive&&t.interactive,"webgl"===n.mode&&(n.webglControl=new ct(n.graph,{style:n.style,control:n,isRegular:t.isRegular,needCut:t.needCut})),n.initializing(),n.on=n.bind,n.option=t,n}return c(i,H),e(i,[{key:"type",get:function(){return this.property("type")}},{key:"context",get:function(){var t=this.property("context");return t||(this.is("jmGraph")&&this.canvas&&this.canvas.getContext?this.context=this.canvas.getContext(this.mode||"2d"):(t=this.graph)?t.context:t.canvas.getContext(this.mode||"2d"))},set:function(t){return this.property("context",t)}},{key:"style",get:function(){return this.property("style")||this.property("style",{})},set:function(t){return this.needUpdate=!0,this.property("style",t)}},{key:"visible",get:function(){var t=this.property("visible");return t=void 0===t?this.property("visible",!0):t},set:function(t){return this.needUpdate=!0,this.property("visible",t)}},{key:"interactive",get:function(){return this.property("interactive")},set:function(t){return this.property("interactive",t)}},{key:"children",get:function(){return this.property("children")||this.property("children",new p)},set:function(t){return this.needUpdate=!0,this.property("children",t)}},{key:"width",get:function(){var t=this.property("width");return t=void 0===t?this.property("width",0):t},set:function(t){return this.needUpdate=!0,this.property("width",t)}},{key:"height",get:function(){var t=this.property("height");return t=void 0===t?this.property("height",0):t},set:function(t){return this.needUpdate=!0,this.property("height",t)}},{key:"zIndex",get:function(){return this.property("zIndex")||this.property("zIndex",0)},set:function(t){return this.property("zIndex",t),this.children.sort(),this.needUpdate=!0,t}},{key:"cursor",get:function(){var t=this.graph;if(t)return t.css("cursor")},set:function(t){var e=this.graph;e&&e.css("cursor",t)}},{key:"initializing",value:function(){var e=this,n=(this.children=this.children||new p,this.children.add);this.children.add=function(t){if("object"===y(t))return t.parent&&t.parent!=e&&t.parent.children&&t.parent.children.remove(t),t.parent=e,this.contain(t)&&this.oremove(t),n.call(this,t),t.emit("add",t),e.needUpdate=!0,e.graph&&(t.graph=e.graph),this.sort(),t},this.children.oremove=this.children.remove,this.children.remove=function(t){"object"===y(t)&&(t.parent=null,t.graph=null,t.remove(!0),this.oremove(t),e.needUpdate=!0)},this.children.sort=function(){var t,i={};for(t in this.each(function(t,e){var n;e&&(!(n=e.zIndex)&&e.style&&e.style.zIndex&&(n=Number(e.style.zIndex),isNaN(n))&&(n=e.style.zIndex||0),(i[n]||(i[n]=[])).push(e))}),this.splice(0,this.length),i)n.call(this,i[t])},this.children.clear=function(){this.each(function(t,e){this.remove(e)},!0)},this.needUpdate=!0}},{key:"setStyle",value:function(t){var s=this;if(t=t||g.clone(this.style,!0)){var e,n,a=function(t,e,n){if(t){var i=t;if("function"==typeof i)try{i=i.call(s)}catch(t){return void console.warn(t)}var r=y(i),t=ft[n||e];if(i instanceof x||"string"==r&&-1<i.indexOf("-gradient"))"string"==r&&-1<i.indexOf("-gradient")&&(i=new x(i)),a(i.toGradient(s),t||e);else if(t)s.webglControl?s.webglControl.setStyle(t,i):("string"==r&&-1<["fillStyle","strokeStyle","shadowColor"].indexOf(t)&&(i=g.toColor(i)),s.context[t]=i);else switch(e){case"shadow":if("string"==r)a(new m(i),e);else for(var o in i)a(i[o],o,e+"."+o);break;case"translate":break;case"rotation":void 0===i.angle||isNaN(i.angle)||(i=s.getRotation(i),s.__translateAbsolutePosition=s.toAbsolutePoint({x:i.x,y:i.y}),s.context.translate&&s.context.translate(s.__translateAbsolutePosition.x,s.__translateAbsolutePosition.y),s.context.rotate&&s.context.rotate(i.angle),s.context.translate&&s.context.translate(-s.__translateAbsolutePosition.x,-s.__translateAbsolutePosition.y));break;case"transform":s.context.transform&&(Array.isArray(i)?s.context.transform.apply(s.context,i):"object"==y(i)&&s.context.transform(i.scaleX||1,i.skewX||0,i.skewY||0,i.scaleY||1,i.offsetX||0,i.offsetY||0));break;case"cursor":s.cursor=i}}};for(e in this.translate&&a(this.translate,"translate"),this.transform&&a(this.transform,"transform"),t)"constructor"!==e&&("string"==(n=y(t[e]))&&-1<t[e].indexOf("-gradient")?t[e]=new x(t[e]):"string"==n&&"shadow"==e&&(t[e]=new m(t[e])),a(t[e],e))}}},{key:"getBounds",value:function(t){if(this.bounds&&!t)return this.bounds;var e={};if("jmGraph"==this.type&&this.canvas)"function"==typeof this.canvas.width?e.right=this.canvas.width():this.width&&(e.right=this.width),"function"==typeof this.canvas.height?e.bottom=this.canvas.height():this.height&&(e.bottom=this.height);else if(this.points&&0<this.points.length){var n,i=u(this.points);try{for(i.s();!(n=i.n()).done;){var r=n.value;(void 0===e.left||e.left>r.x)&&(e.left=r.x),(void 0===e.top||e.top>r.y)&&(e.top=r.y),(void 0===e.right||e.right<r.x)&&(e.right=r.x),(void 0===e.bottom||e.bottom<r.y)&&(e.bottom=r.y)}}catch(t){i.e(t)}finally{i.f()}}else this.getLocation&&(t=this.getLocation())&&(e.left=t.left,e.top=t.top,e.right=t.left+t.width,e.bottom=t.top+t.height);return e.left||(e.left=0),e.top||(e.top=0),e.right||(e.right=0),e.bottom||(e.bottom=0),e.width=e.right-e.left,e.height=e.bottom-e.top,this.bounds=e}},{key:"getRotationBounds",value:function(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:null)||this.getRotation(),e=this.getBounds();if(!t||!t.angle)return e;var n,i,r={width:0,height:0,oldBounds:e},o=[],s=(this.points&&0<this.points.length?o=g.clone(this.points,!0):this.getLocation&&(n=this.getLocation())&&o.push({x:n.left,y:n.top},{x:n.left+n.width,y:n.top},{x:n.left+n.width,y:n.top+n.height},{x:n.left,y:n.top+n.height}),u(o=g.rotatePoints(o,{x:t.x+e.left,y:t.y+e.top},t.angle)));try{for(s.s();!(i=s.n()).done;){var a=i.value;(void 0===r.left||r.left>a.x)&&(r.left=a.x),(void 0===r.top||r.top>a.y)&&(r.top=a.y),(void 0===r.right||r.right<a.x)&&(r.right=a.x),(void 0===r.bottom||r.bottom<a.y)&&(r.bottom=a.y)}}catch(t){s.e(t)}finally{s.f()}return r.left||(r.left=0),r.top||(r.top=0),r.right||(r.right=0),r.bottom||(r.bottom=0),r.width=r.right-r.left,r.height=r.bottom-r.top,r}},{key:"getLocation",value:function(){var t=this.location={left:0,top:0,width:0,height:0},e=(t.position="function"==typeof this.position?this.position():g.clone(this.position),t.center=this.center&&"function"==typeof this.center?this.center():g.clone(this.center),t.start=this.start&&"function"==typeof this.start?this.start():g.clone(this.start),t.end=this.end&&"function"==typeof this.end?this.end():g.clone(this.end),t.radius=this.radius,t.width=this.width,t.height=this.height,g.clone(this.style.margin,{}));return e.left=e.left||0,e.top=e.top||0,e.right=e.right||0,e.bottom=e.bottom||0,t.position?(t.left=t.position.x,t.top=t.position.y):(t.left=e.left,t.top=e.top),this.parent&&(e=this.parent.getBounds(),g.checkPercent(t.left)&&(t.left=g.percentToNumber(t.left)*e.width),g.checkPercent(t.top)&&(t.top=g.percentToNumber(t.top)*e.height),g.checkPercent(t.width)&&(t.width=g.percentToNumber(t.width)*e.width),g.checkPercent(t.height)&&(t.height=g.percentToNumber(t.height)*e.height),t.center&&(g.checkPercent(t.center.x)&&(t.center.x=g.percentToNumber(t.center.x)*e.width),g.checkPercent(t.center.y))&&(t.center.y=g.percentToNumber(t.center.y)*e.height),t.radius)&&g.checkPercent(t.radius)&&(t.radius=g.percentToNumber(t.radius)*Math.min(e.width,e.height)),t}},{key:"getRotation",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return(t=t||g.clone(this.style.rotation))?(e=e||this.getBounds(),void 0===t.x&&(t.x="50%"),void 0===t.y&&(t.y="50%"),g.checkPercent(t.x)&&(t.x=g.percentToNumber(t.x)*e.width),g.checkPercent(t.y)&&(t.y=g.percentToNumber(t.y)*e.height)):(t=this.parent&&this.parent.getRotation?this.parent.getRotation():null)&&(e=e||this.getBounds(),t.x-=e.left,t.y-=e.top),f(f({},t),{},{bounds:e})}},{key:"getTranslate",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return(t=t||this.style.translate)?(t={x:t.x||0,y:t.y||0},g.checkPercent(t.x)&&(!e&&this.parent&&(e=this.parent.getBounds()),t.x=g.percentToNumber(t.x)*e.width),g.checkPercent(t.y)&&(!e&&this.parent&&(e=this.parent.getBounds()),t.y=g.percentToNumber(t.y)*e.height),t):{x:0,y:0}}},{key:"remove",value:function(){this.parent&&this.parent.children.remove(this)}},{key:"offset",value:function(t,e,n,i){n=!1!==n;var r=this.getLocation(!0),o=!1;if(r.position&&(r.left+=t,r.top+=e,this.position.x=r.left,this.position.y=r.top,o=!0),r.center&&(this.center.x=r.center.x+t,this.center.y=r.center.y+e,o=!0),r.start&&"object"==y(r.start)&&(this.start.x=r.start.x+t,this.start.y=r.start.y+e,o=!0),r.end&&"object"==y(r.end)&&(this.end.x=r.end.x+t,this.end.y=r.end.y+e,o=!0),0==o&&this.cpoints){this.cpoints;var s=this.cpoints;if(s){for(var a=s.length,h=0;h<a;h++)s[h].x+=t,s[h].y+=e;o=!0}}if(0==o&&this.points){for(var l=this.points.length,u=0;u<l;u++)this.points[u].x+=t,this.points[u].y+=e;o=!0}this.emit("move",{offsetX:t,offsetY:e,trans:n,evt:i}),this.needUpdate=!0}},{key:"getAbsoluteBounds",value:function(){var t,e=this.getBounds();return this.parent&&this.parent.absoluteBounds?{left:(t=this.parent.absoluteBounds||this.parent.getAbsoluteBounds()).left+e.left,top:t.top+e.top,right:t.left+e.right,bottom:t.top+e.bottom,width:e.width,height:e.height}:e}},{key:"toAbsolutePoint",value:function(t){var e;return(t.x||t.y)&&(e=this.absoluteBounds||this.getAbsoluteBounds(),t.x=(t.x||0)+e.left,t.y=(t.y||0)+e.top),t}},{key:"toLocalPosition",value:function(t){var e=this.absoluteBounds||this.getAbsoluteBounds();return!!e&&{x:t.x-e.left,y:t.y-e.top}}},{key:"beginDraw",value:function(){this.getLocation(!0),this.context.beginPath&&this.context.beginPath(),this.webglControl&&this.webglControl.beginDraw&&this.webglControl.beginDraw()}},{key:"endDraw",value:function(){this.style.close&&(this.webglControl&&this.webglControl.closePath(),this.context.closePath)&&this.context.closePath();var t,e=this.style.fill||this.style.fillStyle;e&&(this.webglControl&&(t=this.getBounds(),this.webglControl.fill(t)),this.context.fill)&&this.context.fill(),(this.style.stroke||!e&&!this.is("jmGraph"))&&(this.webglControl&&this.webglControl.stroke(),this.context.stroke)&&this.context.stroke(),this.webglControl&&this.webglControl.endDraw&&this.webglControl.endDraw(),this.needUpdate=!1}},{key:"draw",value:function(){if(this.points&&0<this.points.length){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(this.webglControl)this.webglControl.setParentBounds(t),this.webglControl.draw(d(this.points));else if(this.context&&this.context.moveTo){this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top);for(var e=this.points.length,n=1;n<e;n++){var i=this.points[n];i.m?this.context.moveTo(i.x+t.left,i.y+t.top):this.context.lineTo(i.x+t.left,i.y+t.top)}}}}},{key:"paint",value:function(t){!1!==t&&!1!==this.visible&&(this.initPoints&&this.initPoints(),this.bounds=null,this.absoluteBounds=this.getAbsoluteBounds(),t=!0,!this.is("jmGraph")&&this.graph&&(this.absoluteBounds.left>=this.graph.width||this.absoluteBounds.top>=this.graph.height||this.absoluteBounds.right<=0||this.absoluteBounds.bottom<=0)&&(t=!1),this.context.save&&this.context.save(),this.emit("beginDraw",this),this.setStyle(),t&&this.beginDraw&&this.beginDraw(),t&&this.draw&&this.draw(),t&&this.endDraw&&this.endDraw(),this.children&&this.children.each(function(t,e){e&&e.paint&&e.paint()}),this.emit("endDraw",this),this.context.restore&&this.context.restore(),this.needUpdate=!1)}},{key:"getEvent",value:function(t){return this.__events?this.__events[t]:null}},{key:"bind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.bind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t)||function(t,e){return this.__events||(this.__events={}),this.__events[t]=e}.call(this,t,new p);t.contain(e)||t.add(e)}}},{key:"unbind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.unbind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t);t&&(e?t.remove(e):t.clear())}}},{key:"emit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.runEventHandle(e[0],e.slice(1)),this}},{key:"runEventHandle",value:function(t,n){var i,t=this.getEvent(t);return t&&(i=this,Array.isArray(n)||(n=[n]),t.each(function(t,e){!1===e.apply(i,n)&&(n.cancel=!0)})),n.cancel}},{key:"checkPoint",value:function(t,e){var n;if("jmGraph"==this.type)return i=(n=this.getPosition()).left+this.width,o=n.top+this.height,!(t.pageX>i||t.pageX<n.left||o<t.pageY||t.pageY<n.top);var i=this.getBounds(),r=this.points;if(r&&r.length||((r=[]).push({x:i.left,y:i.top}),r.push({x:i.right,y:i.top}),r.push({x:i.right,y:i.bottom}),r.push({x:i.left,y:i.bottom}),r.push({x:i.left,y:i.top})),e=Number(e||this.style.touchPadding||this.style.lineWidth||1),r&&r.length){var o=this.getRotation(null,i);if(o&&0!=o.angle&&(r=g.clone(r,!0),r=g.rotatePoints(r,{x:o.x+i.left,y:o.y+i.top},o.angle)),2<r.length&&(!this.style.fill||this.style.stroke)){for(var s=0,a=r.length,h=s+1;h<=a;h=++s+1)if(h==a){if(this.style.close)if(g.pointInPolygon(t,[r[s],r[0]],e))return!0}else if(g.pointInPolygon(t,[r[s],r[h]],e))return!0;if(!this.style.fill)return!1}return g.pointInPolygon(t,r,e)}return!(t.x>i.right||t.x<i.left||t.y>i.bottom||t.y<i.top)}},{key:"raiseEvent",value:function(n,i){if(!1!==this.visible){i.position||(this.graph,e=i.srcElement||i.target,t=g.getEventPosition(i),i={position:t,button:0==i.button||t.isTouch?1:i.button,keyCode:i.keyCode||i.charCode||i.which,ctrlKey:i.ctrlKey,cancel:!1,event:i,srcElement:e}),i.path=i.path||[];var r=!1;if(this.children&&this.children.each(function(t,e){if(!0!==i.cancel&&(r=!1===e.raiseEvent(n,i)||r))return!1},!0),r)return!1;var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(!t)return!1;i.position.x=i.position.offsetX-t.left,i.position.y=i.position.offsetY-t.top;var e=!1!==this.interactive&&this.checkPoint(i.position);return e?(i.target||(i.target=this),this.runEventAndPopEvent(n,i),this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!0,this.raiseEvent("mousemove"===n?"mouseover":"touchover",i))):!1===this.interactive||e||!this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!1,this.runEventHandle("mousemove"===n?"mouseleave":"touchleave",i)),!1===i.cancel}}},{key:"runEventAndPopEvent",value:function(t,e){!0!==e.cancel&&(e.path.push(this),this.runEventHandle(t,e))}},{key:"clearEvents",value:function(t){t=this.getEvent(t);t&&t.clear}},{key:"findParent",value:function(t){if("string"==typeof t){if(this.type==t)return this}else if(this.is(t))return this;return this.parent?this.parent.findParent(t):null}},{key:"canMove",value:function(t,e){var s;return this.__mvMonitor||(this.__mvMonitor={},this.__mvMonitor.mouseDown=!1,this.__mvMonitor.curposition={x:0,y:0},(s=this).__mvMonitor.mv=function(t){var e,n,i,r,o=s;if(o.__mvMonitor.mouseDown)return o.parent.bounds=null,r=o.parent.getAbsoluteBounds(),e=t.position.offsetX-o.__mvMonitor.curposition.x,n=t.position.offsetY-o.__mvMonitor.curposition.y,o.lockSide&&(i=o.bounds||o.getAbsoluteBounds(),(r=g.checkOutSide(r,i,{x:e,y:n})).left<0?o.lockSide.left&&(e-=r.left):0<r.right&&o.lockSide.right&&(e-=r.right),r.top<0?o.lockSide.top&&(n-=r.top):0<r.bottom&&o.lockSide.bottom&&(n-=r.bottom)),(e||n)&&(o.offset(e,n,!0,t),o.__mvMonitor.curposition.x=t.position.offsetX,o.__mvMonitor.curposition.y=t.position.offsetY),!1},this.__mvMonitor.mu=function(t){var e=s;e.__mvMonitor.mouseDown&&(e.__mvMonitor.mouseDown=!1,e.emit("moveend",{position:e.__mvMonitor.curposition}))},this.__mvMonitor.ml=function(){var t=s;if(t.__mvMonitor.mouseDown)return t.__mvMonitor.mouseDown=!1,t.emit("moveend",{position:t.__mvMonitor.curposition}),!1},this.__mvMonitor.md=function(t){return!this.__mvMonitor.mouseDown&&(0==t.button||1==t.button)?(this.__mvMonitor.mouseDown=!0,this.__mvMonitor.curposition.x=t.position.offsetX,this.__mvMonitor.curposition.y=t.position.offsetY,this.emit("movestart",{position:this.__mvMonitor.curposition}),!(t.cancel=!0)):void 0}),e=e||this.graph,!1!==t?(e.bind("mousemove",this.__mvMonitor.mv),e.bind("mouseup",this.__mvMonitor.mu),e.bind("mouseleave",this.__mvMonitor.ml),this.bind("mousedown",this.__mvMonitor.md),e.bind("touchmove",this.__mvMonitor.mv),e.bind("touchend",this.__mvMonitor.mu),this.bind("touchstart",this.__mvMonitor.md)):(e.unbind("mousemove",this.__mvMonitor.mv),e.unbind("mouseup",this.__mvMonitor.mu),e.unbind("mouseleave",this.__mvMonitor.ml),this.unbind("mousedown",this.__mvMonitor.md),e.unbind("touchmove",this.__mvMonitor.mv),e.unbind("touchend",this.__mvMonitor.mu),this.unbind("touchstart",this.__mvMonitor.md)),this.interactive=!0,this}}])})(),vt=(()=>{function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPath";return l(this,n),(e=h(this,n,[t,e])).points=t&&t.points?t.points:[],e}return c(n,O),e(n,[{key:"points",get:function(){return this.property("points")},set:function(t){return this.needUpdate=!0,this.property("points",t)}}])})(),dt=(()=>{function o(t,e,n){var i,r;return l(this,o),"function"==typeof e&&(n=e,e={}),(e=e||{}).interactive=!0,e.isRegular=!0,(i=h(this,o,[e,"jmGraph"])).option=e||{},i.devicePixelRatio=1,i.util=i.utils=g,i.mode=e.mode||"2d","undefined"!=typeof wx&&wx.canIUse&&wx.canIUse("canvas")?("string"==typeof t&&(t=wx.createSelectorQuery().select("#"+t)),i.isWXMiniApp=!0,i.container=t):("string"==typeof t&&"undefined"!=typeof document?t=document.getElementById(t):t.length&&(t=t[0]),t.getContext||"undefined"==typeof document?i.container=t.parentElement:(i.container=t,r=document.createElement("canvas"),t.appendChild(r),r.width=t.offsetWidth||t.clientWidth,r.height=t.offsetHeight||t.clientHeight,t=r)),i.canvas=t,i.context=t.getContext(i.mode),i.textureCanvas=e.textureCanvas||null,"webgl"===i.mode&&(i.context.enable(i.context.BLEND),i.context.blendFunc(i.context.SRC_ALPHA,i.context.ONE_MINUS_SRC_ALPHA),g.bindEvent(t,"webglcontextlost",function(t){console.log("canvas webglcontextlost",t),i.emit("webglcontextlost",t)}),g.bindEvent(t,"webglcontextrestored",function(t){console.log("canvas webglcontextrestored",t),i.emit("webglcontextrestored",t)})),i.__init(n),i}return c(o,O),e(o,[{key:"__init",value:function(t){this.shapes=Object.assign({path:vt},this.option.shapes),this.on("beginDraw",function(){this.context.translate&&this.context.translate(.5,.5)}),this.on("endDraw",function(){this.context.translate&&this.context.translate(-.5,-.5)});var e="undefined"!=typeof window&&1<window.devicePixelRatio?window.devicePixelRatio:1;this.isWXMiniApp&&(e=wx.getWindowInfo().pixelRatio||1),this.devicePixelRatio=e,this.dprScaleSize=1<this.devicePixelRatio?this.devicePixelRatio:2,0<this.option.width&&(this.width=this.option.width),0<this.option.height&&(this.height=this.option.height),this.resize(),this.eventHandler=new Y(this,this.canvas.canvas||this.canvas),this.option.autoRefresh&&this.autoRefresh(),t&&t(this)}},{key:"resize",value:function(t,e){this.canvas&&(this.__normalSize=this.__normalSize||{width:0,height:0},t=t||this.__normalSize.width||this.width,e=e||this.__normalSize.height||this.height,t&&(this.__normalSize.width=t),e&&(this.__normalSize.height=e),this.css("width",t+"px"),this.css("height",e+"px"),"2d"===this.mode?(this.canvas.height=e*this.dprScaleSize,this.canvas.width=t*this.dprScaleSize,1!==this.dprScaleSize&&this.context.scale&&this.context.scale(this.dprScaleSize,this.dprScaleSize)):(this.canvas.width=t,this.canvas.height=e),this.context.viewport&&this.context.viewport(0,0,t,e),this.needUpdate=!0)}},{key:"width",get:function(){return this.__normalSize&&this.__normalSize.width?this.__normalSize.width:this.canvas?this.canvas.width:0},set:function(t){return this.needUpdate=!0,this.canvas&&this.resize(t),t}},{key:"height",get:function(){return this.__normalSize&&this.__normalSize.height?this.__normalSize.height:this.canvas?this.canvas.height:0},set:function(t){return this.needUpdate=!0,this.canvas&&this.resize(0,t),t}},{key:"getPosition",value:function(){var t=g.getElementPosition(this.canvas.canvas||this.canvas);return t.width=this.width,t.height=this.height,t.right=t.left+t.width,t.bottom=t.top+t.height,t}},{key:"registerShape",value:function(t,e){this.shapes[t]=e}},{key:"createShape",value:function(t,e){if(t="string"==typeof t?this.shapes[t]:t)return(e=e||{}).graph=this,new t(e)}},{key:"createShadow",value:function(t,e,n,i){return new m(t,e,n,i)}},{key:"createLinearGradient",value:function(t,e,n,i){return new x({type:"linear",x1:t,y1:e,x2:n,y2:i,stops:4<arguments.length&&void 0!==arguments[4]?arguments[4]:[]})}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return new x({type:"radial",x1:t,y1:e,r1:n,x2:i,y2:r,r2:o,stops:6<arguments.length&&void 0!==arguments[6]?arguments[6]:[]})}},{key:"refresh",value:function(){this.redraw()}},{key:"redraw",value:function(t,e){this.clear(t||this.width,e||this.height),this.paint()}},{key:"clear",value:function(t,e){t&&e||(t=this.width,e=this.height),this.context.clearRect?(this.style&&this.style.fill&&(this.points=[{x:0,y:0},{x:t,y:0},{x:t,y:e},{x:0,y:e}],this.style.close=!0),this.context.clearRect(0,0,t,e)):"webgl"===this.mode&&this.context.clear&&(t=this.style&&this.style.fill?this.utils.hexToRGBA(this.style.fill):{r:0,g:0,b:0,a:0},this.context.clearColor(t.r,t.g,t.b,t.a),this.context.clear(this.context.COLOR_BUFFER_BIT))}},{key:"css",value:function(t,e){if(this.canvas&&this.canvas.style)return void 0!==e&&(this.canvas.style[t]=e),this.canvas.style[t]}},{key:"createPath",value:function(t,e){return this.createShape("path",f({points:t,style:e},2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}))}},{key:"createLine",value:function(t,e,n){return this.createShape("line",{start:t,end:e,style:n})}},{key:"zoomOut",value:function(){this.scale(.9,.9)}},{key:"zoomIn",value:function(){this.scale(1.1,1.1)}},{key:"zoomActual",value:function(){this.scaleSize?this.scale(1/this.scaleSize.x,1/this.scaleSize.y):this.scale(1,1)}},{key:"scale",value:function(t,e){this.normalSize||(this.normalSize={width:this.canvas.width,height:this.canvas.height}),this.scaleSize?this.scaleSize={x:t*this.scaleSize.x,y:e*this.scaleSize.y}:this.scaleSize={x:1,y:1},this.canvas.style&&(this.canvas.style.transform="scale(".concat(this.scaleSize.x,", ").concat(this.scaleSize.y,")"))}},{key:"toDataURL",value:function(){return this.canvas.toDataURL?this.canvas.toDataURL():""}},{key:"autoRefresh",value:function(n){var i,r;if(!this.___isAutoRefreshing)return(i=this).___isAutoRefreshing=!0,r=Date.now(),i.__requestAnimationFrameFunHandler&&this.cancelAnimationFrame(i.__requestAnimationFrameFunHandler),i.__requestAnimationFrameFunHandler=this.requestAnimationFrame(function t(){var e;i.destroyed?i.___isAutoRefreshing=!1:(i.needUpdate&&i.redraw(),e=Date.now()-r,i.emit("update",e),i.__requestAnimationFrameFunHandler&&i.cancelAnimationFrame(i.__requestAnimationFrameFunHandler),i.__requestAnimationFrameFunHandler=i.requestAnimationFrame(t),n&&n())}),this}},{key:"destroy",value:function(){this.eventHandler.destroy(),this.destroyed=!0}}],[{key:"create",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(o,e)}}])})();t.default=dt,t.jmControl=O,t.jmEvents=Y,t.jmGradient=x,t.jmGraph=dt,t.jmList=p,t.jmPath=vt,t.jmProperty=H,t.jmShadow=m,t.jmUtils=g,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=jmgraph.core.min.js.map
|