create-ssnode-cli 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/backend/config/config.develop.yaml +6 -4
- package/templates/backend/data/template.dev.sqlite-shm +0 -0
- package/templates/backend/data/template.dev.sqlite-wal +0 -0
- package/templates/backend/dist/app.module.js +85 -1
- package/templates/backend/dist/app.module.js.map +1 -1
- package/templates/backend/dist/common/all-exceptions.filter.js +47 -1
- package/templates/backend/dist/common/all-exceptions.filter.js.map +1 -1
- package/templates/backend/dist/common/app-crypto.js +119 -1
- package/templates/backend/dist/common/app-crypto.js.map +1 -1
- package/templates/backend/dist/common/app-sign.guard.js +72 -1
- package/templates/backend/dist/common/app-sign.guard.js.map +1 -1
- package/templates/backend/dist/common/app-sign.module.js +20 -1
- package/templates/backend/dist/common/app-sign.module.js.map +1 -1
- package/templates/backend/dist/common/response.js +23 -1
- package/templates/backend/dist/common/response.js.map +1 -1
- package/templates/backend/dist/common/throttle.guard.js +42 -1
- package/templates/backend/dist/common/throttle.guard.js.map +1 -1
- package/templates/backend/dist/common/transform.interceptor.js +28 -1
- package/templates/backend/dist/common/transform.interceptor.js.map +1 -1
- package/templates/backend/dist/config/config.interface.js +2 -1
- package/templates/backend/dist/config/config.interface.js.map +1 -1
- package/templates/backend/dist/config/configuration.js +91 -1
- package/templates/backend/dist/config/configuration.js.map +1 -1
- package/templates/backend/dist/database/migrations/0001-init.migration.js +69 -1
- package/templates/backend/dist/database/migrations/0001-init.migration.js.map +1 -1
- package/templates/backend/dist/database/sqlite.config.js +32 -1
- package/templates/backend/dist/database/sqlite.config.js.map +1 -1
- package/templates/backend/dist/entities/audit-log.entity.js +49 -1
- package/templates/backend/dist/entities/audit-log.entity.js.map +1 -1
- package/templates/backend/dist/entities/image.entity.js +50 -1
- package/templates/backend/dist/entities/image.entity.js.map +1 -1
- package/templates/backend/dist/entities/page-data.entity.js +60 -1
- package/templates/backend/dist/entities/page-data.entity.js.map +1 -1
- package/templates/backend/dist/entities/screen-config.entity.js +74 -1
- package/templates/backend/dist/entities/screen-config.entity.js.map +1 -1
- package/templates/backend/dist/entities/user.entity.js +59 -1
- package/templates/backend/dist/entities/user.entity.js.map +1 -1
- package/templates/backend/dist/main.js +56 -1
- package/templates/backend/dist/main.js.map +1 -1
- package/templates/backend/dist/modules/audit/audit.controller.js +51 -1
- package/templates/backend/dist/modules/audit/audit.controller.js.map +1 -1
- package/templates/backend/dist/modules/audit/audit.module.js +25 -1
- package/templates/backend/dist/modules/audit/audit.module.js.map +1 -1
- package/templates/backend/dist/modules/audit/audit.service.js +57 -1
- package/templates/backend/dist/modules/audit/audit.service.js.map +1 -1
- package/templates/backend/dist/modules/auth/auth.controller.js +74 -1
- package/templates/backend/dist/modules/auth/auth.controller.js.map +1 -1
- package/templates/backend/dist/modules/auth/auth.module.js +45 -1
- package/templates/backend/dist/modules/auth/auth.module.js.map +1 -1
- package/templates/backend/dist/modules/auth/auth.service.js +151 -1
- package/templates/backend/dist/modules/auth/auth.service.js.map +1 -1
- package/templates/backend/dist/modules/auth/captcha.service.js +56 -1
- package/templates/backend/dist/modules/auth/captcha.service.js.map +1 -1
- package/templates/backend/dist/modules/auth/jwt-auth.guard.js +17 -1
- package/templates/backend/dist/modules/auth/jwt-auth.guard.js.map +1 -1
- package/templates/backend/dist/modules/auth/jwt.strategy.js +37 -1
- package/templates/backend/dist/modules/auth/jwt.strategy.js.map +1 -1
- package/templates/backend/dist/modules/image/image.controller.js +75 -1
- package/templates/backend/dist/modules/image/image.controller.js.map +1 -1
- package/templates/backend/dist/modules/image/image.module.js +26 -1
- package/templates/backend/dist/modules/image/image.module.js.map +1 -1
- package/templates/backend/dist/modules/image/image.service.js +94 -1
- package/templates/backend/dist/modules/image/image.service.js.map +1 -1
- package/templates/backend/dist/modules/ops/backend-version.probe.js +58 -1
- package/templates/backend/dist/modules/ops/backend-version.probe.js.map +1 -1
- package/templates/backend/dist/modules/ops/ops-probe.interface.js +4 -1
- package/templates/backend/dist/modules/ops/ops-probe.interface.js.map +1 -1
- package/templates/backend/dist/modules/ops/ops.controller.js +52 -1
- package/templates/backend/dist/modules/ops/ops.controller.js.map +1 -1
- package/templates/backend/dist/modules/ops/ops.module.js +39 -1
- package/templates/backend/dist/modules/ops/ops.module.js.map +1 -1
- package/templates/backend/dist/modules/ops/ops.service.js +72 -1
- package/templates/backend/dist/modules/ops/ops.service.js.map +1 -1
- package/templates/backend/dist/modules/ops/sqlite-backup-list.probe.js +105 -1
- package/templates/backend/dist/modules/ops/sqlite-backup-list.probe.js.map +1 -1
- package/templates/backend/dist/modules/ops/sqlite-backup-log.probe.js +67 -1
- package/templates/backend/dist/modules/ops/sqlite-backup-log.probe.js.map +1 -1
- package/templates/backend/dist/modules/ops/sqlite-backup.probe.js +115 -1
- package/templates/backend/dist/modules/ops/sqlite-backup.probe.js.map +1 -1
- package/templates/backend/dist/modules/ops/version.controller.js +52 -1
- package/templates/backend/dist/modules/ops/version.controller.js.map +1 -1
- package/templates/backend/dist/modules/page-data/page-data.controller.js +109 -1
- package/templates/backend/dist/modules/page-data/page-data.controller.js.map +1 -1
- package/templates/backend/dist/modules/page-data/page-data.module.js +25 -1
- package/templates/backend/dist/modules/page-data/page-data.module.js.map +1 -1
- package/templates/backend/dist/modules/page-data/page-data.service.js +69 -1
- package/templates/backend/dist/modules/page-data/page-data.service.js.map +1 -1
- package/templates/backend/dist/modules/screen-config/screen-config.controller.js +61 -1
- package/templates/backend/dist/modules/screen-config/screen-config.controller.js.map +1 -1
- package/templates/backend/dist/modules/screen-config/screen-config.module.js +25 -1
- package/templates/backend/dist/modules/screen-config/screen-config.module.js.map +1 -1
- package/templates/backend/dist/modules/screen-config/screen-config.service.js +41 -1
- package/templates/backend/dist/modules/screen-config/screen-config.service.js.map +1 -1
- package/templates/backend/dist/modules/upload/upload.controller.js +65 -1
- package/templates/backend/dist/modules/upload/upload.controller.js.map +1 -1
- package/templates/backend/dist/modules/upload/upload.module.js +22 -1
- package/templates/backend/dist/modules/upload/upload.module.js.map +1 -1
- package/templates/backend/dist/modules/upload/upload.service.js +75 -1
- package/templates/backend/dist/modules/upload/upload.service.js.map +1 -1
- package/templates/backend/dist/modules/user/user.controller.js +149 -1
- package/templates/backend/dist/modules/user/user.controller.js.map +1 -1
- package/templates/backend/dist/modules/user/user.module.js +26 -1
- package/templates/backend/dist/modules/user/user.module.js.map +1 -1
- package/templates/backend/dist/modules/user/user.service.js +249 -1
- package/templates/backend/dist/modules/user/user.service.js.map +1 -1
- package/templates/backend/dist/modules/websocket/websocket.gateway.js +33 -1
- package/templates/backend/dist/modules/websocket/websocket.gateway.js.map +1 -1
- package/templates/backend/dist/modules/websocket/websocket.module.js +19 -1
- package/templates/backend/dist/modules/websocket/websocket.module.js.map +1 -1
- package/templates/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/templates/backend/package.json +1 -1
- package/templates/backend/src/modules/auth/captcha.service.ts +6 -5
- package/templates/web/dist/assets/{AuthLayout-bcf98efb.js → AuthLayout-f1e8d110.js} +1 -1
- package/templates/web/dist/assets/{AuthLayout-legacy-6e7a8ae1.js → AuthLayout-legacy-f871651c.js} +1 -1
- package/templates/web/dist/assets/{Background-eb77ef54.js → Background-955d549f.js} +1 -1
- package/templates/web/dist/assets/{Background-legacy-50457007.js → Background-legacy-fbad6e76.js} +1 -1
- package/templates/web/dist/assets/{Screen-318c3fc2.js → Screen-b14b0813.js} +1 -1
- package/templates/web/dist/assets/{Screen-legacy-af123b0f.js → Screen-legacy-154c8ee6.js} +1 -1
- package/templates/web/dist/assets/{api-beff4a3e.js → api-4d80e36e.js} +1 -1
- package/templates/web/dist/assets/{api-legacy-9fe41d4b.js → api-legacy-054fd569.js} +1 -1
- package/templates/web/dist/assets/{component-89b5253e.js → component-9d9f33fa.js} +1 -1
- package/templates/web/dist/assets/{component-legacy-8c5a28ef.js → component-legacy-4445386a.js} +1 -1
- package/templates/web/dist/assets/{index-a79e448b.js → index-107a0e80.js} +1 -1
- package/templates/web/dist/assets/{index-b60badf7.js → index-5afb70be.js} +1 -1
- package/templates/web/dist/assets/{index-cba19800.js → index-7b807c2d.js} +1 -1
- package/templates/web/dist/assets/{index-86214b19.js → index-ab64cd34.js} +1 -1
- package/templates/web/dist/assets/{index-7277cbfb.js → index-d8bfffb3.js} +1 -1
- package/templates/web/dist/assets/{index-d70eb540.js → index-db169639.js} +1 -1
- package/templates/web/dist/assets/{index-bd4ed808.js → index-e08dc495.js} +1 -1
- package/templates/web/dist/assets/index-e31f4b7c.js +1 -0
- package/templates/web/dist/assets/{index-legacy-783129a7.js → index-legacy-5cf7be80.js} +1 -1
- package/templates/web/dist/assets/index-legacy-6f112001.js +1 -0
- package/templates/web/dist/assets/{index-legacy-b3bd40c1.js → index-legacy-91e012ac.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-0da8de82.js → index-legacy-aa61cf72.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-06483318.js → index-legacy-afba9135.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-d510e318.js → index-legacy-da51c769.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-993ef005.js → index-legacy-eec0ca6e.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-feb54578.js → index-legacy-f732db29.js} +1 -1
- package/templates/web/dist/index.html +2 -2
- package/templates/web/node_modules/.vite/deps/@ant-design_icons.js +4 -4
- package/templates/web/node_modules/.vite/deps/_metadata.json +57 -57
- package/templates/web/node_modules/.vite/deps/antd.js +6 -6
- package/templates/web/node_modules/.vite/deps/antd_locale_zh_CN.js +1 -1
- package/templates/web/node_modules/.vite/deps/axios.js +2793 -1104
- package/templates/web/node_modules/.vite/deps/axios.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/{chunk-FADIZLW4.js → chunk-3EE4ABTD.js} +3 -3
- package/templates/web/node_modules/.vite/deps/{chunk-5JEEJ3ET.js → chunk-3KXTUEQ5.js} +2 -2
- package/templates/web/node_modules/.vite/deps/{chunk-DSEUD2VO.js → chunk-622VOE6C.js} +28 -237
- package/templates/web/node_modules/.vite/deps/chunk-622VOE6C.js.map +7 -0
- package/templates/web/node_modules/.vite/deps/{chunk-PCLWPLHU.js → chunk-AX2S74EI.js} +4 -4
- package/templates/web/node_modules/.vite/deps/{chunk-UX3FVGZU.js → chunk-DXNXWKU4.js} +1670 -1309
- package/templates/web/node_modules/.vite/deps/chunk-DXNXWKU4.js.map +7 -0
- package/templates/web/node_modules/.vite/deps/{chunk-OTDKR2HU.js → chunk-GT2UP6M4.js} +2 -2
- package/templates/web/node_modules/.vite/deps/{chunk-5WWUZCGV.js → chunk-HM4MQYWN.js} +10 -2
- package/templates/web/node_modules/.vite/deps/{chunk-Z4XTF2JV.js → chunk-NDUAOA7M.js} +2 -2
- package/templates/web/node_modules/.vite/deps/{chunk-PIIG5WB7.js → chunk-OKY2XKJX.js} +14406 -12416
- package/templates/web/node_modules/.vite/deps/chunk-OKY2XKJX.js.map +7 -0
- package/templates/web/node_modules/.vite/deps/{chunk-UIM57Q7Y.js → chunk-SC6QO7UO.js} +6086 -4354
- package/templates/web/node_modules/.vite/deps/chunk-SC6QO7UO.js.map +7 -0
- package/templates/web/node_modules/.vite/deps/classnames.js +2 -2
- package/templates/web/node_modules/.vite/deps/dayjs.js +2 -2
- package/templates/web/node_modules/.vite/deps/dayjs_locale_zh-cn.js +2 -2
- package/templates/web/node_modules/.vite/deps/echarts_charts.js +7172 -6102
- package/templates/web/node_modules/.vite/deps/echarts_charts.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/echarts_components.js +3363 -1326
- package/templates/web/node_modules/.vite/deps/echarts_components.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/echarts_core.js +57 -42
- package/templates/web/node_modules/.vite/deps/echarts_core.js.map +3 -3
- package/templates/web/node_modules/.vite/deps/echarts_renderers.js +432 -334
- package/templates/web/node_modules/.vite/deps/echarts_renderers.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/exceljs.js +25762 -0
- package/templates/web/node_modules/.vite/deps/exceljs.js.map +7 -0
- package/templates/web/node_modules/.vite/deps/lodash.js +28 -10
- package/templates/web/node_modules/.vite/deps/lodash.js.map +3 -3
- package/templates/web/node_modules/.vite/deps/path-browserify.js +1 -1
- package/templates/web/node_modules/.vite/deps/prop-types.js +1 -1
- package/templates/web/node_modules/.vite/deps/qs.js +405 -138
- package/templates/web/node_modules/.vite/deps/qs.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/react-dom.js +3 -3
- package/templates/web/node_modules/.vite/deps/react-dom_client.js +3 -3
- package/templates/web/node_modules/.vite/deps/react-router-dom.js +3445 -1283
- package/templates/web/node_modules/.vite/deps/react-router-dom.js.map +4 -4
- package/templates/web/node_modules/.vite/deps/react.js +2 -2
- package/templates/web/node_modules/.vite/deps/react_jsx-dev-runtime.js +2 -2
- package/templates/web/node_modules/.vite/deps/recoil.js +3 -3
- package/templates/web/src/pages/Login/index.tsx +8 -1
- package/templates/web/src/services/api.ts +6 -1
- package/templates/web/vite.config.js +5 -5
- package/templates/web/dist/assets/index-e6071630.js +0 -1
- package/templates/web/dist/assets/index-legacy-028ed5d5.js +0 -1
- package/templates/web/node_modules/.vite/deps/chunk-DSEUD2VO.js.map +0 -7
- package/templates/web/node_modules/.vite/deps/chunk-PIIG5WB7.js.map +0 -7
- package/templates/web/node_modules/.vite/deps/chunk-UIM57Q7Y.js.map +0 -7
- package/templates/web/node_modules/.vite/deps/chunk-UX3FVGZU.js.map +0 -7
- package/templates/web/node_modules/.vite/deps/xlsx.js +0 -33827
- package/templates/web/node_modules/.vite/deps/xlsx.js.map +0 -7
- /package/templates/web/node_modules/.vite/deps/{chunk-FADIZLW4.js.map → chunk-3EE4ABTD.js.map} +0 -0
- /package/templates/web/node_modules/.vite/deps/{chunk-5JEEJ3ET.js.map → chunk-3KXTUEQ5.js.map} +0 -0
- /package/templates/web/node_modules/.vite/deps/{chunk-PCLWPLHU.js.map → chunk-AX2S74EI.js.map} +0 -0
- /package/templates/web/node_modules/.vite/deps/{chunk-OTDKR2HU.js.map → chunk-GT2UP6M4.js.map} +0 -0
- /package/templates/web/node_modules/.vite/deps/{chunk-5WWUZCGV.js.map → chunk-HM4MQYWN.js.map} +0 -0
- /package/templates/web/node_modules/.vite/deps/{chunk-Z4XTF2JV.js.map → chunk-NDUAOA7M.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HM4MQYWN.js";
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/platform.js
|
|
6
6
|
var DEFAULT_FONT_SIZE = 12;
|
|
7
7
|
var DEFAULT_FONT_FAMILY = "sans-serif";
|
|
8
8
|
var DEFAULT_FONT = DEFAULT_FONT_SIZE + "px " + DEFAULT_FONT_FAMILY;
|
|
@@ -42,7 +42,7 @@ var platformApi = {
|
|
|
42
42
|
} else {
|
|
43
43
|
text = text || "";
|
|
44
44
|
font = font || DEFAULT_FONT;
|
|
45
|
-
var res = /(
|
|
45
|
+
var res = /((?:\d+)?\.?\d*)px/.exec(font);
|
|
46
46
|
var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
|
|
47
47
|
var width = 0;
|
|
48
48
|
if (font.indexOf("mono") >= 0) {
|
|
@@ -63,22 +63,27 @@ var platformApi = {
|
|
|
63
63
|
image.onerror = onerror;
|
|
64
64
|
image.src = src;
|
|
65
65
|
return image;
|
|
66
|
+
},
|
|
67
|
+
getTime: function() {
|
|
68
|
+
return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
|
|
66
69
|
}
|
|
67
70
|
};
|
|
68
71
|
function setPlatformAPI(newPlatformApis) {
|
|
69
72
|
for (var key in platformApi) {
|
|
70
|
-
if (newPlatformApis[key]) {
|
|
73
|
+
if (platformApi.hasOwnProperty(key) && newPlatformApis[key]) {
|
|
71
74
|
platformApi[key] = newPlatformApis[key];
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
// ../../node_modules/.pnpm/zrender@
|
|
79
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/util.js
|
|
77
80
|
var util_exports = {};
|
|
78
81
|
__export(util_exports, {
|
|
82
|
+
EPSILON: () => EPSILON,
|
|
79
83
|
HashMap: () => HashMap,
|
|
80
84
|
RADIAN_TO_DEGREE: () => RADIAN_TO_DEGREE,
|
|
81
85
|
assert: () => assert,
|
|
86
|
+
assignProps: () => assignProps,
|
|
82
87
|
bind: () => bind,
|
|
83
88
|
clone: () => clone,
|
|
84
89
|
concatArray: () => concatArray,
|
|
@@ -165,7 +170,11 @@ var ctorFunction = (function() {
|
|
|
165
170
|
var protoFunction = ctorFunction ? ctorFunction.prototype : null;
|
|
166
171
|
var protoKey = "__proto__";
|
|
167
172
|
var idStart = 2311;
|
|
173
|
+
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
|
|
168
174
|
function guid() {
|
|
175
|
+
if (idStart >= MAX_SAFE_INTEGER) {
|
|
176
|
+
idStart = 0;
|
|
177
|
+
}
|
|
169
178
|
return idStart++;
|
|
170
179
|
}
|
|
171
180
|
function logError() {
|
|
@@ -248,9 +257,17 @@ function extend(target, source) {
|
|
|
248
257
|
}
|
|
249
258
|
return target;
|
|
250
259
|
}
|
|
260
|
+
function assignProps(tar, src, props) {
|
|
261
|
+
tar = tar || {};
|
|
262
|
+
for (var idx = 0; idx < props.length; idx++) {
|
|
263
|
+
var prop = props[idx];
|
|
264
|
+
tar[prop] = src[prop];
|
|
265
|
+
}
|
|
266
|
+
return tar;
|
|
267
|
+
}
|
|
251
268
|
function defaults(target, source, overlay) {
|
|
252
269
|
var keysArr = keys(source);
|
|
253
|
-
for (var i = 0
|
|
270
|
+
for (var i = 0, len2 = keysArr.length; i < len2; i++) {
|
|
254
271
|
var key = keysArr[i];
|
|
255
272
|
if (overlay ? source[key] != null : target[key] == null) {
|
|
256
273
|
target[key] = source[key];
|
|
@@ -633,8 +650,82 @@ function hasOwn(own, prop) {
|
|
|
633
650
|
function noop() {
|
|
634
651
|
}
|
|
635
652
|
var RADIAN_TO_DEGREE = 180 / Math.PI;
|
|
653
|
+
var EPSILON = Number.EPSILON || Math.pow(2, -52);
|
|
654
|
+
|
|
655
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/env.js
|
|
656
|
+
var Browser = function() {
|
|
657
|
+
function Browser2() {
|
|
658
|
+
this.firefox = false;
|
|
659
|
+
this.ie = false;
|
|
660
|
+
this.edge = false;
|
|
661
|
+
this.newEdge = false;
|
|
662
|
+
this.weChat = false;
|
|
663
|
+
}
|
|
664
|
+
return Browser2;
|
|
665
|
+
}();
|
|
666
|
+
var Env = function() {
|
|
667
|
+
function Env2() {
|
|
668
|
+
this.browser = new Browser();
|
|
669
|
+
this.node = false;
|
|
670
|
+
this.wxa = false;
|
|
671
|
+
this.worker = false;
|
|
672
|
+
this.svgSupported = false;
|
|
673
|
+
this.touchEventsSupported = false;
|
|
674
|
+
this.pointerEventsSupported = false;
|
|
675
|
+
this.domSupported = false;
|
|
676
|
+
this.transformSupported = false;
|
|
677
|
+
this.transform3dSupported = false;
|
|
678
|
+
this.hasGlobalWindow = typeof window !== "undefined";
|
|
679
|
+
}
|
|
680
|
+
return Env2;
|
|
681
|
+
}();
|
|
682
|
+
var env = new Env();
|
|
683
|
+
if (typeof wx === "object" && typeof wx.getSystemInfoSync === "function") {
|
|
684
|
+
env.wxa = true;
|
|
685
|
+
env.touchEventsSupported = true;
|
|
686
|
+
} else if (typeof document === "undefined" && typeof self !== "undefined") {
|
|
687
|
+
env.worker = true;
|
|
688
|
+
} else if (!env.hasGlobalWindow || "Deno" in window || typeof navigator !== "undefined" && typeof navigator.userAgent === "string" && navigator.userAgent.indexOf("Node.js") > -1) {
|
|
689
|
+
env.node = true;
|
|
690
|
+
env.svgSupported = true;
|
|
691
|
+
} else {
|
|
692
|
+
detect(navigator.userAgent, env);
|
|
693
|
+
}
|
|
694
|
+
function detect(ua, env2) {
|
|
695
|
+
var browser = env2.browser;
|
|
696
|
+
var firefox = ua.match(/Firefox\/([\d.]+)/);
|
|
697
|
+
var ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/);
|
|
698
|
+
var edge = ua.match(/Edge?\/([\d.]+)/);
|
|
699
|
+
var weChat = /micromessenger/i.test(ua);
|
|
700
|
+
if (firefox) {
|
|
701
|
+
browser.firefox = true;
|
|
702
|
+
browser.version = firefox[1];
|
|
703
|
+
}
|
|
704
|
+
if (ie) {
|
|
705
|
+
browser.ie = true;
|
|
706
|
+
browser.version = ie[1];
|
|
707
|
+
}
|
|
708
|
+
if (edge) {
|
|
709
|
+
browser.edge = true;
|
|
710
|
+
browser.version = edge[1];
|
|
711
|
+
browser.newEdge = +edge[1].split(".")[0] > 18;
|
|
712
|
+
}
|
|
713
|
+
if (weChat) {
|
|
714
|
+
browser.weChat = true;
|
|
715
|
+
}
|
|
716
|
+
env2.svgSupported = typeof SVGRect !== "undefined";
|
|
717
|
+
env2.touchEventsSupported = "ontouchstart" in window && !browser.ie && !browser.edge;
|
|
718
|
+
env2.pointerEventsSupported = "onpointerdown" in window && (browser.edge || browser.ie && +browser.version >= 11);
|
|
719
|
+
var domSupported = env2.domSupported = typeof document !== "undefined";
|
|
720
|
+
if (domSupported) {
|
|
721
|
+
var style = document.documentElement.style;
|
|
722
|
+
env2.transform3dSupported = (browser.ie && "transition" in style || browser.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in style) && !("OTransition" in style);
|
|
723
|
+
env2.transformSupported = env2.transform3dSupported || browser.ie && +browser.version >= 9;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
var env_default = env;
|
|
636
727
|
|
|
637
|
-
// ../../node_modules/.pnpm/zrender@
|
|
728
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/matrix.js
|
|
638
729
|
var matrix_exports = {};
|
|
639
730
|
__export(matrix_exports, {
|
|
640
731
|
clone: () => clone2,
|
|
@@ -749,7 +840,7 @@ function clone2(a) {
|
|
|
749
840
|
return b;
|
|
750
841
|
}
|
|
751
842
|
|
|
752
|
-
// ../../node_modules/.pnpm/zrender@
|
|
843
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/vector.js
|
|
753
844
|
var vector_exports = {};
|
|
754
845
|
__export(vector_exports, {
|
|
755
846
|
add: () => add,
|
|
@@ -888,7 +979,7 @@ function max(out, v1, v2) {
|
|
|
888
979
|
return out;
|
|
889
980
|
}
|
|
890
981
|
|
|
891
|
-
// ../../node_modules/.pnpm/zrender@
|
|
982
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/tool/color.js
|
|
892
983
|
var color_exports = {};
|
|
893
984
|
__export(color_exports, {
|
|
894
985
|
fastLerp: () => fastLerp,
|
|
@@ -901,12 +992,14 @@ __export(color_exports, {
|
|
|
901
992
|
modifyAlpha: () => modifyAlpha,
|
|
902
993
|
modifyHSL: () => modifyHSL,
|
|
903
994
|
parse: () => parse,
|
|
995
|
+
parseCssFloat: () => parseCssFloat,
|
|
996
|
+
parseCssInt: () => parseCssInt,
|
|
904
997
|
random: () => random,
|
|
905
998
|
stringify: () => stringify,
|
|
906
999
|
toHex: () => toHex
|
|
907
1000
|
});
|
|
908
1001
|
|
|
909
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1002
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/LRU.js
|
|
910
1003
|
var Entry = function() {
|
|
911
1004
|
function Entry2(val) {
|
|
912
1005
|
this.value = val;
|
|
@@ -1012,7 +1105,7 @@ var LRU = function() {
|
|
|
1012
1105
|
}();
|
|
1013
1106
|
var LRU_default = LRU;
|
|
1014
1107
|
|
|
1015
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1108
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/tool/color.js
|
|
1016
1109
|
var kCSSColorTable = {
|
|
1017
1110
|
"transparent": [0, 0, 0, 0],
|
|
1018
1111
|
"aliceblue": [240, 248, 255, 1],
|
|
@@ -1442,9 +1535,9 @@ function modifyHSL(color, h, s, l) {
|
|
|
1442
1535
|
var colorArr = parse(color);
|
|
1443
1536
|
if (color) {
|
|
1444
1537
|
colorArr = rgba2hsla(colorArr);
|
|
1445
|
-
h != null && (colorArr[0] = clampCssAngle(h));
|
|
1446
|
-
s != null && (colorArr[1] = parseCssFloat(s));
|
|
1447
|
-
l != null && (colorArr[2] = parseCssFloat(l));
|
|
1538
|
+
h != null && (colorArr[0] = clampCssAngle(isFunction(h) ? h(colorArr[0]) : h));
|
|
1539
|
+
s != null && (colorArr[1] = parseCssFloat(isFunction(s) ? s(colorArr[1]) : s));
|
|
1540
|
+
l != null && (colorArr[2] = parseCssFloat(isFunction(l) ? l(colorArr[2]) : l));
|
|
1448
1541
|
return stringify(hsla2rgba(colorArr), "rgba");
|
|
1449
1542
|
}
|
|
1450
1543
|
}
|
|
@@ -1498,78 +1591,7 @@ function liftColor(color) {
|
|
|
1498
1591
|
return color;
|
|
1499
1592
|
}
|
|
1500
1593
|
|
|
1501
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1502
|
-
var Browser = function() {
|
|
1503
|
-
function Browser2() {
|
|
1504
|
-
this.firefox = false;
|
|
1505
|
-
this.ie = false;
|
|
1506
|
-
this.edge = false;
|
|
1507
|
-
this.newEdge = false;
|
|
1508
|
-
this.weChat = false;
|
|
1509
|
-
}
|
|
1510
|
-
return Browser2;
|
|
1511
|
-
}();
|
|
1512
|
-
var Env = function() {
|
|
1513
|
-
function Env2() {
|
|
1514
|
-
this.browser = new Browser();
|
|
1515
|
-
this.node = false;
|
|
1516
|
-
this.wxa = false;
|
|
1517
|
-
this.worker = false;
|
|
1518
|
-
this.svgSupported = false;
|
|
1519
|
-
this.touchEventsSupported = false;
|
|
1520
|
-
this.pointerEventsSupported = false;
|
|
1521
|
-
this.domSupported = false;
|
|
1522
|
-
this.transformSupported = false;
|
|
1523
|
-
this.transform3dSupported = false;
|
|
1524
|
-
this.hasGlobalWindow = typeof window !== "undefined";
|
|
1525
|
-
}
|
|
1526
|
-
return Env2;
|
|
1527
|
-
}();
|
|
1528
|
-
var env = new Env();
|
|
1529
|
-
if (typeof wx === "object" && typeof wx.getSystemInfoSync === "function") {
|
|
1530
|
-
env.wxa = true;
|
|
1531
|
-
env.touchEventsSupported = true;
|
|
1532
|
-
} else if (typeof document === "undefined" && typeof self !== "undefined") {
|
|
1533
|
-
env.worker = true;
|
|
1534
|
-
} else if (typeof navigator === "undefined" || navigator.userAgent.indexOf("Node.js") === 0) {
|
|
1535
|
-
env.node = true;
|
|
1536
|
-
env.svgSupported = true;
|
|
1537
|
-
} else {
|
|
1538
|
-
detect(navigator.userAgent, env);
|
|
1539
|
-
}
|
|
1540
|
-
function detect(ua, env2) {
|
|
1541
|
-
var browser = env2.browser;
|
|
1542
|
-
var firefox = ua.match(/Firefox\/([\d.]+)/);
|
|
1543
|
-
var ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/);
|
|
1544
|
-
var edge = ua.match(/Edge?\/([\d.]+)/);
|
|
1545
|
-
var weChat = /micromessenger/i.test(ua);
|
|
1546
|
-
if (firefox) {
|
|
1547
|
-
browser.firefox = true;
|
|
1548
|
-
browser.version = firefox[1];
|
|
1549
|
-
}
|
|
1550
|
-
if (ie) {
|
|
1551
|
-
browser.ie = true;
|
|
1552
|
-
browser.version = ie[1];
|
|
1553
|
-
}
|
|
1554
|
-
if (edge) {
|
|
1555
|
-
browser.edge = true;
|
|
1556
|
-
browser.version = edge[1];
|
|
1557
|
-
browser.newEdge = +edge[1].split(".")[0] > 18;
|
|
1558
|
-
}
|
|
1559
|
-
if (weChat) {
|
|
1560
|
-
browser.weChat = true;
|
|
1561
|
-
}
|
|
1562
|
-
env2.svgSupported = typeof SVGRect !== "undefined";
|
|
1563
|
-
env2.touchEventsSupported = "ontouchstart" in window && !browser.ie && !browser.edge;
|
|
1564
|
-
env2.pointerEventsSupported = "onpointerdown" in window && (browser.edge || browser.ie && +browser.version >= 11);
|
|
1565
|
-
env2.domSupported = typeof document !== "undefined";
|
|
1566
|
-
var style = document.documentElement.style;
|
|
1567
|
-
env2.transform3dSupported = (browser.ie && "transition" in style || browser.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in style) && !("OTransition" in style);
|
|
1568
|
-
env2.transformSupported = env2.transform3dSupported || browser.ie && +browser.version >= 9;
|
|
1569
|
-
}
|
|
1570
|
-
var env_default = env;
|
|
1571
|
-
|
|
1572
|
-
// ../../node_modules/.pnpm/zrender@5.5.0/node_modules/zrender/lib/zrender.js
|
|
1594
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/zrender.js
|
|
1573
1595
|
var zrender_exports = {};
|
|
1574
1596
|
__export(zrender_exports, {
|
|
1575
1597
|
dispose: () => dispose,
|
|
@@ -1603,7 +1625,7 @@ function __extends(d, b) {
|
|
|
1603
1625
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1604
1626
|
}
|
|
1605
1627
|
|
|
1606
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1628
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/mixin/Draggable.js
|
|
1607
1629
|
var Param = function() {
|
|
1608
1630
|
function Param2(target, e) {
|
|
1609
1631
|
this.target = target;
|
|
@@ -1671,7 +1693,7 @@ var Draggable = function() {
|
|
|
1671
1693
|
}();
|
|
1672
1694
|
var Draggable_default = Draggable;
|
|
1673
1695
|
|
|
1674
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1696
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/Eventful.js
|
|
1675
1697
|
var Eventful = function() {
|
|
1676
1698
|
function Eventful2(eventProcessors) {
|
|
1677
1699
|
if (eventProcessors) {
|
|
@@ -1824,7 +1846,7 @@ var Eventful = function() {
|
|
|
1824
1846
|
}();
|
|
1825
1847
|
var Eventful_default = Eventful;
|
|
1826
1848
|
|
|
1827
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1849
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/fourPointsTransform.js
|
|
1828
1850
|
var LN2 = Math.log(2);
|
|
1829
1851
|
function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
|
|
1830
1852
|
var cacheKey = rowMask + "-" + colMask;
|
|
@@ -1882,12 +1904,23 @@ function buildTransformer(src, dest) {
|
|
|
1882
1904
|
};
|
|
1883
1905
|
}
|
|
1884
1906
|
|
|
1885
|
-
// ../../node_modules/.pnpm/zrender@
|
|
1907
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/dom.js
|
|
1886
1908
|
var EVENT_SAVED_PROP = "___zrEVENTSAVED";
|
|
1887
1909
|
var _calcOut = [];
|
|
1888
1910
|
function transformLocalCoord(out, elFrom, elTarget, inX, inY) {
|
|
1889
1911
|
return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);
|
|
1890
1912
|
}
|
|
1913
|
+
function transformLocalCoordClear(elFrom, elTarget) {
|
|
1914
|
+
elFrom && dealClear(elFrom);
|
|
1915
|
+
elTarget && dealClear(elTarget);
|
|
1916
|
+
function dealClear(el) {
|
|
1917
|
+
var saved = el[EVENT_SAVED_PROP];
|
|
1918
|
+
if (saved) {
|
|
1919
|
+
saved.clearMarkers && saved.clearMarkers();
|
|
1920
|
+
delete el[EVENT_SAVED_PROP];
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1891
1924
|
function transformCoordWithViewport(out, el, inX, inY, inverse) {
|
|
1892
1925
|
if (el.getBoundingClientRect && env_default.domSupported && !isCanvasEl(el)) {
|
|
1893
1926
|
var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
|
|
@@ -1931,6 +1964,11 @@ function prepareCoordMarkers(el, saved) {
|
|
|
1931
1964
|
el.appendChild(marker);
|
|
1932
1965
|
markers.push(marker);
|
|
1933
1966
|
}
|
|
1967
|
+
saved.clearMarkers = function() {
|
|
1968
|
+
each(markers, function(marker2) {
|
|
1969
|
+
marker2.parentNode && marker2.parentNode.removeChild(marker2);
|
|
1970
|
+
});
|
|
1971
|
+
};
|
|
1934
1972
|
return markers;
|
|
1935
1973
|
}
|
|
1936
1974
|
function preparePointerTransformer(markers, saved, inverse) {
|
|
@@ -1968,7 +2006,7 @@ function encodeHTML(source) {
|
|
|
1968
2006
|
});
|
|
1969
2007
|
}
|
|
1970
2008
|
|
|
1971
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2009
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/event.js
|
|
1972
2010
|
var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
|
|
1973
2011
|
var _calcOut2 = [];
|
|
1974
2012
|
var firefoxNotSupportOffsetXY = env_default.browser.firefox && +env_default.browser.version.split(".")[0] < 39;
|
|
@@ -2059,7 +2097,7 @@ function isMiddleOrRightButtonOnMouseUpDown(e) {
|
|
|
2059
2097
|
return e.which === 2 || e.which === 3;
|
|
2060
2098
|
}
|
|
2061
2099
|
|
|
2062
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2100
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/GestureMgr.js
|
|
2063
2101
|
var GestureMgr = function() {
|
|
2064
2102
|
function GestureMgr2() {
|
|
2065
2103
|
this._track = [];
|
|
@@ -2138,7 +2176,7 @@ var recognizers = {
|
|
|
2138
2176
|
}
|
|
2139
2177
|
};
|
|
2140
2178
|
|
|
2141
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2179
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/Point.js
|
|
2142
2180
|
var Point = function() {
|
|
2143
2181
|
function Point2(x, y) {
|
|
2144
2182
|
this.x = x || 0;
|
|
@@ -2269,17 +2307,25 @@ var Point = function() {
|
|
|
2269
2307
|
}();
|
|
2270
2308
|
var Point_default = Point;
|
|
2271
2309
|
|
|
2272
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2310
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/BoundingRect.js
|
|
2273
2311
|
var mathMin = Math.min;
|
|
2274
2312
|
var mathMax = Math.max;
|
|
2313
|
+
var mathAbs = Math.abs;
|
|
2314
|
+
var XY = ["x", "y"];
|
|
2315
|
+
var WH = ["width", "height"];
|
|
2275
2316
|
var lt = new Point_default();
|
|
2276
2317
|
var rb = new Point_default();
|
|
2277
2318
|
var lb = new Point_default();
|
|
2278
2319
|
var rt = new Point_default();
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2320
|
+
var _intersectCtx = createIntersectContext();
|
|
2321
|
+
var _minTv = _intersectCtx.minTv;
|
|
2322
|
+
var _maxTv = _intersectCtx.maxTv;
|
|
2323
|
+
var _lenMinMax = [0, 0];
|
|
2281
2324
|
var BoundingRect = function() {
|
|
2282
2325
|
function BoundingRect2(x, y, width, height) {
|
|
2326
|
+
boundingRectSet(this, x, y, width, height);
|
|
2327
|
+
}
|
|
2328
|
+
BoundingRect2.set = function(target, x, y, width, height) {
|
|
2283
2329
|
if (width < 0) {
|
|
2284
2330
|
x = x + width;
|
|
2285
2331
|
width = -width;
|
|
@@ -2288,11 +2334,12 @@ var BoundingRect = function() {
|
|
|
2288
2334
|
y = y + height;
|
|
2289
2335
|
height = -height;
|
|
2290
2336
|
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2337
|
+
target.x = x;
|
|
2338
|
+
target.y = y;
|
|
2339
|
+
target.width = width;
|
|
2340
|
+
target.height = height;
|
|
2341
|
+
return target;
|
|
2342
|
+
};
|
|
2296
2343
|
BoundingRect2.prototype.union = function(other) {
|
|
2297
2344
|
var x = mathMin(other.x, this.x);
|
|
2298
2345
|
var y = mathMin(other.y, this.y);
|
|
@@ -2313,94 +2360,66 @@ var BoundingRect = function() {
|
|
|
2313
2360
|
BoundingRect2.applyTransform(this, this, m);
|
|
2314
2361
|
};
|
|
2315
2362
|
BoundingRect2.prototype.calculateTransform = function(b) {
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
translate(m, m, [-a.x, -a.y]);
|
|
2321
|
-
scale(m, m, [sx, sy]);
|
|
2322
|
-
translate(m, m, [b.x, b.y]);
|
|
2323
|
-
return m;
|
|
2363
|
+
return boundingRectCalculateTransform(create(), this, b);
|
|
2364
|
+
};
|
|
2365
|
+
BoundingRect2.prototype.intersect = function(b, mtv, opt) {
|
|
2366
|
+
return BoundingRect2.intersect(this, b, mtv, opt);
|
|
2324
2367
|
};
|
|
2325
|
-
BoundingRect2.
|
|
2326
|
-
if (
|
|
2368
|
+
BoundingRect2.intersect = function(a, b, mtv, opt) {
|
|
2369
|
+
if (mtv) {
|
|
2370
|
+
Point_default.set(mtv, 0, 0);
|
|
2371
|
+
}
|
|
2372
|
+
var outIntersectRect = opt && opt.outIntersectRect || null;
|
|
2373
|
+
var clamp = opt && opt.clamp;
|
|
2374
|
+
if (outIntersectRect) {
|
|
2375
|
+
outIntersectRect.x = outIntersectRect.y = outIntersectRect.width = outIntersectRect.height = NaN;
|
|
2376
|
+
}
|
|
2377
|
+
if (!a || !b) {
|
|
2327
2378
|
return false;
|
|
2328
2379
|
}
|
|
2380
|
+
if (!(a instanceof BoundingRect2)) {
|
|
2381
|
+
a = boundingRectSet(_tmpIntersectA, a.x, a.y, a.width, a.height);
|
|
2382
|
+
}
|
|
2329
2383
|
if (!(b instanceof BoundingRect2)) {
|
|
2330
|
-
b =
|
|
2331
|
-
}
|
|
2332
|
-
var
|
|
2333
|
-
|
|
2334
|
-
var
|
|
2335
|
-
var
|
|
2336
|
-
var
|
|
2337
|
-
var
|
|
2338
|
-
var
|
|
2339
|
-
var
|
|
2340
|
-
var
|
|
2384
|
+
b = boundingRectSet(_tmpIntersectB, b.x, b.y, b.width, b.height);
|
|
2385
|
+
}
|
|
2386
|
+
var useMTV = !!mtv;
|
|
2387
|
+
_intersectCtx.reset(opt, useMTV);
|
|
2388
|
+
var touchThreshold = _intersectCtx.touchThreshold;
|
|
2389
|
+
var ax0 = a.x + touchThreshold;
|
|
2390
|
+
var ax1 = a.x + a.width - touchThreshold;
|
|
2391
|
+
var ay0 = a.y + touchThreshold;
|
|
2392
|
+
var ay1 = a.y + a.height - touchThreshold;
|
|
2393
|
+
var bx0 = b.x + touchThreshold;
|
|
2394
|
+
var bx1 = b.x + b.width - touchThreshold;
|
|
2395
|
+
var by0 = b.y + touchThreshold;
|
|
2396
|
+
var by1 = b.y + b.height - touchThreshold;
|
|
2397
|
+
if (ax0 > ax1 || ay0 > ay1 || bx0 > bx1 || by0 > by1) {
|
|
2398
|
+
return false;
|
|
2399
|
+
}
|
|
2341
2400
|
var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
|
|
2342
|
-
if (
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
var dx = Math.min(d0, d1);
|
|
2350
|
-
var dy = Math.min(d2, d3);
|
|
2351
|
-
if (ax1 < bx0 || bx1 < ax0) {
|
|
2352
|
-
if (dx > dMax) {
|
|
2353
|
-
dMax = dx;
|
|
2354
|
-
if (d0 < d1) {
|
|
2355
|
-
Point_default.set(maxTv, -d0, 0);
|
|
2356
|
-
} else {
|
|
2357
|
-
Point_default.set(maxTv, d1, 0);
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
} else {
|
|
2361
|
-
if (dx < dMin) {
|
|
2362
|
-
dMin = dx;
|
|
2363
|
-
if (d0 < d1) {
|
|
2364
|
-
Point_default.set(minTv, d0, 0);
|
|
2365
|
-
} else {
|
|
2366
|
-
Point_default.set(minTv, -d1, 0);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
if (ay1 < by0 || by1 < ay0) {
|
|
2371
|
-
if (dy > dMax) {
|
|
2372
|
-
dMax = dy;
|
|
2373
|
-
if (d2 < d3) {
|
|
2374
|
-
Point_default.set(maxTv, 0, -d2);
|
|
2375
|
-
} else {
|
|
2376
|
-
Point_default.set(maxTv, 0, d3);
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
} else {
|
|
2380
|
-
if (dx < dMin) {
|
|
2381
|
-
dMin = dx;
|
|
2382
|
-
if (d2 < d3) {
|
|
2383
|
-
Point_default.set(minTv, 0, d2);
|
|
2384
|
-
} else {
|
|
2385
|
-
Point_default.set(minTv, 0, -d3);
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2401
|
+
if (useMTV || outIntersectRect) {
|
|
2402
|
+
_lenMinMax[0] = Infinity;
|
|
2403
|
+
_lenMinMax[1] = 0;
|
|
2404
|
+
intersectOneDim(ax0, ax1, bx0, bx1, 0, useMTV, outIntersectRect, clamp);
|
|
2405
|
+
intersectOneDim(ay0, ay1, by0, by1, 1, useMTV, outIntersectRect, clamp);
|
|
2406
|
+
if (useMTV) {
|
|
2407
|
+
Point_default.copy(mtv, overlap ? _intersectCtx.useDir ? _intersectCtx.dirMinTv : _minTv : _maxTv);
|
|
2388
2408
|
}
|
|
2389
2409
|
}
|
|
2390
|
-
if (mtv) {
|
|
2391
|
-
Point_default.copy(mtv, overlap ? minTv : maxTv);
|
|
2392
|
-
}
|
|
2393
2410
|
return overlap;
|
|
2394
2411
|
};
|
|
2395
|
-
BoundingRect2.
|
|
2396
|
-
var rect = this;
|
|
2412
|
+
BoundingRect2.contain = function(rect, x, y) {
|
|
2397
2413
|
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
|
|
2398
2414
|
};
|
|
2415
|
+
BoundingRect2.prototype.contain = function(x, y) {
|
|
2416
|
+
return BoundingRect2.contain(this, x, y);
|
|
2417
|
+
};
|
|
2399
2418
|
BoundingRect2.prototype.clone = function() {
|
|
2400
2419
|
return new BoundingRect2(this.x, this.y, this.width, this.height);
|
|
2401
2420
|
};
|
|
2402
2421
|
BoundingRect2.prototype.copy = function(other) {
|
|
2403
|
-
|
|
2422
|
+
boundingRectCopy(this, other);
|
|
2404
2423
|
};
|
|
2405
2424
|
BoundingRect2.prototype.plain = function() {
|
|
2406
2425
|
return {
|
|
@@ -2417,18 +2436,19 @@ var BoundingRect = function() {
|
|
|
2417
2436
|
return this.width === 0 || this.height === 0;
|
|
2418
2437
|
};
|
|
2419
2438
|
BoundingRect2.create = function(rect) {
|
|
2420
|
-
return new BoundingRect2(rect.x, rect.y, rect.width, rect.height);
|
|
2439
|
+
return new BoundingRect2(rect ? rect.x : 0, rect ? rect.y : 0, rect ? rect.width : 0, rect ? rect.height : 0);
|
|
2421
2440
|
};
|
|
2422
2441
|
BoundingRect2.copy = function(target, source) {
|
|
2423
2442
|
target.x = source.x;
|
|
2424
2443
|
target.y = source.y;
|
|
2425
2444
|
target.width = source.width;
|
|
2426
2445
|
target.height = source.height;
|
|
2446
|
+
return target;
|
|
2427
2447
|
};
|
|
2428
2448
|
BoundingRect2.applyTransform = function(target, source, m) {
|
|
2429
2449
|
if (!m) {
|
|
2430
2450
|
if (target !== source) {
|
|
2431
|
-
|
|
2451
|
+
boundingRectCopy(target, source);
|
|
2432
2452
|
}
|
|
2433
2453
|
return;
|
|
2434
2454
|
}
|
|
@@ -2466,11 +2486,144 @@ var BoundingRect = function() {
|
|
|
2466
2486
|
target.width = maxX - target.x;
|
|
2467
2487
|
target.height = maxY - target.y;
|
|
2468
2488
|
};
|
|
2489
|
+
BoundingRect2.calculateTransform = function(out, a, b) {
|
|
2490
|
+
var sx = b.width / a.width;
|
|
2491
|
+
var sy = b.height / a.height;
|
|
2492
|
+
out = identity(out || []);
|
|
2493
|
+
translate(out, out, set(_tmpCalcTrans, -a.x, -a.y));
|
|
2494
|
+
scale(out, out, set(_tmpCalcTrans, sx, sy));
|
|
2495
|
+
translate(out, out, set(_tmpCalcTrans, b.x, b.y));
|
|
2496
|
+
return out;
|
|
2497
|
+
};
|
|
2469
2498
|
return BoundingRect2;
|
|
2470
2499
|
}();
|
|
2500
|
+
var boundingRectCreate = BoundingRect.create;
|
|
2501
|
+
var boundingRectSet = BoundingRect.set;
|
|
2502
|
+
var boundingRectCopy = BoundingRect.copy;
|
|
2503
|
+
var boundingRectCalculateTransform = BoundingRect.calculateTransform;
|
|
2504
|
+
var boundingRectApplyTransform = BoundingRect.applyTransform;
|
|
2505
|
+
var boundingRectContain = BoundingRect.contain;
|
|
2506
|
+
var _tmpIntersectA = new BoundingRect(0, 0, 0, 0);
|
|
2507
|
+
var _tmpIntersectB = new BoundingRect(0, 0, 0, 0);
|
|
2508
|
+
var _tmpCalcTrans = [];
|
|
2509
|
+
function intersectOneDim(a0, a1, b0, b1, updateDimIdx, useMTV, outIntersectRect, clamp) {
|
|
2510
|
+
var d0 = mathAbs(a1 - b0);
|
|
2511
|
+
var d1 = mathAbs(b1 - a0);
|
|
2512
|
+
var d01min = mathMin(d0, d1);
|
|
2513
|
+
var updateDim = XY[updateDimIdx];
|
|
2514
|
+
var zeroDim = XY[1 - updateDimIdx];
|
|
2515
|
+
var wh = WH[updateDimIdx];
|
|
2516
|
+
if (a1 < b0 || b1 < a0) {
|
|
2517
|
+
if (d0 < d1) {
|
|
2518
|
+
if (useMTV) {
|
|
2519
|
+
_maxTv[updateDim] = -d0;
|
|
2520
|
+
}
|
|
2521
|
+
if (clamp) {
|
|
2522
|
+
outIntersectRect[updateDim] = a1;
|
|
2523
|
+
outIntersectRect[wh] = 0;
|
|
2524
|
+
}
|
|
2525
|
+
} else {
|
|
2526
|
+
if (useMTV) {
|
|
2527
|
+
_maxTv[updateDim] = d1;
|
|
2528
|
+
}
|
|
2529
|
+
if (clamp) {
|
|
2530
|
+
outIntersectRect[updateDim] = a0;
|
|
2531
|
+
outIntersectRect[wh] = 0;
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
} else {
|
|
2535
|
+
if (outIntersectRect) {
|
|
2536
|
+
outIntersectRect[updateDim] = mathMax(a0, b0);
|
|
2537
|
+
outIntersectRect[wh] = mathMin(a1, b1) - outIntersectRect[updateDim];
|
|
2538
|
+
}
|
|
2539
|
+
if (useMTV) {
|
|
2540
|
+
if (d01min < _lenMinMax[0] || _intersectCtx.useDir) {
|
|
2541
|
+
_lenMinMax[0] = mathMin(d01min, _lenMinMax[0]);
|
|
2542
|
+
if (d0 < d1 || !_intersectCtx.bidirectional) {
|
|
2543
|
+
_minTv[updateDim] = d0;
|
|
2544
|
+
_minTv[zeroDim] = 0;
|
|
2545
|
+
if (_intersectCtx.useDir) {
|
|
2546
|
+
_intersectCtx.calcDirMTV();
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
if (d0 >= d1 || !_intersectCtx.bidirectional) {
|
|
2550
|
+
_minTv[updateDim] = -d1;
|
|
2551
|
+
_minTv[zeroDim] = 0;
|
|
2552
|
+
if (_intersectCtx.useDir) {
|
|
2553
|
+
_intersectCtx.calcDirMTV();
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
function createIntersectContext() {
|
|
2561
|
+
var _direction = 0;
|
|
2562
|
+
var _dirCheckVec = new Point_default();
|
|
2563
|
+
var _dirTmp = new Point_default();
|
|
2564
|
+
var _ctx = {
|
|
2565
|
+
minTv: new Point_default(),
|
|
2566
|
+
maxTv: new Point_default(),
|
|
2567
|
+
useDir: false,
|
|
2568
|
+
dirMinTv: new Point_default(),
|
|
2569
|
+
touchThreshold: 0,
|
|
2570
|
+
bidirectional: true,
|
|
2571
|
+
negativeSize: false,
|
|
2572
|
+
reset: function(opt, useMTV) {
|
|
2573
|
+
_ctx.touchThreshold = 0;
|
|
2574
|
+
if (opt && opt.touchThreshold != null) {
|
|
2575
|
+
_ctx.touchThreshold = mathMax(0, opt.touchThreshold);
|
|
2576
|
+
}
|
|
2577
|
+
_ctx.negativeSize = false;
|
|
2578
|
+
if (!useMTV) {
|
|
2579
|
+
return;
|
|
2580
|
+
}
|
|
2581
|
+
_ctx.minTv.set(Infinity, Infinity);
|
|
2582
|
+
_ctx.maxTv.set(0, 0);
|
|
2583
|
+
_ctx.useDir = false;
|
|
2584
|
+
if (opt && opt.direction != null) {
|
|
2585
|
+
_ctx.useDir = true;
|
|
2586
|
+
_ctx.dirMinTv.copy(_ctx.minTv);
|
|
2587
|
+
_dirTmp.copy(_ctx.minTv);
|
|
2588
|
+
_direction = opt.direction;
|
|
2589
|
+
_ctx.bidirectional = opt.bidirectional == null || !!opt.bidirectional;
|
|
2590
|
+
if (!_ctx.bidirectional) {
|
|
2591
|
+
_dirCheckVec.set(Math.cos(_direction), Math.sin(_direction));
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
},
|
|
2595
|
+
calcDirMTV: function() {
|
|
2596
|
+
var minTv = _ctx.minTv;
|
|
2597
|
+
var dirMinTv = _ctx.dirMinTv;
|
|
2598
|
+
var squareMag = minTv.y * minTv.y + minTv.x * minTv.x;
|
|
2599
|
+
var dirSin = Math.sin(_direction);
|
|
2600
|
+
var dirCos = Math.cos(_direction);
|
|
2601
|
+
var dotProd = dirSin * minTv.y + dirCos * minTv.x;
|
|
2602
|
+
if (nearZero(dotProd)) {
|
|
2603
|
+
if (nearZero(minTv.x) && nearZero(minTv.y)) {
|
|
2604
|
+
dirMinTv.set(0, 0);
|
|
2605
|
+
}
|
|
2606
|
+
return;
|
|
2607
|
+
}
|
|
2608
|
+
_dirTmp.x = squareMag * dirCos / dotProd;
|
|
2609
|
+
_dirTmp.y = squareMag * dirSin / dotProd;
|
|
2610
|
+
if (nearZero(_dirTmp.x) && nearZero(_dirTmp.y)) {
|
|
2611
|
+
dirMinTv.set(0, 0);
|
|
2612
|
+
return;
|
|
2613
|
+
}
|
|
2614
|
+
if ((_ctx.bidirectional || _dirCheckVec.dot(_dirTmp) > 0) && _dirTmp.len() < dirMinTv.len()) {
|
|
2615
|
+
dirMinTv.copy(_dirTmp);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
};
|
|
2619
|
+
function nearZero(val) {
|
|
2620
|
+
return mathAbs(val) < 1e-10;
|
|
2621
|
+
}
|
|
2622
|
+
return _ctx;
|
|
2623
|
+
}
|
|
2471
2624
|
var BoundingRect_default = BoundingRect;
|
|
2472
2625
|
|
|
2473
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2626
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/Handler.js
|
|
2474
2627
|
var SILENT = "silent";
|
|
2475
2628
|
function makeEventPacket(eveType, targetInfo, event) {
|
|
2476
2629
|
return {
|
|
@@ -2732,7 +2885,7 @@ function isHover(displayable, x, y) {
|
|
|
2732
2885
|
isSilent = true;
|
|
2733
2886
|
}
|
|
2734
2887
|
var hostEl = el.__hostTarget;
|
|
2735
|
-
el = hostEl ? hostEl : el.parent;
|
|
2888
|
+
el = hostEl ? el.ignoreHostSilent ? null : hostEl : el.parent;
|
|
2736
2889
|
}
|
|
2737
2890
|
return isSilent ? SILENT : true;
|
|
2738
2891
|
}
|
|
@@ -2757,7 +2910,7 @@ function isOutsideBoundary(handlerInstance, x, y) {
|
|
|
2757
2910
|
}
|
|
2758
2911
|
var Handler_default = Handler;
|
|
2759
2912
|
|
|
2760
|
-
// ../../node_modules/.pnpm/zrender@
|
|
2913
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/timsort.js
|
|
2761
2914
|
var DEFAULT_MIN_MERGE = 32;
|
|
2762
2915
|
var DEFAULT_MIN_GALLOPING = 7;
|
|
2763
2916
|
function minRunLength(n) {
|
|
@@ -3266,12 +3419,12 @@ function sort(array, compare, lo, hi) {
|
|
|
3266
3419
|
ts.forceMergeRuns();
|
|
3267
3420
|
}
|
|
3268
3421
|
|
|
3269
|
-
// ../../node_modules/.pnpm/zrender@
|
|
3422
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/constants.js
|
|
3270
3423
|
var REDRAW_BIT = 1;
|
|
3271
3424
|
var STYLE_CHANGED_BIT = 2;
|
|
3272
3425
|
var SHAPE_CHANGED_BIT = 4;
|
|
3273
3426
|
|
|
3274
|
-
// ../../node_modules/.pnpm/zrender@
|
|
3427
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/Storage.js
|
|
3275
3428
|
var invalidZErrorLogged = false;
|
|
3276
3429
|
function logInvalidZError() {
|
|
3277
3430
|
if (invalidZErrorLogged) {
|
|
@@ -3319,7 +3472,7 @@ var Storage = function() {
|
|
|
3319
3472
|
displayList.length = this._displayListLen;
|
|
3320
3473
|
sort(displayList, shapeCompareFunc);
|
|
3321
3474
|
};
|
|
3322
|
-
Storage2.prototype._updateAndAddDisplayable = function(el,
|
|
3475
|
+
Storage2.prototype._updateAndAddDisplayable = function(el, parentClipPaths, includeIgnore) {
|
|
3323
3476
|
if (el.ignore && !includeIgnore) {
|
|
3324
3477
|
return;
|
|
3325
3478
|
}
|
|
@@ -3327,24 +3480,31 @@ var Storage = function() {
|
|
|
3327
3480
|
el.update();
|
|
3328
3481
|
el.afterUpdate();
|
|
3329
3482
|
var userSetClipPath = el.getClipPath();
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3483
|
+
var parentHasClipPaths = parentClipPaths && parentClipPaths.length;
|
|
3484
|
+
var clipPathIdx = 0;
|
|
3485
|
+
var thisClipPaths = el.__clipPaths;
|
|
3486
|
+
if (!el.ignoreClip && (parentHasClipPaths || userSetClipPath)) {
|
|
3487
|
+
if (!thisClipPaths) {
|
|
3488
|
+
thisClipPaths = el.__clipPaths = [];
|
|
3489
|
+
}
|
|
3490
|
+
if (parentHasClipPaths) {
|
|
3491
|
+
for (var idx = 0; idx < parentClipPaths.length; idx++) {
|
|
3492
|
+
thisClipPaths[clipPathIdx++] = parentClipPaths[idx];
|
|
3493
|
+
}
|
|
3337
3494
|
}
|
|
3338
3495
|
var currentClipPath = userSetClipPath;
|
|
3339
3496
|
var parentClipPath = el;
|
|
3340
3497
|
while (currentClipPath) {
|
|
3341
3498
|
currentClipPath.parent = parentClipPath;
|
|
3342
3499
|
currentClipPath.updateTransform();
|
|
3343
|
-
|
|
3500
|
+
thisClipPaths[clipPathIdx++] = currentClipPath;
|
|
3344
3501
|
parentClipPath = currentClipPath;
|
|
3345
3502
|
currentClipPath = currentClipPath.getClipPath();
|
|
3346
3503
|
}
|
|
3347
3504
|
}
|
|
3505
|
+
if (thisClipPaths) {
|
|
3506
|
+
thisClipPaths.length = clipPathIdx;
|
|
3507
|
+
}
|
|
3348
3508
|
if (el.childrenRef) {
|
|
3349
3509
|
var children = el.childrenRef();
|
|
3350
3510
|
for (var i = 0; i < children.length; i++) {
|
|
@@ -3352,16 +3512,11 @@ var Storage = function() {
|
|
|
3352
3512
|
if (el.__dirty) {
|
|
3353
3513
|
child.__dirty |= REDRAW_BIT;
|
|
3354
3514
|
}
|
|
3355
|
-
this._updateAndAddDisplayable(child,
|
|
3515
|
+
this._updateAndAddDisplayable(child, thisClipPaths, includeIgnore);
|
|
3356
3516
|
}
|
|
3357
3517
|
el.__dirty = 0;
|
|
3358
3518
|
} else {
|
|
3359
3519
|
var disp = el;
|
|
3360
|
-
if (clipPaths && clipPaths.length) {
|
|
3361
|
-
disp.__clipPaths = clipPaths;
|
|
3362
|
-
} else if (disp.__clipPaths && disp.__clipPaths.length > 0) {
|
|
3363
|
-
disp.__clipPaths = [];
|
|
3364
|
-
}
|
|
3365
3520
|
if (isNaN(disp.z)) {
|
|
3366
3521
|
logInvalidZError();
|
|
3367
3522
|
disp.z = 0;
|
|
@@ -3378,15 +3533,15 @@ var Storage = function() {
|
|
|
3378
3533
|
}
|
|
3379
3534
|
var decalEl = el.getDecalElement && el.getDecalElement();
|
|
3380
3535
|
if (decalEl) {
|
|
3381
|
-
this._updateAndAddDisplayable(decalEl,
|
|
3536
|
+
this._updateAndAddDisplayable(decalEl, thisClipPaths, includeIgnore);
|
|
3382
3537
|
}
|
|
3383
3538
|
var textGuide = el.getTextGuideLine();
|
|
3384
3539
|
if (textGuide) {
|
|
3385
|
-
this._updateAndAddDisplayable(textGuide,
|
|
3540
|
+
this._updateAndAddDisplayable(textGuide, thisClipPaths, includeIgnore);
|
|
3386
3541
|
}
|
|
3387
3542
|
var textEl = el.getTextContent();
|
|
3388
3543
|
if (textEl) {
|
|
3389
|
-
this._updateAndAddDisplayable(textEl,
|
|
3544
|
+
this._updateAndAddDisplayable(textEl, thisClipPaths, includeIgnore);
|
|
3390
3545
|
}
|
|
3391
3546
|
};
|
|
3392
3547
|
Storage2.prototype.addRoot = function(el) {
|
|
@@ -3424,14 +3579,14 @@ var Storage = function() {
|
|
|
3424
3579
|
}();
|
|
3425
3580
|
var Storage_default = Storage;
|
|
3426
3581
|
|
|
3427
|
-
// ../../node_modules/.pnpm/zrender@
|
|
3582
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/requestAnimationFrame.js
|
|
3428
3583
|
var requestAnimationFrame;
|
|
3429
3584
|
requestAnimationFrame = env_default.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) {
|
|
3430
3585
|
return setTimeout(func, 16);
|
|
3431
3586
|
};
|
|
3432
3587
|
var requestAnimationFrame_default = requestAnimationFrame;
|
|
3433
3588
|
|
|
3434
|
-
// ../../node_modules/.pnpm/zrender@
|
|
3589
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/easing.js
|
|
3435
3590
|
var easingFuncs = {
|
|
3436
3591
|
linear: function(k) {
|
|
3437
3592
|
return k;
|
|
@@ -3618,10 +3773,10 @@ var easingFuncs = {
|
|
|
3618
3773
|
};
|
|
3619
3774
|
var easing_default = easingFuncs;
|
|
3620
3775
|
|
|
3621
|
-
// ../../node_modules/.pnpm/zrender@
|
|
3776
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/curve.js
|
|
3622
3777
|
var mathPow = Math.pow;
|
|
3623
3778
|
var mathSqrt = Math.sqrt;
|
|
3624
|
-
var
|
|
3779
|
+
var EPSILON2 = 1e-8;
|
|
3625
3780
|
var EPSILON_NUMERIC = 1e-4;
|
|
3626
3781
|
var THREE_SQRT = mathSqrt(3);
|
|
3627
3782
|
var ONE_THIRD = 1 / 3;
|
|
@@ -3629,10 +3784,10 @@ var _v0 = create2();
|
|
|
3629
3784
|
var _v1 = create2();
|
|
3630
3785
|
var _v2 = create2();
|
|
3631
3786
|
function isAroundZero(val) {
|
|
3632
|
-
return val > -
|
|
3787
|
+
return val > -EPSILON2 && val < EPSILON2;
|
|
3633
3788
|
}
|
|
3634
3789
|
function isNotAroundZero(val) {
|
|
3635
|
-
return val >
|
|
3790
|
+
return val > EPSILON2 || val < -EPSILON2;
|
|
3636
3791
|
}
|
|
3637
3792
|
function cubicAt(p0, p1, p2, p3, t) {
|
|
3638
3793
|
var onet = 1 - t;
|
|
@@ -3947,7 +4102,7 @@ function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {
|
|
|
3947
4102
|
return d;
|
|
3948
4103
|
}
|
|
3949
4104
|
|
|
3950
|
-
// ../../node_modules/.pnpm/zrender@
|
|
4105
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/cubicEasing.js
|
|
3951
4106
|
var regexp = /cubic-bezier\(([0-9,\.e ]+)\)/;
|
|
3952
4107
|
function createCubicEasingFunc(cubicEasingStr) {
|
|
3953
4108
|
var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);
|
|
@@ -3967,7 +4122,7 @@ function createCubicEasingFunc(cubicEasingStr) {
|
|
|
3967
4122
|
}
|
|
3968
4123
|
}
|
|
3969
4124
|
|
|
3970
|
-
// ../../node_modules/.pnpm/zrender@
|
|
4125
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/Clip.js
|
|
3971
4126
|
var Clip = function() {
|
|
3972
4127
|
function Clip2(opts) {
|
|
3973
4128
|
this._inited = false;
|
|
@@ -4027,7 +4182,7 @@ var Clip = function() {
|
|
|
4027
4182
|
}();
|
|
4028
4183
|
var Clip_default = Clip;
|
|
4029
4184
|
|
|
4030
|
-
// ../../node_modules/.pnpm/zrender@
|
|
4185
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/svg/helper.js
|
|
4031
4186
|
var mathRound = Math.round;
|
|
4032
4187
|
function normalizeColor(color) {
|
|
4033
4188
|
var opacity;
|
|
@@ -4045,9 +4200,9 @@ function normalizeColor(color) {
|
|
|
4045
4200
|
opacity: opacity == null ? 1 : opacity
|
|
4046
4201
|
};
|
|
4047
4202
|
}
|
|
4048
|
-
var
|
|
4203
|
+
var EPSILON3 = 1e-4;
|
|
4049
4204
|
function isAroundZero2(transform) {
|
|
4050
|
-
return transform <
|
|
4205
|
+
return transform < EPSILON3 && transform > -EPSILON3;
|
|
4051
4206
|
}
|
|
4052
4207
|
function round3(transform) {
|
|
4053
4208
|
return mathRound(transform * 1e3) / 1e3;
|
|
@@ -4137,14 +4292,14 @@ function getSRTTransformString(transform) {
|
|
|
4137
4292
|
return res.join(" ");
|
|
4138
4293
|
}
|
|
4139
4294
|
var encodeBase64 = function() {
|
|
4140
|
-
if (
|
|
4295
|
+
if (typeof Buffer !== "undefined" && typeof Buffer.from === "function") {
|
|
4141
4296
|
return function(str) {
|
|
4142
|
-
return
|
|
4297
|
+
return Buffer.from(str).toString("base64");
|
|
4143
4298
|
};
|
|
4144
4299
|
}
|
|
4145
|
-
if (typeof
|
|
4300
|
+
if (typeof btoa === "function" && typeof unescape === "function" && typeof encodeURIComponent === "function") {
|
|
4146
4301
|
return function(str) {
|
|
4147
|
-
return
|
|
4302
|
+
return btoa(unescape(encodeURIComponent(str)));
|
|
4148
4303
|
};
|
|
4149
4304
|
}
|
|
4150
4305
|
return function(str) {
|
|
@@ -4155,7 +4310,7 @@ var encodeBase64 = function() {
|
|
|
4155
4310
|
};
|
|
4156
4311
|
}();
|
|
4157
4312
|
|
|
4158
|
-
// ../../node_modules/.pnpm/zrender@
|
|
4313
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/Animator.js
|
|
4159
4314
|
var arraySlice = Array.prototype.slice;
|
|
4160
4315
|
function interpolateNumber(p0, p1, percent) {
|
|
4161
4316
|
return (p1 - p0) * percent + p0;
|
|
@@ -4849,7 +5004,7 @@ var Animator = function() {
|
|
|
4849
5004
|
}();
|
|
4850
5005
|
var Animator_default = Animator;
|
|
4851
5006
|
|
|
4852
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5007
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/animation/Animation.js
|
|
4853
5008
|
function getTime() {
|
|
4854
5009
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
4855
5010
|
}
|
|
@@ -4990,7 +5145,7 @@ var Animation = function(_super) {
|
|
|
4990
5145
|
}(Eventful_default);
|
|
4991
5146
|
var Animation_default = Animation;
|
|
4992
5147
|
|
|
4993
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5148
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/dom/HandlerProxy.js
|
|
4994
5149
|
var TOUCH_CLICK_DELAY = 300;
|
|
4995
5150
|
var globalEventSupported = env_default.domSupported;
|
|
4996
5151
|
var localNativeListenerNames = function() {
|
|
@@ -5285,7 +5440,7 @@ var HandlerDomProxy = function(_super) {
|
|
|
5285
5440
|
}(Eventful_default);
|
|
5286
5441
|
var HandlerProxy_default = HandlerDomProxy;
|
|
5287
5442
|
|
|
5288
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5443
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/config.js
|
|
5289
5444
|
var dpr = 1;
|
|
5290
5445
|
if (env_default.hasGlobalWindow) {
|
|
5291
5446
|
dpr = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1);
|
|
@@ -5296,11 +5451,11 @@ var DARK_LABEL_COLOR = "#333";
|
|
|
5296
5451
|
var LIGHT_LABEL_COLOR = "#ccc";
|
|
5297
5452
|
var LIGHTER_LABEL_COLOR = "#eee";
|
|
5298
5453
|
|
|
5299
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5454
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/Transformable.js
|
|
5300
5455
|
var mIdentity = identity;
|
|
5301
|
-
var
|
|
5456
|
+
var EPSILON4 = 5e-5;
|
|
5302
5457
|
function isNotAroundZero2(val) {
|
|
5303
|
-
return val >
|
|
5458
|
+
return val > EPSILON4 || val < -EPSILON4;
|
|
5304
5459
|
}
|
|
5305
5460
|
var scaleTmp = [];
|
|
5306
5461
|
var tmpTransform = [];
|
|
@@ -5310,7 +5465,7 @@ var Transformable = function() {
|
|
|
5310
5465
|
function Transformable2() {
|
|
5311
5466
|
}
|
|
5312
5467
|
Transformable2.prototype.getLocalTransform = function(m) {
|
|
5313
|
-
return
|
|
5468
|
+
return transformableGetLocalTransform(this, m);
|
|
5314
5469
|
};
|
|
5315
5470
|
Transformable2.prototype.setPosition = function(arr) {
|
|
5316
5471
|
this.x = arr[0];
|
|
@@ -5357,6 +5512,8 @@ var Transformable = function() {
|
|
|
5357
5512
|
}
|
|
5358
5513
|
this.transform = m;
|
|
5359
5514
|
this._resolveGlobalScaleRatio(m);
|
|
5515
|
+
this.invTransform = this.invTransform || create();
|
|
5516
|
+
invert(this.invTransform, m);
|
|
5360
5517
|
};
|
|
5361
5518
|
Transformable2.prototype._resolveGlobalScaleRatio = function(m) {
|
|
5362
5519
|
var globalScaleRatio = this.globalScaleRatio;
|
|
@@ -5371,8 +5528,6 @@ var Transformable = function() {
|
|
|
5371
5528
|
m[2] *= sy;
|
|
5372
5529
|
m[3] *= sy;
|
|
5373
5530
|
}
|
|
5374
|
-
this.invTransform = this.invTransform || create();
|
|
5375
|
-
invert(this.invTransform, m);
|
|
5376
5531
|
};
|
|
5377
5532
|
Transformable2.prototype.getComputedTransform = function() {
|
|
5378
5533
|
var transformNode = this;
|
|
@@ -5507,6 +5662,10 @@ var Transformable = function() {
|
|
|
5507
5662
|
}();
|
|
5508
5663
|
return Transformable2;
|
|
5509
5664
|
}();
|
|
5665
|
+
var transformableGetLocalTransform = Transformable.getLocalTransform;
|
|
5666
|
+
function transformableCreate() {
|
|
5667
|
+
return new Transformable();
|
|
5668
|
+
}
|
|
5510
5669
|
var TRANSFORMABLE_PROPS = [
|
|
5511
5670
|
"x",
|
|
5512
5671
|
"y",
|
|
@@ -5521,30 +5680,69 @@ var TRANSFORMABLE_PROPS = [
|
|
|
5521
5680
|
"skewY"
|
|
5522
5681
|
];
|
|
5523
5682
|
function copyTransform(target, source) {
|
|
5524
|
-
|
|
5525
|
-
var propName = TRANSFORMABLE_PROPS[i];
|
|
5526
|
-
target[propName] = source[propName];
|
|
5527
|
-
}
|
|
5683
|
+
return assignProps(target, source, TRANSFORMABLE_PROPS);
|
|
5528
5684
|
}
|
|
5529
5685
|
var Transformable_default = Transformable;
|
|
5530
5686
|
|
|
5531
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5532
|
-
|
|
5533
|
-
|
|
5687
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/text.js
|
|
5688
|
+
function ensureFontMeasureInfo(font) {
|
|
5689
|
+
if (!_fontMeasureInfoCache) {
|
|
5690
|
+
_fontMeasureInfoCache = new LRU_default(100);
|
|
5691
|
+
}
|
|
5534
5692
|
font = font || DEFAULT_FONT;
|
|
5535
|
-
var
|
|
5536
|
-
if (!
|
|
5537
|
-
|
|
5693
|
+
var measureInfo = _fontMeasureInfoCache.get(font);
|
|
5694
|
+
if (!measureInfo) {
|
|
5695
|
+
measureInfo = {
|
|
5696
|
+
font,
|
|
5697
|
+
strWidthCache: new LRU_default(500),
|
|
5698
|
+
asciiWidthMap: null,
|
|
5699
|
+
asciiWidthMapTried: false,
|
|
5700
|
+
stWideCharWidth: platformApi.measureText("国", font).width,
|
|
5701
|
+
asciiCharWidth: platformApi.measureText("a", font).width
|
|
5702
|
+
};
|
|
5703
|
+
_fontMeasureInfoCache.put(font, measureInfo);
|
|
5538
5704
|
}
|
|
5539
|
-
|
|
5705
|
+
return measureInfo;
|
|
5706
|
+
}
|
|
5707
|
+
var _fontMeasureInfoCache;
|
|
5708
|
+
function tryCreateASCIIWidthMap(font) {
|
|
5709
|
+
if (_getASCIIWidthMapLongCount >= GET_ASCII_WIDTH_LONG_COUNT_MAX) {
|
|
5710
|
+
return;
|
|
5711
|
+
}
|
|
5712
|
+
font = font || DEFAULT_FONT;
|
|
5713
|
+
var asciiWidthMap = [];
|
|
5714
|
+
var start2 = +/* @__PURE__ */ new Date();
|
|
5715
|
+
for (var code = 0; code <= 127; code++) {
|
|
5716
|
+
asciiWidthMap[code] = platformApi.measureText(String.fromCharCode(code), font).width;
|
|
5717
|
+
}
|
|
5718
|
+
var cost = +/* @__PURE__ */ new Date() - start2;
|
|
5719
|
+
if (cost > 16) {
|
|
5720
|
+
_getASCIIWidthMapLongCount = GET_ASCII_WIDTH_LONG_COUNT_MAX;
|
|
5721
|
+
} else if (cost > 2) {
|
|
5722
|
+
_getASCIIWidthMapLongCount++;
|
|
5723
|
+
}
|
|
5724
|
+
return asciiWidthMap;
|
|
5725
|
+
}
|
|
5726
|
+
var _getASCIIWidthMapLongCount = 0;
|
|
5727
|
+
var GET_ASCII_WIDTH_LONG_COUNT_MAX = 5;
|
|
5728
|
+
function measureCharWidth(fontMeasureInfo, charCode) {
|
|
5729
|
+
if (!fontMeasureInfo.asciiWidthMapTried) {
|
|
5730
|
+
fontMeasureInfo.asciiWidthMap = tryCreateASCIIWidthMap(fontMeasureInfo.font);
|
|
5731
|
+
fontMeasureInfo.asciiWidthMapTried = true;
|
|
5732
|
+
}
|
|
5733
|
+
return 0 <= charCode && charCode <= 127 ? fontMeasureInfo.asciiWidthMap != null ? fontMeasureInfo.asciiWidthMap[charCode] : fontMeasureInfo.asciiCharWidth : fontMeasureInfo.stWideCharWidth;
|
|
5734
|
+
}
|
|
5735
|
+
function measureWidth(fontMeasureInfo, text) {
|
|
5736
|
+
var strWidthCache = fontMeasureInfo.strWidthCache;
|
|
5737
|
+
var width = strWidthCache.get(text);
|
|
5540
5738
|
if (width == null) {
|
|
5541
|
-
width = platformApi.measureText(text, font).width;
|
|
5542
|
-
|
|
5739
|
+
width = platformApi.measureText(text, fontMeasureInfo.font).width;
|
|
5740
|
+
strWidthCache.put(text, width);
|
|
5543
5741
|
}
|
|
5544
5742
|
return width;
|
|
5545
5743
|
}
|
|
5546
5744
|
function innerGetBoundingRect(text, font, textAlign, textBaseline) {
|
|
5547
|
-
var width =
|
|
5745
|
+
var width = measureWidth(ensureFontMeasureInfo(font), text);
|
|
5548
5746
|
var height = getLineHeight(font);
|
|
5549
5747
|
var x = adjustTextX(0, width, textAlign);
|
|
5550
5748
|
var y = adjustTextY2(0, height, textBaseline);
|
|
@@ -5565,24 +5763,24 @@ function getBoundingRect(text, font, textAlign, textBaseline) {
|
|
|
5565
5763
|
return uniondRect;
|
|
5566
5764
|
}
|
|
5567
5765
|
}
|
|
5568
|
-
function adjustTextX(x, width, textAlign) {
|
|
5766
|
+
function adjustTextX(x, width, textAlign, inverse) {
|
|
5569
5767
|
if (textAlign === "right") {
|
|
5570
|
-
x -= width;
|
|
5768
|
+
!inverse ? x -= width : x += width;
|
|
5571
5769
|
} else if (textAlign === "center") {
|
|
5572
|
-
x -= width / 2;
|
|
5770
|
+
!inverse ? x -= width / 2 : x += width / 2;
|
|
5573
5771
|
}
|
|
5574
5772
|
return x;
|
|
5575
5773
|
}
|
|
5576
|
-
function adjustTextY2(y, height, verticalAlign) {
|
|
5774
|
+
function adjustTextY2(y, height, verticalAlign, inverse) {
|
|
5577
5775
|
if (verticalAlign === "middle") {
|
|
5578
|
-
y -= height / 2;
|
|
5776
|
+
!inverse ? y -= height / 2 : y += height / 2;
|
|
5579
5777
|
} else if (verticalAlign === "bottom") {
|
|
5580
|
-
y -= height;
|
|
5778
|
+
!inverse ? y -= height : y += height;
|
|
5581
5779
|
}
|
|
5582
5780
|
return y;
|
|
5583
5781
|
}
|
|
5584
5782
|
function getLineHeight(font) {
|
|
5585
|
-
return
|
|
5783
|
+
return ensureFontMeasureInfo(font).stWideCharWidth;
|
|
5586
5784
|
}
|
|
5587
5785
|
function parsePercent(value, maxValue) {
|
|
5588
5786
|
if (typeof value === "string") {
|
|
@@ -5690,7 +5888,7 @@ function calculateTextPosition(out, opts, rect) {
|
|
|
5690
5888
|
return out;
|
|
5691
5889
|
}
|
|
5692
5890
|
|
|
5693
|
-
// ../../node_modules/.pnpm/zrender@
|
|
5891
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/Element.js
|
|
5694
5892
|
var PRESERVED_NORMAL_STATE = "__zr_normal__";
|
|
5695
5893
|
var PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(["ignore"]);
|
|
5696
5894
|
var DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function(obj, key) {
|
|
@@ -5699,6 +5897,9 @@ var DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function(obj, key) {
|
|
|
5699
5897
|
}, { ignore: false });
|
|
5700
5898
|
var tmpTextPosCalcRes = {};
|
|
5701
5899
|
var tmpBoundingRect = new BoundingRect_default(0, 0, 0, 0);
|
|
5900
|
+
var tmpInnerTextTrans = [];
|
|
5901
|
+
var IN_HOVER_LAYER_KIND_NO = 0;
|
|
5902
|
+
var IN_HOVER_LAYER_KIND_ONLY_STYLE_CHANGE = 1;
|
|
5702
5903
|
var Element = function() {
|
|
5703
5904
|
function Element2(props) {
|
|
5704
5905
|
this.id = guid();
|
|
@@ -5753,8 +5954,11 @@ var Element = function() {
|
|
|
5753
5954
|
innerTransformable.parent = isLocal ? this : null;
|
|
5754
5955
|
var innerOrigin = false;
|
|
5755
5956
|
innerTransformable.copyTransform(textEl);
|
|
5756
|
-
|
|
5757
|
-
|
|
5957
|
+
var hasPosition = textConfig.position != null;
|
|
5958
|
+
var autoOverflowArea = textConfig.autoOverflowArea;
|
|
5959
|
+
var layoutRect = void 0;
|
|
5960
|
+
if (autoOverflowArea || hasPosition) {
|
|
5961
|
+
layoutRect = tmpBoundingRect;
|
|
5758
5962
|
if (textConfig.layoutRect) {
|
|
5759
5963
|
layoutRect.copy(textConfig.layoutRect);
|
|
5760
5964
|
} else {
|
|
@@ -5763,6 +5967,8 @@ var Element = function() {
|
|
|
5763
5967
|
if (!isLocal) {
|
|
5764
5968
|
layoutRect.applyTransform(this.transform);
|
|
5765
5969
|
}
|
|
5970
|
+
}
|
|
5971
|
+
if (hasPosition) {
|
|
5766
5972
|
if (this.calculateTextPosition) {
|
|
5767
5973
|
this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);
|
|
5768
5974
|
} else {
|
|
@@ -5800,8 +6006,17 @@ var Element = function() {
|
|
|
5800
6006
|
innerTransformable.originY = -textOffset[1];
|
|
5801
6007
|
}
|
|
5802
6008
|
}
|
|
5803
|
-
var isInside = textConfig.inside == null ? typeof textConfig.position === "string" && textConfig.position.indexOf("inside") >= 0 : textConfig.inside;
|
|
5804
6009
|
var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});
|
|
6010
|
+
if (autoOverflowArea) {
|
|
6011
|
+
var overflowRect = innerTextDefaultStyle.overflowRect = innerTextDefaultStyle.overflowRect || new BoundingRect_default(0, 0, 0, 0);
|
|
6012
|
+
innerTransformable.getLocalTransform(tmpInnerTextTrans);
|
|
6013
|
+
invert(tmpInnerTextTrans, tmpInnerTextTrans);
|
|
6014
|
+
BoundingRect_default.copy(overflowRect, layoutRect);
|
|
6015
|
+
overflowRect.applyTransform(tmpInnerTextTrans);
|
|
6016
|
+
} else {
|
|
6017
|
+
innerTextDefaultStyle.overflowRect = null;
|
|
6018
|
+
}
|
|
6019
|
+
var isInside = textConfig.inside == null ? typeof textConfig.position === "string" && textConfig.position.indexOf("inside") >= 0 : textConfig.inside;
|
|
5805
6020
|
var textFill = void 0;
|
|
5806
6021
|
var textStroke = void 0;
|
|
5807
6022
|
var autoStroke = void 0;
|
|
@@ -5979,18 +6194,18 @@ var Element = function() {
|
|
|
5979
6194
|
if (!toNormalState) {
|
|
5980
6195
|
this.saveCurrentToNormalState(state);
|
|
5981
6196
|
}
|
|
5982
|
-
var useHoverLayer = !!(state && state.hoverLayer || forceUseHoverLayer);
|
|
5983
|
-
if (useHoverLayer) {
|
|
5984
|
-
this._toggleHoverLayerFlag(true);
|
|
5985
|
-
}
|
|
5986
|
-
this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);
|
|
5987
6197
|
var textContent = this._textContent;
|
|
6198
|
+
var useHoverLayer = shouldUseHoverLayer(this, textContent, state, forceUseHoverLayer);
|
|
6199
|
+
if (useHoverLayer && !this.__inHover) {
|
|
6200
|
+
this.__inHover = useHoverLayer;
|
|
6201
|
+
}
|
|
6202
|
+
this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, canTransition(this, noAnimation, animationCfg), animationCfg);
|
|
5988
6203
|
var textGuide = this._textGuide;
|
|
5989
6204
|
if (textContent) {
|
|
5990
|
-
textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);
|
|
6205
|
+
textContent.useState(stateName, keepCurrentStates, noAnimation, !!useHoverLayer);
|
|
5991
6206
|
}
|
|
5992
6207
|
if (textGuide) {
|
|
5993
|
-
textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);
|
|
6208
|
+
textGuide.useState(stateName, keepCurrentStates, noAnimation, !!useHoverLayer);
|
|
5994
6209
|
}
|
|
5995
6210
|
if (toNormalState) {
|
|
5996
6211
|
this.currentStates = [];
|
|
@@ -6005,7 +6220,7 @@ var Element = function() {
|
|
|
6005
6220
|
this._updateAnimationTargets();
|
|
6006
6221
|
this.markRedraw();
|
|
6007
6222
|
if (!useHoverLayer && this.__inHover) {
|
|
6008
|
-
this.
|
|
6223
|
+
this.__inHover = IN_HOVER_LAYER_KIND_NO;
|
|
6009
6224
|
this.__dirty &= ~REDRAW_BIT;
|
|
6010
6225
|
}
|
|
6011
6226
|
return state;
|
|
@@ -6043,42 +6258,41 @@ var Element = function() {
|
|
|
6043
6258
|
}
|
|
6044
6259
|
}
|
|
6045
6260
|
var lastStateObj = stateObjects[len2 - 1];
|
|
6046
|
-
var
|
|
6047
|
-
|
|
6048
|
-
|
|
6261
|
+
var textContent = this._textContent;
|
|
6262
|
+
var useHoverLayer = shouldUseHoverLayer(this, textContent, lastStateObj, forceUseHoverLayer);
|
|
6263
|
+
if (useHoverLayer && !this.__inHover) {
|
|
6264
|
+
this.__inHover = useHoverLayer;
|
|
6049
6265
|
}
|
|
6050
6266
|
var mergedState = this._mergeStates(stateObjects);
|
|
6051
6267
|
var animationCfg = this.stateTransition;
|
|
6052
6268
|
this.saveCurrentToNormalState(mergedState);
|
|
6053
|
-
this._applyStateObj(states.join(","), mergedState, this._normalState, false,
|
|
6054
|
-
var textContent = this._textContent;
|
|
6269
|
+
this._applyStateObj(states.join(","), mergedState, this._normalState, false, canTransition(this, noAnimation, animationCfg), animationCfg);
|
|
6055
6270
|
var textGuide = this._textGuide;
|
|
6056
6271
|
if (textContent) {
|
|
6057
|
-
textContent.useStates(states, noAnimation, useHoverLayer);
|
|
6272
|
+
textContent.useStates(states, noAnimation, !!useHoverLayer);
|
|
6058
6273
|
}
|
|
6059
6274
|
if (textGuide) {
|
|
6060
|
-
textGuide.useStates(states, noAnimation, useHoverLayer);
|
|
6275
|
+
textGuide.useStates(states, noAnimation, !!useHoverLayer);
|
|
6061
6276
|
}
|
|
6062
6277
|
this._updateAnimationTargets();
|
|
6063
6278
|
this.currentStates = states.slice();
|
|
6064
6279
|
this.markRedraw();
|
|
6065
6280
|
if (!useHoverLayer && this.__inHover) {
|
|
6066
|
-
this.
|
|
6281
|
+
this.__inHover = IN_HOVER_LAYER_KIND_NO;
|
|
6067
6282
|
this.__dirty &= ~REDRAW_BIT;
|
|
6068
6283
|
}
|
|
6069
6284
|
}
|
|
6070
6285
|
};
|
|
6071
6286
|
Element2.prototype.isSilent = function() {
|
|
6072
|
-
var
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
isSilent = true;
|
|
6077
|
-
break;
|
|
6287
|
+
var el = this;
|
|
6288
|
+
while (el) {
|
|
6289
|
+
if (el.silent) {
|
|
6290
|
+
return true;
|
|
6078
6291
|
}
|
|
6079
|
-
|
|
6292
|
+
var hostEl = el.__hostTarget;
|
|
6293
|
+
el = hostEl ? el.ignoreHostSilent ? null : hostEl : el.parent;
|
|
6080
6294
|
}
|
|
6081
|
-
return
|
|
6295
|
+
return false;
|
|
6082
6296
|
};
|
|
6083
6297
|
Element2.prototype._updateAnimationTargets = function() {
|
|
6084
6298
|
for (var i = 0; i < this.animators.length; i++) {
|
|
@@ -6135,6 +6349,9 @@ var Element = function() {
|
|
|
6135
6349
|
return mergedState;
|
|
6136
6350
|
};
|
|
6137
6351
|
Element2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
|
|
6352
|
+
if (this.__inHover === IN_HOVER_LAYER_KIND_ONLY_STYLE_CHANGE) {
|
|
6353
|
+
return;
|
|
6354
|
+
}
|
|
6138
6355
|
var needsRestoreToNormal = !(state && keepCurrentStates);
|
|
6139
6356
|
if (state && state.textConfig) {
|
|
6140
6357
|
this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);
|
|
@@ -6304,17 +6521,6 @@ var Element = function() {
|
|
|
6304
6521
|
Element2.prototype.dirty = function() {
|
|
6305
6522
|
this.markRedraw();
|
|
6306
6523
|
};
|
|
6307
|
-
Element2.prototype._toggleHoverLayerFlag = function(inHover) {
|
|
6308
|
-
this.__inHover = inHover;
|
|
6309
|
-
var textContent = this._textContent;
|
|
6310
|
-
var textGuide = this._textGuide;
|
|
6311
|
-
if (textContent) {
|
|
6312
|
-
textContent.__inHover = inHover;
|
|
6313
|
-
}
|
|
6314
|
-
if (textGuide) {
|
|
6315
|
-
textGuide.__inHover = inHover;
|
|
6316
|
-
}
|
|
6317
|
-
};
|
|
6318
6524
|
Element2.prototype.addSelfToZr = function(zr) {
|
|
6319
6525
|
if (this.__zr === zr) {
|
|
6320
6526
|
return;
|
|
@@ -6428,7 +6634,8 @@ var Element = function() {
|
|
|
6428
6634
|
var elProto = Element2.prototype;
|
|
6429
6635
|
elProto.type = "element";
|
|
6430
6636
|
elProto.name = "";
|
|
6431
|
-
elProto.ignore = elProto.silent = elProto.
|
|
6637
|
+
elProto.ignore = elProto.silent = elProto.ignoreHostSilent = elProto.isGroup = elProto.draggable = elProto.dragging = elProto.ignoreClip = false;
|
|
6638
|
+
elProto.__inHover = IN_HOVER_LAYER_KIND_NO;
|
|
6432
6639
|
elProto.__dirty = REDRAW_BIT;
|
|
6433
6640
|
var logs = {};
|
|
6434
6641
|
function logDeprecatedError(key, xKey, yKey) {
|
|
@@ -6682,9 +6889,18 @@ function animateToShallow(animatable, topKey, animateObj, target, cfg, animation
|
|
|
6682
6889
|
animators.push(animator);
|
|
6683
6890
|
}
|
|
6684
6891
|
}
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6892
|
+
function shouldUseHoverLayer(el, textContent, nextState, forceUseHoverLayer) {
|
|
6893
|
+
return !(nextState && nextState.hoverLayer || forceUseHoverLayer) || isTextRelatedEl(el) || textContent && isTextRelatedEl(textContent) ? IN_HOVER_LAYER_KIND_NO : IN_HOVER_LAYER_KIND_ONLY_STYLE_CHANGE;
|
|
6894
|
+
}
|
|
6895
|
+
function isTextRelatedEl(el) {
|
|
6896
|
+
return el.type === "text" || el.type === "tspan";
|
|
6897
|
+
}
|
|
6898
|
+
function canTransition(el, noAnimation, animationCfg) {
|
|
6899
|
+
return !noAnimation && !el.__inHover && animationCfg && animationCfg.duration > 0;
|
|
6900
|
+
}
|
|
6901
|
+
var Element_default = Element;
|
|
6902
|
+
|
|
6903
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/Group.js
|
|
6688
6904
|
var Group = function(_super) {
|
|
6689
6905
|
__extends(Group2, _super);
|
|
6690
6906
|
function Group2(opts) {
|
|
@@ -6859,7 +7075,7 @@ var Group = function(_super) {
|
|
|
6859
7075
|
Group.prototype.type = "group";
|
|
6860
7076
|
var Group_default = Group;
|
|
6861
7077
|
|
|
6862
|
-
// ../../node_modules/.pnpm/zrender@
|
|
7078
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/zrender.js
|
|
6863
7079
|
var painterCtors = {};
|
|
6864
7080
|
var instances = {};
|
|
6865
7081
|
function delInstance(id) {
|
|
@@ -6889,7 +7105,7 @@ var ZRender = function() {
|
|
|
6889
7105
|
this._sleepAfterStill = 10;
|
|
6890
7106
|
this._stillFrameAccum = 0;
|
|
6891
7107
|
this._needsRefresh = true;
|
|
6892
|
-
this._needsRefreshHover =
|
|
7108
|
+
this._needsRefreshHover = false;
|
|
6893
7109
|
this._darkMode = false;
|
|
6894
7110
|
opts = opts || {};
|
|
6895
7111
|
this.dom = dom;
|
|
@@ -6921,7 +7137,7 @@ var ZRender = function() {
|
|
|
6921
7137
|
this.animation = new Animation_default({
|
|
6922
7138
|
stage: {
|
|
6923
7139
|
update: ssrMode ? null : function() {
|
|
6924
|
-
return _this._flush(
|
|
7140
|
+
return _this._flush(false);
|
|
6925
7141
|
}
|
|
6926
7142
|
}
|
|
6927
7143
|
});
|
|
@@ -6974,16 +7190,26 @@ var ZRender = function() {
|
|
|
6974
7190
|
ZRender2.prototype.isDarkMode = function() {
|
|
6975
7191
|
return this._darkMode;
|
|
6976
7192
|
};
|
|
6977
|
-
ZRender2.prototype.refreshImmediately = function(
|
|
7193
|
+
ZRender2.prototype.refreshImmediately = function(noAnimationUpdate) {
|
|
6978
7194
|
if (this._disposed) {
|
|
6979
7195
|
return;
|
|
6980
7196
|
}
|
|
6981
|
-
|
|
7197
|
+
this._refresh({
|
|
7198
|
+
animUpdate: !noAnimationUpdate,
|
|
7199
|
+
refresh: true,
|
|
7200
|
+
refreshHover: false
|
|
7201
|
+
});
|
|
7202
|
+
};
|
|
7203
|
+
ZRender2.prototype._refresh = function(opt) {
|
|
7204
|
+
if (opt.animUpdate) {
|
|
6982
7205
|
this.animation.update(true);
|
|
6983
7206
|
}
|
|
6984
|
-
this._needsRefresh = false;
|
|
6985
|
-
this.painter.refresh(
|
|
6986
|
-
|
|
7207
|
+
this._needsRefresh = this._needsRefreshHover = false;
|
|
7208
|
+
this.painter.refresh({
|
|
7209
|
+
refresh: opt.refresh,
|
|
7210
|
+
refreshHover: opt.refreshHover
|
|
7211
|
+
});
|
|
7212
|
+
this._needsRefresh = this._needsRefreshHover = false;
|
|
6987
7213
|
};
|
|
6988
7214
|
ZRender2.prototype.refresh = function() {
|
|
6989
7215
|
if (this._disposed) {
|
|
@@ -6996,18 +7222,20 @@ var ZRender = function() {
|
|
|
6996
7222
|
if (this._disposed) {
|
|
6997
7223
|
return;
|
|
6998
7224
|
}
|
|
6999
|
-
this._flush(
|
|
7225
|
+
this._flush(true);
|
|
7000
7226
|
};
|
|
7001
|
-
ZRender2.prototype._flush = function(
|
|
7227
|
+
ZRender2.prototype._flush = function(animationUpdate) {
|
|
7002
7228
|
var triggerRendered;
|
|
7003
7229
|
var start2 = getTime();
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
}
|
|
7008
|
-
if (this._needsRefreshHover) {
|
|
7230
|
+
var needsRefresh = this._needsRefresh;
|
|
7231
|
+
var needsRefreshHover = this._needsRefreshHover;
|
|
7232
|
+
if (needsRefresh || needsRefreshHover) {
|
|
7009
7233
|
triggerRendered = true;
|
|
7010
|
-
this.
|
|
7234
|
+
this._refresh({
|
|
7235
|
+
animUpdate: animationUpdate,
|
|
7236
|
+
refresh: needsRefresh,
|
|
7237
|
+
refreshHover: needsRefreshHover
|
|
7238
|
+
});
|
|
7011
7239
|
}
|
|
7012
7240
|
var end2 = getTime();
|
|
7013
7241
|
if (triggerRendered) {
|
|
@@ -7039,10 +7267,11 @@ var ZRender = function() {
|
|
|
7039
7267
|
if (this._disposed) {
|
|
7040
7268
|
return;
|
|
7041
7269
|
}
|
|
7042
|
-
this.
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7270
|
+
this._refresh({
|
|
7271
|
+
animUpdate: false,
|
|
7272
|
+
refresh: false,
|
|
7273
|
+
refreshHover: true
|
|
7274
|
+
});
|
|
7046
7275
|
};
|
|
7047
7276
|
ZRender2.prototype.resize = function(opts) {
|
|
7048
7277
|
if (this._disposed) {
|
|
@@ -7159,9 +7388,9 @@ function getElementSSRData(el) {
|
|
|
7159
7388
|
function registerSSRDataGetter(getter) {
|
|
7160
7389
|
ssrDataGetter = getter;
|
|
7161
7390
|
}
|
|
7162
|
-
var version = "
|
|
7391
|
+
var version = "6.1.0";
|
|
7163
7392
|
|
|
7164
|
-
// ../../node_modules/.pnpm/zrender@
|
|
7393
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/Displayable.js
|
|
7165
7394
|
var STYLE_MAGIC_KEY = "__zr_style_" + Math.round(Math.random() * 10);
|
|
7166
7395
|
var DEFAULT_COMMON_STYLE = {
|
|
7167
7396
|
shadowBlur: 0,
|
|
@@ -7202,7 +7431,7 @@ var Displayable = function(_super) {
|
|
|
7202
7431
|
this.useStyle({});
|
|
7203
7432
|
}
|
|
7204
7433
|
};
|
|
7205
|
-
Displayable2.prototype.beforeBrush = function() {
|
|
7434
|
+
Displayable2.prototype.beforeBrush = function(param) {
|
|
7206
7435
|
};
|
|
7207
7436
|
Displayable2.prototype.afterBrush = function() {
|
|
7208
7437
|
};
|
|
@@ -7215,7 +7444,7 @@ var Displayable = function(_super) {
|
|
|
7215
7444
|
if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && isDisplayableCulled(this, viewWidth, viewHeight) || m && !m[0] && !m[3]) {
|
|
7216
7445
|
return false;
|
|
7217
7446
|
}
|
|
7218
|
-
if (considerClipPath && this.__clipPaths) {
|
|
7447
|
+
if (considerClipPath && this.__clipPaths && this.__clipPaths.length) {
|
|
7219
7448
|
for (var i = 0; i < this.__clipPaths.length; ++i) {
|
|
7220
7449
|
if (this.__clipPaths[i].isZeroArea()) {
|
|
7221
7450
|
return false;
|
|
@@ -7341,13 +7570,12 @@ var Displayable = function(_super) {
|
|
|
7341
7570
|
if (!obj[STYLE_MAGIC_KEY]) {
|
|
7342
7571
|
obj = this.createStyle(obj);
|
|
7343
7572
|
}
|
|
7344
|
-
|
|
7345
|
-
this.__hoverStyle = obj;
|
|
7346
|
-
} else {
|
|
7347
|
-
this.style = obj;
|
|
7348
|
-
}
|
|
7573
|
+
this.style = obj;
|
|
7349
7574
|
this.dirtyStyle();
|
|
7350
7575
|
};
|
|
7576
|
+
Displayable2.prototype._useHoverStyle = function(obj) {
|
|
7577
|
+
this.__hoverStyle = obj;
|
|
7578
|
+
};
|
|
7351
7579
|
Displayable2.prototype.isStyleObject = function(obj) {
|
|
7352
7580
|
return obj[STYLE_MAGIC_KEY];
|
|
7353
7581
|
};
|
|
@@ -7362,6 +7590,7 @@ var Displayable = function(_super) {
|
|
|
7362
7590
|
Displayable2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
|
|
7363
7591
|
_super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);
|
|
7364
7592
|
var needsRestoreToNormal = !(state && keepCurrentStates);
|
|
7593
|
+
var inHoverOnlyStyleChange = this.__inHover === IN_HOVER_LAYER_KIND_ONLY_STYLE_CHANGE;
|
|
7365
7594
|
var targetStyle;
|
|
7366
7595
|
if (state && state.style) {
|
|
7367
7596
|
if (transition) {
|
|
@@ -7401,17 +7630,23 @@ var Displayable = function(_super) {
|
|
|
7401
7630
|
style: targetStyle
|
|
7402
7631
|
}, animationCfg, this.getAnimationStyleProps());
|
|
7403
7632
|
} else {
|
|
7404
|
-
|
|
7633
|
+
if (inHoverOnlyStyleChange) {
|
|
7634
|
+
this._useHoverStyle(targetStyle);
|
|
7635
|
+
} else {
|
|
7636
|
+
this.useStyle(targetStyle);
|
|
7637
|
+
}
|
|
7405
7638
|
}
|
|
7406
7639
|
}
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
var
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
if (
|
|
7414
|
-
|
|
7640
|
+
if (!inHoverOnlyStyleChange) {
|
|
7641
|
+
var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS2;
|
|
7642
|
+
for (var i = 0; i < statesKeys.length; i++) {
|
|
7643
|
+
var key = statesKeys[i];
|
|
7644
|
+
if (state && state[key] != null) {
|
|
7645
|
+
this[key] = state[key];
|
|
7646
|
+
} else if (needsRestoreToNormal) {
|
|
7647
|
+
if (normalState[key] != null) {
|
|
7648
|
+
this[key] = normalState[key];
|
|
7649
|
+
}
|
|
7415
7650
|
}
|
|
7416
7651
|
}
|
|
7417
7652
|
}
|
|
@@ -7448,7 +7683,7 @@ var Displayable = function(_super) {
|
|
|
7448
7683
|
dispProto.culling = false;
|
|
7449
7684
|
dispProto.cursor = "pointer";
|
|
7450
7685
|
dispProto.rectHover = false;
|
|
7451
|
-
dispProto.incremental =
|
|
7686
|
+
dispProto.incremental = 0;
|
|
7452
7687
|
dispProto._rect = null;
|
|
7453
7688
|
dispProto.dirtyRectTolerance = 0;
|
|
7454
7689
|
dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;
|
|
@@ -7468,7 +7703,7 @@ function isDisplayableCulled(el, width, height) {
|
|
|
7468
7703
|
}
|
|
7469
7704
|
var Displayable_default = Displayable;
|
|
7470
7705
|
|
|
7471
|
-
// ../../node_modules/.pnpm/zrender@
|
|
7706
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/bbox.js
|
|
7472
7707
|
var mathMin2 = Math.min;
|
|
7473
7708
|
var mathMax2 = Math.max;
|
|
7474
7709
|
var mathSin = Math.sin;
|
|
@@ -7591,7 +7826,7 @@ function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min3, max3)
|
|
|
7591
7826
|
}
|
|
7592
7827
|
}
|
|
7593
7828
|
|
|
7594
|
-
// ../../node_modules/.pnpm/zrender@
|
|
7829
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/PathProxy.js
|
|
7595
7830
|
var CMD = {
|
|
7596
7831
|
M: 1,
|
|
7597
7832
|
L: 2,
|
|
@@ -7611,7 +7846,7 @@ var mathMin3 = Math.min;
|
|
|
7611
7846
|
var mathMax3 = Math.max;
|
|
7612
7847
|
var mathCos2 = Math.cos;
|
|
7613
7848
|
var mathSin2 = Math.sin;
|
|
7614
|
-
var
|
|
7849
|
+
var mathAbs2 = Math.abs;
|
|
7615
7850
|
var PI = Math.PI;
|
|
7616
7851
|
var PI22 = PI * 2;
|
|
7617
7852
|
var hasTypedArray = typeof Float32Array !== "undefined";
|
|
@@ -7664,8 +7899,8 @@ var PathProxy = function() {
|
|
|
7664
7899
|
PathProxy2.prototype.setScale = function(sx, sy, segmentIgnoreThreshold) {
|
|
7665
7900
|
segmentIgnoreThreshold = segmentIgnoreThreshold || 0;
|
|
7666
7901
|
if (segmentIgnoreThreshold > 0) {
|
|
7667
|
-
this._ux =
|
|
7668
|
-
this._uy =
|
|
7902
|
+
this._ux = mathAbs2(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;
|
|
7903
|
+
this._uy = mathAbs2(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;
|
|
7669
7904
|
}
|
|
7670
7905
|
};
|
|
7671
7906
|
PathProxy2.prototype.setDPR = function(dpr2) {
|
|
@@ -7703,8 +7938,8 @@ var PathProxy = function() {
|
|
|
7703
7938
|
return this;
|
|
7704
7939
|
};
|
|
7705
7940
|
PathProxy2.prototype.lineTo = function(x, y) {
|
|
7706
|
-
var dx =
|
|
7707
|
-
var dy =
|
|
7941
|
+
var dx = mathAbs2(x - this._xi);
|
|
7942
|
+
var dy = mathAbs2(y - this._yi);
|
|
7708
7943
|
var exceedUnit = dx > this._ux || dy > this._uy;
|
|
7709
7944
|
this.addData(CMD.L, x, y);
|
|
7710
7945
|
if (this._ctx && exceedUnit) {
|
|
@@ -7796,6 +8031,9 @@ var PathProxy = function() {
|
|
|
7796
8031
|
return this._len;
|
|
7797
8032
|
};
|
|
7798
8033
|
PathProxy2.prototype.setData = function(data) {
|
|
8034
|
+
if (!this._saveData) {
|
|
8035
|
+
return;
|
|
8036
|
+
}
|
|
7799
8037
|
var len2 = data.length;
|
|
7800
8038
|
if (!(this.data && this.data.length === len2) && hasTypedArray) {
|
|
7801
8039
|
this.data = new Float32Array(len2);
|
|
@@ -7806,6 +8044,9 @@ var PathProxy = function() {
|
|
|
7806
8044
|
this._len = len2;
|
|
7807
8045
|
};
|
|
7808
8046
|
PathProxy2.prototype.appendPath = function(path) {
|
|
8047
|
+
if (!this._saveData) {
|
|
8048
|
+
return;
|
|
8049
|
+
}
|
|
7809
8050
|
if (!(path instanceof Array)) {
|
|
7810
8051
|
path = [path];
|
|
7811
8052
|
}
|
|
@@ -7815,8 +8056,14 @@ var PathProxy = function() {
|
|
|
7815
8056
|
for (var i = 0; i < len2; i++) {
|
|
7816
8057
|
appendSize += path[i].len();
|
|
7817
8058
|
}
|
|
7818
|
-
|
|
8059
|
+
var oldData = this.data;
|
|
8060
|
+
if (hasTypedArray && (oldData instanceof Float32Array || !oldData)) {
|
|
7819
8061
|
this.data = new Float32Array(offset + appendSize);
|
|
8062
|
+
if (offset > 0 && oldData) {
|
|
8063
|
+
for (var k = 0; k < offset; k++) {
|
|
8064
|
+
this.data[k] = oldData[k];
|
|
8065
|
+
}
|
|
8066
|
+
}
|
|
7820
8067
|
}
|
|
7821
8068
|
for (var i = 0; i < len2; i++) {
|
|
7822
8069
|
var appendPathData = path[i].data;
|
|
@@ -7981,7 +8228,7 @@ var PathProxy = function() {
|
|
|
7981
8228
|
var y2 = data[i++];
|
|
7982
8229
|
var dx = x2 - xi;
|
|
7983
8230
|
var dy = y2 - yi;
|
|
7984
|
-
if (
|
|
8231
|
+
if (mathAbs2(dx) > ux || mathAbs2(dy) > uy || i === len2 - 1) {
|
|
7985
8232
|
l = Math.sqrt(dx * dx + dy * dy);
|
|
7986
8233
|
xi = x2;
|
|
7987
8234
|
yi = y2;
|
|
@@ -8106,8 +8353,8 @@ var PathProxy = function() {
|
|
|
8106
8353
|
case CMD.L: {
|
|
8107
8354
|
x = d[i++];
|
|
8108
8355
|
y = d[i++];
|
|
8109
|
-
var dx =
|
|
8110
|
-
var dy =
|
|
8356
|
+
var dx = mathAbs2(x - xi);
|
|
8357
|
+
var dy = mathAbs2(y - yi);
|
|
8111
8358
|
if (dx > ux || dy > uy) {
|
|
8112
8359
|
if (drawPart) {
|
|
8113
8360
|
var l = pathSegLen[segCount++];
|
|
@@ -8186,7 +8433,7 @@ var PathProxy = function() {
|
|
|
8186
8433
|
var psi = d[i++];
|
|
8187
8434
|
var anticlockwise = !d[i++];
|
|
8188
8435
|
var r = rx > ry ? rx : ry;
|
|
8189
|
-
var isEllipse =
|
|
8436
|
+
var isEllipse = mathAbs2(rx - ry) > 1e-3;
|
|
8190
8437
|
var endAngle = startAngle + delta;
|
|
8191
8438
|
var breakBuild = false;
|
|
8192
8439
|
if (drawPart) {
|
|
@@ -8266,6 +8513,9 @@ var PathProxy = function() {
|
|
|
8266
8513
|
newProxy._len = this._len;
|
|
8267
8514
|
return newProxy;
|
|
8268
8515
|
};
|
|
8516
|
+
PathProxy2.prototype.canSave = function() {
|
|
8517
|
+
return !!this._saveData;
|
|
8518
|
+
};
|
|
8269
8519
|
PathProxy2.CMD = CMD;
|
|
8270
8520
|
PathProxy2.initDefaultProps = function() {
|
|
8271
8521
|
var proto = PathProxy2.prototype;
|
|
@@ -8279,7 +8529,7 @@ var PathProxy = function() {
|
|
|
8279
8529
|
}();
|
|
8280
8530
|
var PathProxy_default = PathProxy;
|
|
8281
8531
|
|
|
8282
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8532
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/helper/image.js
|
|
8283
8533
|
var globalImageCache = new LRU_default(50);
|
|
8284
8534
|
function findExistImage(newImageOrSrc) {
|
|
8285
8535
|
if (typeof newImageOrSrc === "string") {
|
|
@@ -8329,7 +8579,7 @@ function isImageReady(image) {
|
|
|
8329
8579
|
return image && image.width && image.height;
|
|
8330
8580
|
}
|
|
8331
8581
|
|
|
8332
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8582
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/canvas/helper.js
|
|
8333
8583
|
function isSafeNum(num) {
|
|
8334
8584
|
return isFinite(num);
|
|
8335
8585
|
}
|
|
@@ -8403,10 +8653,10 @@ function getSize(root, whIdx, opts) {
|
|
|
8403
8653
|
return parseFloat(opts[wh]);
|
|
8404
8654
|
}
|
|
8405
8655
|
var stl = document.defaultView.getComputedStyle(root);
|
|
8406
|
-
return (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0)
|
|
8656
|
+
return (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0) || 0;
|
|
8407
8657
|
}
|
|
8408
8658
|
|
|
8409
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8659
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/line.js
|
|
8410
8660
|
function containStroke(x0, y0, x1, y1, lineWidth, x, y) {
|
|
8411
8661
|
if (lineWidth === 0) {
|
|
8412
8662
|
return false;
|
|
@@ -8428,7 +8678,7 @@ function containStroke(x0, y0, x1, y1, lineWidth, x, y) {
|
|
|
8428
8678
|
return _s <= _l / 2 * _l / 2;
|
|
8429
8679
|
}
|
|
8430
8680
|
|
|
8431
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8681
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/cubic.js
|
|
8432
8682
|
function containStroke2(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
|
|
8433
8683
|
if (lineWidth === 0) {
|
|
8434
8684
|
return false;
|
|
@@ -8441,7 +8691,7 @@ function containStroke2(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
|
|
|
8441
8691
|
return d <= _l / 2;
|
|
8442
8692
|
}
|
|
8443
8693
|
|
|
8444
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8694
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/quadratic.js
|
|
8445
8695
|
function containStroke3(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
|
|
8446
8696
|
if (lineWidth === 0) {
|
|
8447
8697
|
return false;
|
|
@@ -8454,7 +8704,7 @@ function containStroke3(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
|
|
|
8454
8704
|
return d <= _l / 2;
|
|
8455
8705
|
}
|
|
8456
8706
|
|
|
8457
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8707
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/util.js
|
|
8458
8708
|
var PI23 = Math.PI * 2;
|
|
8459
8709
|
function normalizeRadian(angle) {
|
|
8460
8710
|
angle %= PI23;
|
|
@@ -8464,7 +8714,7 @@ function normalizeRadian(angle) {
|
|
|
8464
8714
|
return angle;
|
|
8465
8715
|
}
|
|
8466
8716
|
|
|
8467
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8717
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/arc.js
|
|
8468
8718
|
var PI24 = Math.PI * 2;
|
|
8469
8719
|
function containStroke4(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
|
|
8470
8720
|
if (lineWidth === 0) {
|
|
@@ -8498,7 +8748,7 @@ function containStroke4(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidt
|
|
|
8498
8748
|
return angle >= startAngle && angle <= endAngle || angle + PI24 >= startAngle && angle + PI24 <= endAngle;
|
|
8499
8749
|
}
|
|
8500
8750
|
|
|
8501
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8751
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/windingLine.js
|
|
8502
8752
|
function windingLine(x0, y0, x1, y1, x, y) {
|
|
8503
8753
|
if (y > y0 && y > y1 || y < y0 && y < y1) {
|
|
8504
8754
|
return 0;
|
|
@@ -8515,12 +8765,12 @@ function windingLine(x0, y0, x1, y1, x, y) {
|
|
|
8515
8765
|
return x_ === x ? Infinity : x_ > x ? dir : 0;
|
|
8516
8766
|
}
|
|
8517
8767
|
|
|
8518
|
-
// ../../node_modules/.pnpm/zrender@
|
|
8768
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/contain/path.js
|
|
8519
8769
|
var CMD2 = PathProxy_default.CMD;
|
|
8520
8770
|
var PI25 = Math.PI * 2;
|
|
8521
|
-
var
|
|
8771
|
+
var EPSILON5 = 1e-4;
|
|
8522
8772
|
function isAroundEqual(a, b) {
|
|
8523
|
-
return Math.abs(a - b) <
|
|
8773
|
+
return Math.abs(a - b) < EPSILON5;
|
|
8524
8774
|
}
|
|
8525
8775
|
var roots = [-1, -1, -1];
|
|
8526
8776
|
var extrema = [-1, -1];
|
|
@@ -8795,7 +9045,7 @@ function containStroke5(pathProxy, lineWidth, x, y) {
|
|
|
8795
9045
|
return containPath(pathProxy, lineWidth, true, x, y);
|
|
8796
9046
|
}
|
|
8797
9047
|
|
|
8798
|
-
// ../../node_modules/.pnpm/zrender@
|
|
9048
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/Path.js
|
|
8799
9049
|
var DEFAULT_PATH_STYLE = defaults({
|
|
8800
9050
|
fill: "#000",
|
|
8801
9051
|
stroke: null,
|
|
@@ -9081,6 +9331,9 @@ var Path = function(_super) {
|
|
|
9081
9331
|
};
|
|
9082
9332
|
Path2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
|
|
9083
9333
|
_super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);
|
|
9334
|
+
if (this.__inHover === IN_HOVER_LAYER_KIND_ONLY_STYLE_CHANGE) {
|
|
9335
|
+
return;
|
|
9336
|
+
}
|
|
9084
9337
|
var needsRestoreToNormal = !(state && keepCurrentStates);
|
|
9085
9338
|
var targetShape;
|
|
9086
9339
|
if (state && state.shape) {
|
|
@@ -9177,7 +9430,7 @@ var Path = function(_super) {
|
|
|
9177
9430
|
}(Displayable_default);
|
|
9178
9431
|
var Path_default = Path;
|
|
9179
9432
|
|
|
9180
|
-
// ../../node_modules/.pnpm/zrender@
|
|
9433
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/Image.js
|
|
9181
9434
|
var DEFAULT_IMAGE_STYLE = defaults({
|
|
9182
9435
|
x: 0,
|
|
9183
9436
|
y: 0
|
|
@@ -9244,1035 +9497,1115 @@ var ZRImage = function(_super) {
|
|
|
9244
9497
|
ZRImage.prototype.type = "image";
|
|
9245
9498
|
var Image_default = ZRImage;
|
|
9246
9499
|
|
|
9247
|
-
// ../../node_modules/.pnpm/zrender@
|
|
9248
|
-
var
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
function TSpan2() {
|
|
9260
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
9500
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/helper/parseText.js
|
|
9501
|
+
var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
|
|
9502
|
+
function truncateText(text, containerWidth, font, ellipsis, options) {
|
|
9503
|
+
var out = {};
|
|
9504
|
+
truncateText2(out, text, containerWidth, font, ellipsis, options);
|
|
9505
|
+
return out.text;
|
|
9506
|
+
}
|
|
9507
|
+
function truncateText2(out, text, containerWidth, font, ellipsis, options) {
|
|
9508
|
+
if (!containerWidth) {
|
|
9509
|
+
out.text = "";
|
|
9510
|
+
out.isTruncated = false;
|
|
9511
|
+
return;
|
|
9261
9512
|
}
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
return fill != null && fill !== "none";
|
|
9271
|
-
};
|
|
9272
|
-
TSpan2.prototype.createStyle = function(obj) {
|
|
9273
|
-
return createObject(DEFAULT_TSPAN_STYLE, obj);
|
|
9274
|
-
};
|
|
9275
|
-
TSpan2.prototype.setBoundingRect = function(rect) {
|
|
9276
|
-
this._rect = rect;
|
|
9277
|
-
};
|
|
9278
|
-
TSpan2.prototype.getBoundingRect = function() {
|
|
9279
|
-
var style = this.style;
|
|
9280
|
-
if (!this._rect) {
|
|
9281
|
-
var text = style.text;
|
|
9282
|
-
text != null ? text += "" : text = "";
|
|
9283
|
-
var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);
|
|
9284
|
-
rect.x += style.x || 0;
|
|
9285
|
-
rect.y += style.y || 0;
|
|
9286
|
-
if (this.hasStroke()) {
|
|
9287
|
-
var w = style.lineWidth;
|
|
9288
|
-
rect.x -= w / 2;
|
|
9289
|
-
rect.y -= w / 2;
|
|
9290
|
-
rect.width += w;
|
|
9291
|
-
rect.height += w;
|
|
9292
|
-
}
|
|
9293
|
-
this._rect = rect;
|
|
9294
|
-
}
|
|
9295
|
-
return this._rect;
|
|
9296
|
-
};
|
|
9297
|
-
TSpan2.initDefaultProps = function() {
|
|
9298
|
-
var tspanProto = TSpan2.prototype;
|
|
9299
|
-
tspanProto.dirtyRectTolerance = 10;
|
|
9300
|
-
}();
|
|
9301
|
-
return TSpan2;
|
|
9302
|
-
}(Displayable_default);
|
|
9303
|
-
TSpan.prototype.type = "tspan";
|
|
9304
|
-
var TSpan_default = TSpan;
|
|
9305
|
-
|
|
9306
|
-
// ../../node_modules/.pnpm/zrender@5.5.0/node_modules/zrender/lib/canvas/dashStyle.js
|
|
9307
|
-
function normalizeLineDash(lineType, lineWidth) {
|
|
9308
|
-
if (!lineType || lineType === "solid" || !(lineWidth > 0)) {
|
|
9309
|
-
return null;
|
|
9513
|
+
var textLines = (text + "").split("\n");
|
|
9514
|
+
options = prepareTruncateOptions(containerWidth, font, ellipsis, options);
|
|
9515
|
+
var isTruncated = false;
|
|
9516
|
+
var truncateOut = {};
|
|
9517
|
+
for (var i = 0, len2 = textLines.length; i < len2; i++) {
|
|
9518
|
+
truncateSingleLine(truncateOut, textLines[i], options);
|
|
9519
|
+
textLines[i] = truncateOut.textLine;
|
|
9520
|
+
isTruncated = isTruncated || truncateOut.isTruncated;
|
|
9310
9521
|
}
|
|
9311
|
-
|
|
9522
|
+
out.text = textLines.join("\n");
|
|
9523
|
+
out.isTruncated = isTruncated;
|
|
9312
9524
|
}
|
|
9313
|
-
function
|
|
9314
|
-
|
|
9315
|
-
var
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9525
|
+
function prepareTruncateOptions(containerWidth, font, ellipsis, options) {
|
|
9526
|
+
options = options || {};
|
|
9527
|
+
var preparedOpts = extend({}, options);
|
|
9528
|
+
ellipsis = retrieve2(ellipsis, "...");
|
|
9529
|
+
preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);
|
|
9530
|
+
var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);
|
|
9531
|
+
var fontMeasureInfo = preparedOpts.fontMeasureInfo = ensureFontMeasureInfo(font);
|
|
9532
|
+
var ascCharWidth = fontMeasureInfo.asciiCharWidth;
|
|
9533
|
+
preparedOpts.placeholder = retrieve2(options.placeholder, "");
|
|
9534
|
+
var contentWidth = containerWidth = Math.max(0, containerWidth - 1);
|
|
9535
|
+
for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {
|
|
9536
|
+
contentWidth -= ascCharWidth;
|
|
9325
9537
|
}
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
return
|
|
9538
|
+
var ellipsisWidth = measureWidth(fontMeasureInfo, ellipsis);
|
|
9539
|
+
if (ellipsisWidth > contentWidth) {
|
|
9540
|
+
ellipsis = "";
|
|
9541
|
+
ellipsisWidth = 0;
|
|
9542
|
+
}
|
|
9543
|
+
contentWidth = containerWidth - ellipsisWidth;
|
|
9544
|
+
preparedOpts.ellipsis = ellipsis;
|
|
9545
|
+
preparedOpts.ellipsisWidth = ellipsisWidth;
|
|
9546
|
+
preparedOpts.contentWidth = contentWidth;
|
|
9547
|
+
preparedOpts.containerWidth = containerWidth;
|
|
9548
|
+
return preparedOpts;
|
|
9337
9549
|
}
|
|
9338
|
-
function
|
|
9339
|
-
var
|
|
9340
|
-
|
|
9550
|
+
function truncateSingleLine(out, textLine, options) {
|
|
9551
|
+
var containerWidth = options.containerWidth;
|
|
9552
|
+
var contentWidth = options.contentWidth;
|
|
9553
|
+
var fontMeasureInfo = options.fontMeasureInfo;
|
|
9554
|
+
if (!containerWidth) {
|
|
9555
|
+
out.textLine = "";
|
|
9556
|
+
out.isTruncated = false;
|
|
9557
|
+
return;
|
|
9558
|
+
}
|
|
9559
|
+
var lineWidth = measureWidth(fontMeasureInfo, textLine);
|
|
9560
|
+
if (lineWidth <= containerWidth) {
|
|
9561
|
+
out.textLine = textLine;
|
|
9562
|
+
out.isTruncated = false;
|
|
9563
|
+
return;
|
|
9564
|
+
}
|
|
9565
|
+
for (var j = 0; ; j++) {
|
|
9566
|
+
if (lineWidth <= contentWidth || j >= options.maxIterations) {
|
|
9567
|
+
textLine += options.ellipsis;
|
|
9568
|
+
break;
|
|
9569
|
+
}
|
|
9570
|
+
var subLength = j === 0 ? estimateLength(textLine, contentWidth, fontMeasureInfo) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0;
|
|
9571
|
+
textLine = textLine.substr(0, subLength);
|
|
9572
|
+
lineWidth = measureWidth(fontMeasureInfo, textLine);
|
|
9573
|
+
}
|
|
9574
|
+
if (textLine === "") {
|
|
9575
|
+
textLine = options.placeholder;
|
|
9576
|
+
}
|
|
9577
|
+
out.textLine = textLine;
|
|
9578
|
+
out.isTruncated = true;
|
|
9341
9579
|
}
|
|
9342
|
-
function
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
ctx.globalAlpha = originalGlobalAlpha;
|
|
9348
|
-
} else {
|
|
9349
|
-
ctx.fill();
|
|
9580
|
+
function estimateLength(text, contentWidth, fontMeasureInfo) {
|
|
9581
|
+
var width = 0;
|
|
9582
|
+
var i = 0;
|
|
9583
|
+
for (var len2 = text.length; i < len2 && width < contentWidth; i++) {
|
|
9584
|
+
width += measureCharWidth(fontMeasureInfo, text.charCodeAt(i));
|
|
9350
9585
|
}
|
|
9586
|
+
return i;
|
|
9351
9587
|
}
|
|
9352
|
-
function
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9588
|
+
function parsePlainText(rawText, style, defaultOuterWidth, defaultOuterHeight) {
|
|
9589
|
+
var text = formatText(rawText);
|
|
9590
|
+
var overflow = style.overflow;
|
|
9591
|
+
var padding = style.padding;
|
|
9592
|
+
var paddingH = padding ? padding[1] + padding[3] : 0;
|
|
9593
|
+
var paddingV = padding ? padding[0] + padding[2] : 0;
|
|
9594
|
+
var font = style.font;
|
|
9595
|
+
var truncate = overflow === "truncate";
|
|
9596
|
+
var calculatedLineHeight = getLineHeight(font);
|
|
9597
|
+
var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);
|
|
9598
|
+
var truncateLineOverflow = style.lineOverflow === "truncate";
|
|
9599
|
+
var isTruncated = false;
|
|
9600
|
+
var width = style.width;
|
|
9601
|
+
if (width == null && defaultOuterWidth != null) {
|
|
9602
|
+
width = defaultOuterWidth - paddingH;
|
|
9603
|
+
}
|
|
9604
|
+
var height = style.height;
|
|
9605
|
+
if (height == null && defaultOuterHeight != null) {
|
|
9606
|
+
height = defaultOuterHeight - paddingV;
|
|
9607
|
+
}
|
|
9608
|
+
var lines;
|
|
9609
|
+
if (width != null && (overflow === "break" || overflow === "breakAll")) {
|
|
9610
|
+
lines = text ? wrapText(text, style.font, width, overflow === "breakAll", 0).lines : [];
|
|
9358
9611
|
} else {
|
|
9359
|
-
|
|
9612
|
+
lines = text ? text.split("\n") : [];
|
|
9360
9613
|
}
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9614
|
+
var contentHeight = lines.length * lineHeight;
|
|
9615
|
+
if (height == null) {
|
|
9616
|
+
height = contentHeight;
|
|
9617
|
+
}
|
|
9618
|
+
if (contentHeight > height && truncateLineOverflow) {
|
|
9619
|
+
var lineCount = Math.floor(height / lineHeight);
|
|
9620
|
+
isTruncated = isTruncated || lines.length > lineCount;
|
|
9621
|
+
lines = lines.slice(0, lineCount);
|
|
9622
|
+
contentHeight = lines.length * lineHeight;
|
|
9623
|
+
}
|
|
9624
|
+
if (text && truncate && width != null) {
|
|
9625
|
+
var options = prepareTruncateOptions(width, font, style.ellipsis, {
|
|
9626
|
+
minChar: style.truncateMinChar,
|
|
9627
|
+
placeholder: style.placeholder
|
|
9628
|
+
});
|
|
9629
|
+
var singleOut = {};
|
|
9630
|
+
for (var i = 0; i < lines.length; i++) {
|
|
9631
|
+
truncateSingleLine(singleOut, lines[i], options);
|
|
9632
|
+
lines[i] = singleOut.textLine;
|
|
9633
|
+
isTruncated = isTruncated || singleOut.isTruncated;
|
|
9372
9634
|
}
|
|
9373
|
-
return canvasPattern;
|
|
9374
9635
|
}
|
|
9636
|
+
var outerHeight = height;
|
|
9637
|
+
var contentWidth = 0;
|
|
9638
|
+
var fontMeasureInfo = ensureFontMeasureInfo(font);
|
|
9639
|
+
for (var i = 0; i < lines.length; i++) {
|
|
9640
|
+
contentWidth = Math.max(measureWidth(fontMeasureInfo, lines[i]), contentWidth);
|
|
9641
|
+
}
|
|
9642
|
+
if (width == null) {
|
|
9643
|
+
width = contentWidth;
|
|
9644
|
+
}
|
|
9645
|
+
var outerWidth = width;
|
|
9646
|
+
outerHeight += paddingV;
|
|
9647
|
+
outerWidth += paddingH;
|
|
9648
|
+
return {
|
|
9649
|
+
lines,
|
|
9650
|
+
height,
|
|
9651
|
+
outerWidth,
|
|
9652
|
+
outerHeight,
|
|
9653
|
+
lineHeight,
|
|
9654
|
+
calculatedLineHeight,
|
|
9655
|
+
contentWidth,
|
|
9656
|
+
contentHeight,
|
|
9657
|
+
width,
|
|
9658
|
+
isTruncated
|
|
9659
|
+
};
|
|
9375
9660
|
}
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
var hasStroke = styleHasStroke(style);
|
|
9379
|
-
var hasFill = styleHasFill(style);
|
|
9380
|
-
var strokePercent = style.strokePercent;
|
|
9381
|
-
var strokePart = strokePercent < 1;
|
|
9382
|
-
var firstDraw = !el.path;
|
|
9383
|
-
if ((!el.silent || strokePart) && firstDraw) {
|
|
9384
|
-
el.createPathProxy();
|
|
9661
|
+
var RichTextToken = function() {
|
|
9662
|
+
function RichTextToken2() {
|
|
9385
9663
|
}
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
var hasFillPattern = hasFill && !!fill.image;
|
|
9394
|
-
var hasStrokePattern = hasStroke && !!stroke.image;
|
|
9395
|
-
var fillGradient = void 0;
|
|
9396
|
-
var strokeGradient = void 0;
|
|
9397
|
-
var fillPattern = void 0;
|
|
9398
|
-
var strokePattern = void 0;
|
|
9399
|
-
var rect = void 0;
|
|
9400
|
-
if (hasFillGradient || hasStrokeGradient) {
|
|
9401
|
-
rect = el.getBoundingRect();
|
|
9402
|
-
}
|
|
9403
|
-
if (hasFillGradient) {
|
|
9404
|
-
fillGradient = dirtyFlag ? getCanvasGradient(ctx, fill, rect) : el.__canvasFillGradient;
|
|
9405
|
-
el.__canvasFillGradient = fillGradient;
|
|
9406
|
-
}
|
|
9407
|
-
if (hasStrokeGradient) {
|
|
9408
|
-
strokeGradient = dirtyFlag ? getCanvasGradient(ctx, stroke, rect) : el.__canvasStrokeGradient;
|
|
9409
|
-
el.__canvasStrokeGradient = strokeGradient;
|
|
9410
|
-
}
|
|
9411
|
-
if (hasFillPattern) {
|
|
9412
|
-
fillPattern = dirtyFlag || !el.__canvasFillPattern ? createCanvasPattern(ctx, fill, el) : el.__canvasFillPattern;
|
|
9413
|
-
el.__canvasFillPattern = fillPattern;
|
|
9414
|
-
}
|
|
9415
|
-
if (hasStrokePattern) {
|
|
9416
|
-
strokePattern = dirtyFlag || !el.__canvasStrokePattern ? createCanvasPattern(ctx, stroke, el) : el.__canvasStrokePattern;
|
|
9417
|
-
el.__canvasStrokePattern = fillPattern;
|
|
9418
|
-
}
|
|
9419
|
-
if (hasFillGradient) {
|
|
9420
|
-
ctx.fillStyle = fillGradient;
|
|
9421
|
-
} else if (hasFillPattern) {
|
|
9422
|
-
if (fillPattern) {
|
|
9423
|
-
ctx.fillStyle = fillPattern;
|
|
9424
|
-
} else {
|
|
9425
|
-
hasFill = false;
|
|
9426
|
-
}
|
|
9427
|
-
}
|
|
9428
|
-
if (hasStrokeGradient) {
|
|
9429
|
-
ctx.strokeStyle = strokeGradient;
|
|
9430
|
-
} else if (hasStrokePattern) {
|
|
9431
|
-
if (strokePattern) {
|
|
9432
|
-
ctx.strokeStyle = strokePattern;
|
|
9433
|
-
} else {
|
|
9434
|
-
hasStroke = false;
|
|
9435
|
-
}
|
|
9664
|
+
return RichTextToken2;
|
|
9665
|
+
}();
|
|
9666
|
+
var RichTextLine = function() {
|
|
9667
|
+
function RichTextLine2(tokens) {
|
|
9668
|
+
this.tokens = [];
|
|
9669
|
+
if (tokens) {
|
|
9670
|
+
this.tokens = tokens;
|
|
9436
9671
|
}
|
|
9437
9672
|
}
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9673
|
+
return RichTextLine2;
|
|
9674
|
+
}();
|
|
9675
|
+
var RichTextContentBlock = function() {
|
|
9676
|
+
function RichTextContentBlock2() {
|
|
9677
|
+
this.width = 0;
|
|
9678
|
+
this.height = 0;
|
|
9679
|
+
this.contentWidth = 0;
|
|
9680
|
+
this.contentHeight = 0;
|
|
9681
|
+
this.outerWidth = 0;
|
|
9682
|
+
this.outerHeight = 0;
|
|
9683
|
+
this.lines = [];
|
|
9684
|
+
this.isTruncated = false;
|
|
9444
9685
|
}
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
needsRebuild = false;
|
|
9453
|
-
}
|
|
9454
|
-
path.reset();
|
|
9455
|
-
el.buildPath(path, el.shape, inBatch);
|
|
9456
|
-
path.toStatic();
|
|
9457
|
-
el.pathUpdated();
|
|
9686
|
+
return RichTextContentBlock2;
|
|
9687
|
+
}();
|
|
9688
|
+
function parseRichText(rawText, style, defaultOuterWidth, defaultOuterHeight, topTextAlign) {
|
|
9689
|
+
var contentBlock = new RichTextContentBlock();
|
|
9690
|
+
var text = formatText(rawText);
|
|
9691
|
+
if (!text) {
|
|
9692
|
+
return contentBlock;
|
|
9458
9693
|
}
|
|
9459
|
-
|
|
9460
|
-
|
|
9694
|
+
var stlPadding = style.padding;
|
|
9695
|
+
var stlPaddingH = stlPadding ? stlPadding[1] + stlPadding[3] : 0;
|
|
9696
|
+
var stlPaddingV = stlPadding ? stlPadding[0] + stlPadding[2] : 0;
|
|
9697
|
+
var topWidth = style.width;
|
|
9698
|
+
if (topWidth == null && defaultOuterWidth != null) {
|
|
9699
|
+
topWidth = defaultOuterWidth - stlPaddingH;
|
|
9461
9700
|
}
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9701
|
+
var topHeight = style.height;
|
|
9702
|
+
if (topHeight == null && defaultOuterHeight != null) {
|
|
9703
|
+
topHeight = defaultOuterHeight - stlPaddingV;
|
|
9465
9704
|
}
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
} else {
|
|
9475
|
-
if (hasFill) {
|
|
9476
|
-
doFillPath(ctx, style);
|
|
9477
|
-
}
|
|
9478
|
-
if (hasStroke) {
|
|
9479
|
-
doStrokePath(ctx, style);
|
|
9480
|
-
}
|
|
9705
|
+
var overflow = style.overflow;
|
|
9706
|
+
var wrapInfo = (overflow === "break" || overflow === "breakAll") && topWidth != null ? { width: topWidth, accumWidth: 0, breakAll: overflow === "breakAll" } : null;
|
|
9707
|
+
var lastIndex = STYLE_REG.lastIndex = 0;
|
|
9708
|
+
var result;
|
|
9709
|
+
while ((result = STYLE_REG.exec(text)) != null) {
|
|
9710
|
+
var matchedIndex = result.index;
|
|
9711
|
+
if (matchedIndex > lastIndex) {
|
|
9712
|
+
pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);
|
|
9481
9713
|
}
|
|
9714
|
+
pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);
|
|
9715
|
+
lastIndex = STYLE_REG.lastIndex;
|
|
9482
9716
|
}
|
|
9483
|
-
if (
|
|
9484
|
-
|
|
9485
|
-
}
|
|
9486
|
-
}
|
|
9487
|
-
function brushImage(ctx, el, style) {
|
|
9488
|
-
var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);
|
|
9489
|
-
if (!image || !isImageReady(image)) {
|
|
9490
|
-
return;
|
|
9717
|
+
if (lastIndex < text.length) {
|
|
9718
|
+
pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);
|
|
9491
9719
|
}
|
|
9492
|
-
var
|
|
9493
|
-
var
|
|
9494
|
-
var
|
|
9495
|
-
var
|
|
9496
|
-
var
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
height = image.height;
|
|
9720
|
+
var pendingList = [];
|
|
9721
|
+
var calculatedHeight = 0;
|
|
9722
|
+
var calculatedWidth = 0;
|
|
9723
|
+
var truncate = overflow === "truncate";
|
|
9724
|
+
var truncateLine = style.lineOverflow === "truncate";
|
|
9725
|
+
var tmpTruncateOut = {};
|
|
9726
|
+
function finishLine(line2, lineWidth2, lineHeight2) {
|
|
9727
|
+
line2.width = lineWidth2;
|
|
9728
|
+
line2.lineHeight = lineHeight2;
|
|
9729
|
+
calculatedHeight += lineHeight2;
|
|
9730
|
+
calculatedWidth = Math.max(calculatedWidth, lineWidth2);
|
|
9504
9731
|
}
|
|
9505
|
-
|
|
9506
|
-
var
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9732
|
+
outer:
|
|
9733
|
+
for (var i = 0; i < contentBlock.lines.length; i++) {
|
|
9734
|
+
var line = contentBlock.lines[i];
|
|
9735
|
+
var lineHeight = 0;
|
|
9736
|
+
var lineWidth = 0;
|
|
9737
|
+
for (var j = 0; j < line.tokens.length; j++) {
|
|
9738
|
+
var token = line.tokens[j];
|
|
9739
|
+
var tokenStyle = token.styleName && style.rich[token.styleName] || {};
|
|
9740
|
+
var textPadding = token.textPadding = tokenStyle.padding;
|
|
9741
|
+
var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;
|
|
9742
|
+
var font = token.font = tokenStyle.font || style.font;
|
|
9743
|
+
token.contentHeight = getLineHeight(font);
|
|
9744
|
+
var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);
|
|
9745
|
+
token.innerHeight = tokenHeight;
|
|
9746
|
+
textPadding && (tokenHeight += textPadding[0] + textPadding[2]);
|
|
9747
|
+
token.height = tokenHeight;
|
|
9748
|
+
token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);
|
|
9749
|
+
token.align = tokenStyle && tokenStyle.align || topTextAlign;
|
|
9750
|
+
token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || "middle";
|
|
9751
|
+
if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {
|
|
9752
|
+
var originalLength = contentBlock.lines.length;
|
|
9753
|
+
if (j > 0) {
|
|
9754
|
+
line.tokens = line.tokens.slice(0, j);
|
|
9755
|
+
finishLine(line, lineWidth, lineHeight);
|
|
9756
|
+
contentBlock.lines = contentBlock.lines.slice(0, i + 1);
|
|
9757
|
+
} else {
|
|
9758
|
+
contentBlock.lines = contentBlock.lines.slice(0, i);
|
|
9759
|
+
}
|
|
9760
|
+
contentBlock.isTruncated = contentBlock.isTruncated || contentBlock.lines.length < originalLength;
|
|
9761
|
+
break outer;
|
|
9762
|
+
}
|
|
9763
|
+
var styleTokenWidth = tokenStyle.width;
|
|
9764
|
+
var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === "auto";
|
|
9765
|
+
if (typeof styleTokenWidth === "string" && styleTokenWidth.charAt(styleTokenWidth.length - 1) === "%") {
|
|
9766
|
+
token.percentWidth = styleTokenWidth;
|
|
9767
|
+
pendingList.push(token);
|
|
9768
|
+
token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);
|
|
9769
|
+
} else {
|
|
9770
|
+
if (tokenWidthNotSpecified) {
|
|
9771
|
+
var textBackgroundColor = tokenStyle.backgroundColor;
|
|
9772
|
+
var bgImg = textBackgroundColor && textBackgroundColor.image;
|
|
9773
|
+
if (bgImg) {
|
|
9774
|
+
bgImg = findExistImage(bgImg);
|
|
9775
|
+
if (isImageReady(bgImg)) {
|
|
9776
|
+
token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);
|
|
9777
|
+
}
|
|
9778
|
+
}
|
|
9779
|
+
}
|
|
9780
|
+
var remainTruncWidth = truncate && topWidth != null ? topWidth - lineWidth : null;
|
|
9781
|
+
if (remainTruncWidth != null && remainTruncWidth < token.width) {
|
|
9782
|
+
if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {
|
|
9783
|
+
token.text = "";
|
|
9784
|
+
token.width = token.contentWidth = 0;
|
|
9785
|
+
} else {
|
|
9786
|
+
truncateText2(tmpTruncateOut, token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });
|
|
9787
|
+
token.text = tmpTruncateOut.text;
|
|
9788
|
+
contentBlock.isTruncated = contentBlock.isTruncated || tmpTruncateOut.isTruncated;
|
|
9789
|
+
token.width = token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);
|
|
9790
|
+
}
|
|
9791
|
+
} else {
|
|
9792
|
+
token.contentWidth = measureWidth(ensureFontMeasureInfo(font), token.text);
|
|
9793
|
+
}
|
|
9794
|
+
}
|
|
9795
|
+
token.width += paddingH;
|
|
9796
|
+
lineWidth += token.width;
|
|
9797
|
+
tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));
|
|
9798
|
+
}
|
|
9799
|
+
finishLine(line, lineWidth, lineHeight);
|
|
9800
|
+
}
|
|
9801
|
+
contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);
|
|
9802
|
+
contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);
|
|
9803
|
+
contentBlock.contentHeight = calculatedHeight;
|
|
9804
|
+
contentBlock.contentWidth = calculatedWidth;
|
|
9805
|
+
contentBlock.outerWidth += stlPaddingH;
|
|
9806
|
+
contentBlock.outerHeight += stlPaddingV;
|
|
9807
|
+
for (var i = 0; i < pendingList.length; i++) {
|
|
9808
|
+
var token = pendingList[i];
|
|
9809
|
+
var percentWidth = token.percentWidth;
|
|
9810
|
+
token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;
|
|
9517
9811
|
}
|
|
9812
|
+
return contentBlock;
|
|
9518
9813
|
}
|
|
9519
|
-
function
|
|
9520
|
-
var
|
|
9521
|
-
var
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
var
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
if (styleHasStroke(style)) {
|
|
9538
|
-
ctx.strokeText(text, style.x, style.y);
|
|
9539
|
-
}
|
|
9540
|
-
if (styleHasFill(style)) {
|
|
9541
|
-
ctx.fillText(text, style.x, style.y);
|
|
9814
|
+
function pushTokens(block, str, style, wrapInfo, styleName) {
|
|
9815
|
+
var isEmptyStr = str === "";
|
|
9816
|
+
var tokenStyle = styleName && style.rich[styleName] || {};
|
|
9817
|
+
var lines = block.lines;
|
|
9818
|
+
var font = tokenStyle.font || style.font;
|
|
9819
|
+
var newLine = false;
|
|
9820
|
+
var strLines;
|
|
9821
|
+
var linesWidths;
|
|
9822
|
+
if (wrapInfo) {
|
|
9823
|
+
var tokenPadding = tokenStyle.padding;
|
|
9824
|
+
var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;
|
|
9825
|
+
if (tokenStyle.width != null && tokenStyle.width !== "auto") {
|
|
9826
|
+
var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;
|
|
9827
|
+
if (lines.length > 0) {
|
|
9828
|
+
if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {
|
|
9829
|
+
strLines = str.split("\n");
|
|
9830
|
+
newLine = true;
|
|
9831
|
+
}
|
|
9542
9832
|
}
|
|
9833
|
+
wrapInfo.accumWidth = outerWidth_1;
|
|
9543
9834
|
} else {
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
ctx.strokeText(text, style.x, style.y);
|
|
9549
|
-
}
|
|
9835
|
+
var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);
|
|
9836
|
+
wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;
|
|
9837
|
+
linesWidths = res.linesWidths;
|
|
9838
|
+
strLines = res.lines;
|
|
9550
9839
|
}
|
|
9551
|
-
|
|
9552
|
-
|
|
9840
|
+
}
|
|
9841
|
+
if (!strLines) {
|
|
9842
|
+
strLines = str.split("\n");
|
|
9843
|
+
}
|
|
9844
|
+
var fontMeasureInfo = ensureFontMeasureInfo(font);
|
|
9845
|
+
for (var i = 0; i < strLines.length; i++) {
|
|
9846
|
+
var text = strLines[i];
|
|
9847
|
+
var token = new RichTextToken();
|
|
9848
|
+
token.styleName = styleName;
|
|
9849
|
+
token.text = text;
|
|
9850
|
+
token.isLineHolder = !text && !isEmptyStr;
|
|
9851
|
+
if (typeof tokenStyle.width === "number") {
|
|
9852
|
+
token.width = tokenStyle.width;
|
|
9853
|
+
} else {
|
|
9854
|
+
token.width = linesWidths ? linesWidths[i] : measureWidth(fontMeasureInfo, text);
|
|
9855
|
+
}
|
|
9856
|
+
if (!i && !newLine) {
|
|
9857
|
+
var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;
|
|
9858
|
+
var tokensLen = tokens.length;
|
|
9859
|
+
tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : (text || !tokensLen || isEmptyStr) && tokens.push(token);
|
|
9860
|
+
} else {
|
|
9861
|
+
lines.push(new RichTextLine([token]));
|
|
9553
9862
|
}
|
|
9554
9863
|
}
|
|
9555
9864
|
}
|
|
9556
|
-
|
|
9557
|
-
var
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
];
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
if (
|
|
9567
|
-
return
|
|
9865
|
+
function isAlphabeticLetter(ch) {
|
|
9866
|
+
var code = ch.charCodeAt(0);
|
|
9867
|
+
return code >= 32 && code <= 591 || code >= 880 && code <= 4351 || code >= 4608 && code <= 5119 || code >= 7680 && code <= 8303;
|
|
9868
|
+
}
|
|
9869
|
+
var breakCharMap = reduce(",&?/;] ".split(""), function(obj, ch) {
|
|
9870
|
+
obj[ch] = true;
|
|
9871
|
+
return obj;
|
|
9872
|
+
}, {});
|
|
9873
|
+
function isWordBreakChar(ch) {
|
|
9874
|
+
if (isAlphabeticLetter(ch)) {
|
|
9875
|
+
if (breakCharMap[ch]) {
|
|
9876
|
+
return true;
|
|
9568
9877
|
}
|
|
9878
|
+
return false;
|
|
9569
9879
|
}
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9880
|
+
return true;
|
|
9881
|
+
}
|
|
9882
|
+
function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {
|
|
9883
|
+
var lines = [];
|
|
9884
|
+
var linesWidths = [];
|
|
9885
|
+
var line = "";
|
|
9886
|
+
var currentWord = "";
|
|
9887
|
+
var currentWordWidth = 0;
|
|
9888
|
+
var accumWidth = 0;
|
|
9889
|
+
var fontMeasureInfo = ensureFontMeasureInfo(font);
|
|
9890
|
+
for (var i = 0; i < text.length; i++) {
|
|
9891
|
+
var ch = text.charAt(i);
|
|
9892
|
+
if (ch === "\n") {
|
|
9893
|
+
if (currentWord) {
|
|
9894
|
+
line += currentWord;
|
|
9895
|
+
accumWidth += currentWordWidth;
|
|
9896
|
+
}
|
|
9897
|
+
lines.push(line);
|
|
9898
|
+
linesWidths.push(accumWidth);
|
|
9899
|
+
line = "";
|
|
9900
|
+
currentWord = "";
|
|
9901
|
+
currentWordWidth = 0;
|
|
9902
|
+
accumWidth = 0;
|
|
9903
|
+
continue;
|
|
9580
9904
|
}
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9905
|
+
var chWidth = measureCharWidth(fontMeasureInfo, ch.charCodeAt(0));
|
|
9906
|
+
var inWord = isBreakAll ? false : !isWordBreakChar(ch);
|
|
9907
|
+
if (!lines.length ? lastAccumWidth + accumWidth + chWidth > lineWidth : accumWidth + chWidth > lineWidth) {
|
|
9908
|
+
if (!accumWidth) {
|
|
9909
|
+
if (inWord) {
|
|
9910
|
+
lines.push(currentWord);
|
|
9911
|
+
linesWidths.push(currentWordWidth);
|
|
9912
|
+
currentWord = ch;
|
|
9913
|
+
currentWordWidth = chWidth;
|
|
9914
|
+
} else {
|
|
9915
|
+
lines.push(ch);
|
|
9916
|
+
linesWidths.push(chWidth);
|
|
9917
|
+
}
|
|
9918
|
+
} else if (line || currentWord) {
|
|
9919
|
+
if (inWord) {
|
|
9920
|
+
if (!line) {
|
|
9921
|
+
line = currentWord;
|
|
9922
|
+
currentWord = "";
|
|
9923
|
+
currentWordWidth = 0;
|
|
9924
|
+
accumWidth = currentWordWidth;
|
|
9925
|
+
}
|
|
9926
|
+
lines.push(line);
|
|
9927
|
+
linesWidths.push(accumWidth - currentWordWidth);
|
|
9928
|
+
currentWord += ch;
|
|
9929
|
+
currentWordWidth += chWidth;
|
|
9930
|
+
line = "";
|
|
9931
|
+
accumWidth = currentWordWidth;
|
|
9932
|
+
} else {
|
|
9933
|
+
if (currentWord) {
|
|
9934
|
+
line += currentWord;
|
|
9935
|
+
currentWord = "";
|
|
9936
|
+
currentWordWidth = 0;
|
|
9937
|
+
}
|
|
9938
|
+
lines.push(line);
|
|
9939
|
+
linesWidths.push(accumWidth);
|
|
9940
|
+
line = ch;
|
|
9941
|
+
accumWidth = chWidth;
|
|
9942
|
+
}
|
|
9589
9943
|
}
|
|
9590
|
-
|
|
9944
|
+
continue;
|
|
9591
9945
|
}
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9946
|
+
accumWidth += chWidth;
|
|
9947
|
+
if (inWord) {
|
|
9948
|
+
currentWord += ch;
|
|
9949
|
+
currentWordWidth += chWidth;
|
|
9950
|
+
} else {
|
|
9951
|
+
if (currentWord) {
|
|
9952
|
+
line += currentWord;
|
|
9953
|
+
currentWord = "";
|
|
9954
|
+
currentWordWidth = 0;
|
|
9955
|
+
}
|
|
9956
|
+
line += ch;
|
|
9597
9957
|
}
|
|
9598
|
-
ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;
|
|
9599
9958
|
}
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {
|
|
9603
|
-
var style = getStyle(el, scope.inHover);
|
|
9604
|
-
var prevStyle = forceSetAll ? null : prevEl && getStyle(prevEl, scope.inHover) || {};
|
|
9605
|
-
if (style === prevStyle) {
|
|
9606
|
-
return false;
|
|
9959
|
+
if (currentWord) {
|
|
9960
|
+
line += currentWord;
|
|
9607
9961
|
}
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
flushPathDrawn(ctx, scope);
|
|
9612
|
-
styleChanged = true;
|
|
9613
|
-
}
|
|
9614
|
-
isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);
|
|
9962
|
+
if (line) {
|
|
9963
|
+
lines.push(line);
|
|
9964
|
+
linesWidths.push(accumWidth);
|
|
9615
9965
|
}
|
|
9616
|
-
if (
|
|
9617
|
-
|
|
9618
|
-
flushPathDrawn(ctx, scope);
|
|
9619
|
-
styleChanged = true;
|
|
9620
|
-
}
|
|
9621
|
-
isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);
|
|
9966
|
+
if (lines.length === 1) {
|
|
9967
|
+
accumWidth += lastAccumWidth;
|
|
9622
9968
|
}
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9969
|
+
return {
|
|
9970
|
+
accumWidth,
|
|
9971
|
+
lines,
|
|
9972
|
+
linesWidths
|
|
9973
|
+
};
|
|
9974
|
+
}
|
|
9975
|
+
function calcInnerTextOverflowArea(out, overflowRect, baseX, baseY, textAlign, textVerticalAlign) {
|
|
9976
|
+
out.baseX = baseX;
|
|
9977
|
+
out.baseY = baseY;
|
|
9978
|
+
out.outerWidth = out.outerHeight = null;
|
|
9979
|
+
if (!overflowRect) {
|
|
9980
|
+
return;
|
|
9981
|
+
}
|
|
9982
|
+
var textWidth = overflowRect.width * 2;
|
|
9983
|
+
var textHeight = overflowRect.height * 2;
|
|
9984
|
+
BoundingRect_default.set(tmpCITCTextRect, adjustTextX(baseX, textWidth, textAlign), adjustTextY2(baseY, textHeight, textVerticalAlign), textWidth, textHeight);
|
|
9985
|
+
BoundingRect_default.intersect(overflowRect, tmpCITCTextRect, null, tmpCITCIntersectRectOpt);
|
|
9986
|
+
var outIntersectRect = tmpCITCIntersectRectOpt.outIntersectRect;
|
|
9987
|
+
out.outerWidth = outIntersectRect.width;
|
|
9988
|
+
out.outerHeight = outIntersectRect.height;
|
|
9989
|
+
out.baseX = adjustTextX(outIntersectRect.x, outIntersectRect.width, textAlign, true);
|
|
9990
|
+
out.baseY = adjustTextY2(outIntersectRect.y, outIntersectRect.height, textVerticalAlign, true);
|
|
9991
|
+
}
|
|
9992
|
+
var tmpCITCTextRect = new BoundingRect_default(0, 0, 0, 0);
|
|
9993
|
+
var tmpCITCIntersectRectOpt = { outIntersectRect: {}, clamp: true };
|
|
9994
|
+
function formatText(text) {
|
|
9995
|
+
return text != null ? text += "" : text = "";
|
|
9996
|
+
}
|
|
9997
|
+
function tSpanCreateBoundingRect(style) {
|
|
9998
|
+
var text = formatText(style.text);
|
|
9999
|
+
var font = style.font;
|
|
10000
|
+
var contentWidth = measureWidth(ensureFontMeasureInfo(font), text);
|
|
10001
|
+
var contentHeight = getLineHeight(font);
|
|
10002
|
+
return tSpanCreateBoundingRect2(style, contentWidth, contentHeight, null);
|
|
10003
|
+
}
|
|
10004
|
+
function tSpanCreateBoundingRect2(style, contentWidth, contentHeight, forceLineWidth) {
|
|
10005
|
+
var rect = new BoundingRect_default(adjustTextX(style.x || 0, contentWidth, style.textAlign), adjustTextY2(style.y || 0, contentHeight, style.textBaseline), contentWidth, contentHeight);
|
|
10006
|
+
var lineWidth = forceLineWidth != null ? forceLineWidth : tSpanHasStroke(style) ? style.lineWidth : 0;
|
|
10007
|
+
if (lineWidth > 0) {
|
|
10008
|
+
rect.x -= lineWidth / 2;
|
|
10009
|
+
rect.y -= lineWidth / 2;
|
|
10010
|
+
rect.width += lineWidth;
|
|
10011
|
+
rect.height += lineWidth;
|
|
10012
|
+
}
|
|
10013
|
+
return rect;
|
|
10014
|
+
}
|
|
10015
|
+
function tSpanHasStroke(style) {
|
|
10016
|
+
var stroke = style.stroke;
|
|
10017
|
+
return stroke != null && stroke !== "none" && style.lineWidth > 0;
|
|
10018
|
+
}
|
|
10019
|
+
|
|
10020
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/TSpan.js
|
|
10021
|
+
var DEFAULT_TSPAN_STYLE = defaults({
|
|
10022
|
+
strokeFirst: true,
|
|
10023
|
+
font: DEFAULT_FONT,
|
|
10024
|
+
x: 0,
|
|
10025
|
+
y: 0,
|
|
10026
|
+
textAlign: "left",
|
|
10027
|
+
textBaseline: "top",
|
|
10028
|
+
miterLimit: 2
|
|
10029
|
+
}, DEFAULT_PATH_STYLE);
|
|
10030
|
+
var TSpan = function(_super) {
|
|
10031
|
+
__extends(TSpan2, _super);
|
|
10032
|
+
function TSpan2() {
|
|
10033
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
9629
10034
|
}
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
10035
|
+
TSpan2.prototype.hasStroke = function() {
|
|
10036
|
+
return tSpanHasStroke(this.style);
|
|
10037
|
+
};
|
|
10038
|
+
TSpan2.prototype.hasFill = function() {
|
|
10039
|
+
var style = this.style;
|
|
10040
|
+
var fill = style.fill;
|
|
10041
|
+
return fill != null && fill !== "none";
|
|
10042
|
+
};
|
|
10043
|
+
TSpan2.prototype.createStyle = function(obj) {
|
|
10044
|
+
return createObject(DEFAULT_TSPAN_STYLE, obj);
|
|
10045
|
+
};
|
|
10046
|
+
TSpan2.prototype.setBoundingRect = function(rect) {
|
|
10047
|
+
this._rect = rect;
|
|
10048
|
+
};
|
|
10049
|
+
TSpan2.prototype.getBoundingRect = function() {
|
|
10050
|
+
if (!this._rect) {
|
|
10051
|
+
this._rect = tSpanCreateBoundingRect(this.style);
|
|
9639
10052
|
}
|
|
10053
|
+
return this._rect;
|
|
10054
|
+
};
|
|
10055
|
+
TSpan2.initDefaultProps = function() {
|
|
10056
|
+
var tspanProto = TSpan2.prototype;
|
|
10057
|
+
tspanProto.dirtyRectTolerance = 10;
|
|
10058
|
+
}();
|
|
10059
|
+
return TSpan2;
|
|
10060
|
+
}(Displayable_default);
|
|
10061
|
+
TSpan.prototype.type = "tspan";
|
|
10062
|
+
var TSpan_default = TSpan;
|
|
10063
|
+
|
|
10064
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/canvas/dashStyle.js
|
|
10065
|
+
function normalizeLineDash(lineType, lineWidth) {
|
|
10066
|
+
if (!lineType || lineType === "solid" || !(lineWidth > 0)) {
|
|
10067
|
+
return null;
|
|
9640
10068
|
}
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
10069
|
+
return lineType === "dashed" ? [4 * lineWidth, 2 * lineWidth] : lineType === "dotted" ? [lineWidth] : isNumber(lineType) ? [lineType] : isArray(lineType) ? lineType : null;
|
|
10070
|
+
}
|
|
10071
|
+
function getLineDash(el) {
|
|
10072
|
+
var style = el.style;
|
|
10073
|
+
var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);
|
|
10074
|
+
var lineDashOffset = style.lineDashOffset;
|
|
10075
|
+
if (lineDash) {
|
|
10076
|
+
var lineScale_1 = style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1;
|
|
10077
|
+
if (lineScale_1 && lineScale_1 !== 1) {
|
|
10078
|
+
lineDash = map(lineDash, function(rawVal) {
|
|
10079
|
+
return rawVal / lineScale_1;
|
|
10080
|
+
});
|
|
10081
|
+
lineDashOffset /= lineScale_1;
|
|
9650
10082
|
}
|
|
9651
10083
|
}
|
|
9652
|
-
return
|
|
10084
|
+
return [lineDash, lineDashOffset];
|
|
9653
10085
|
}
|
|
9654
|
-
|
|
9655
|
-
|
|
10086
|
+
|
|
10087
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/canvas/graphic.js
|
|
10088
|
+
var pathProxyForDraw = new PathProxy_default(true);
|
|
10089
|
+
function styleHasStroke(style) {
|
|
10090
|
+
var stroke = style.stroke;
|
|
10091
|
+
return !(stroke == null || stroke === "none" || !(style.lineWidth > 0));
|
|
9656
10092
|
}
|
|
9657
|
-
function
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
10093
|
+
function isValidStrokeFillStyle(strokeOrFill) {
|
|
10094
|
+
return typeof strokeOrFill === "string" && strokeOrFill !== "none";
|
|
10095
|
+
}
|
|
10096
|
+
function styleHasFill(style) {
|
|
10097
|
+
var fill = style.fill;
|
|
10098
|
+
return fill != null && fill !== "none";
|
|
10099
|
+
}
|
|
10100
|
+
function doFillPath(ctx, style) {
|
|
10101
|
+
if (style.fillOpacity != null && style.fillOpacity !== 1) {
|
|
10102
|
+
var originalGlobalAlpha = ctx.globalAlpha;
|
|
10103
|
+
ctx.globalAlpha = style.fillOpacity * style.opacity;
|
|
10104
|
+
ctx.fill();
|
|
10105
|
+
ctx.globalAlpha = originalGlobalAlpha;
|
|
9662
10106
|
} else {
|
|
9663
|
-
ctx.
|
|
10107
|
+
ctx.fill();
|
|
9664
10108
|
}
|
|
9665
10109
|
}
|
|
9666
|
-
function
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
ctx.clip();
|
|
10110
|
+
function doStrokePath(ctx, style) {
|
|
10111
|
+
if (style.strokeOpacity != null && style.strokeOpacity !== 1) {
|
|
10112
|
+
var originalGlobalAlpha = ctx.globalAlpha;
|
|
10113
|
+
ctx.globalAlpha = style.strokeOpacity * style.opacity;
|
|
10114
|
+
ctx.stroke();
|
|
10115
|
+
ctx.globalAlpha = originalGlobalAlpha;
|
|
10116
|
+
} else {
|
|
10117
|
+
ctx.stroke();
|
|
9675
10118
|
}
|
|
9676
|
-
scope.allClipped = allClipped;
|
|
9677
10119
|
}
|
|
9678
|
-
function
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
10120
|
+
function createCanvasPattern(ctx, pattern, el) {
|
|
10121
|
+
var image = createOrUpdateImage(pattern.image, pattern.__image, el);
|
|
10122
|
+
if (isImageReady(image)) {
|
|
10123
|
+
var canvasPattern = ctx.createPattern(image, pattern.repeat || "repeat");
|
|
10124
|
+
if (typeof DOMMatrix === "function" && canvasPattern && canvasPattern.setTransform) {
|
|
10125
|
+
var matrix = new DOMMatrix();
|
|
10126
|
+
matrix.translateSelf(pattern.x || 0, pattern.y || 0);
|
|
10127
|
+
matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);
|
|
10128
|
+
matrix.scaleSelf(pattern.scaleX || 1, pattern.scaleY || 1);
|
|
10129
|
+
canvasPattern.setTransform(matrix);
|
|
10130
|
+
}
|
|
10131
|
+
return canvasPattern;
|
|
9683
10132
|
}
|
|
9684
|
-
return true;
|
|
9685
10133
|
}
|
|
9686
|
-
|
|
9687
|
-
var
|
|
9688
|
-
var DRAW_TYPE_TEXT = 3;
|
|
9689
|
-
var DRAW_TYPE_INCREMENTAL = 4;
|
|
9690
|
-
function canPathBatch(style) {
|
|
9691
|
-
var hasFill = styleHasFill(style);
|
|
10134
|
+
function brushPath(ctx, el, style, canBatch, scope) {
|
|
10135
|
+
var _a;
|
|
9692
10136
|
var hasStroke = styleHasStroke(style);
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
scope.batchStroke = "";
|
|
9700
|
-
}
|
|
9701
|
-
function getStyle(el, inHover) {
|
|
9702
|
-
return inHover ? el.__hoverStyle || el.style : el.style;
|
|
9703
|
-
}
|
|
9704
|
-
function brushSingle(ctx, el) {
|
|
9705
|
-
brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);
|
|
9706
|
-
}
|
|
9707
|
-
function brush(ctx, el, scope, isLast) {
|
|
9708
|
-
var m = el.transform;
|
|
9709
|
-
if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
|
|
9710
|
-
el.__dirty &= ~REDRAW_BIT;
|
|
9711
|
-
el.__isRendered = false;
|
|
9712
|
-
return;
|
|
10137
|
+
var hasFill = styleHasFill(style);
|
|
10138
|
+
var strokePercent = style.strokePercent;
|
|
10139
|
+
var strokePart = strokePercent < 1;
|
|
10140
|
+
var firstDraw = !el.path;
|
|
10141
|
+
if ((!el.silent || strokePart) && firstDraw) {
|
|
10142
|
+
el.createPathProxy();
|
|
9713
10143
|
}
|
|
9714
|
-
var
|
|
9715
|
-
var
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
10144
|
+
var path = el.path || pathProxyForDraw;
|
|
10145
|
+
var dirtyFlag = el.__dirty;
|
|
10146
|
+
if (!canBatch) {
|
|
10147
|
+
var fill = style.fill;
|
|
10148
|
+
var stroke = style.stroke;
|
|
10149
|
+
var hasFillGradient = hasFill && !!fill.colorStops;
|
|
10150
|
+
var hasStrokeGradient = hasStroke && !!stroke.colorStops;
|
|
10151
|
+
var hasFillPattern = hasFill && !!fill.image;
|
|
10152
|
+
var hasStrokePattern = hasStroke && !!stroke.image;
|
|
10153
|
+
var fillGradient = void 0;
|
|
10154
|
+
var strokeGradient = void 0;
|
|
10155
|
+
var fillPattern = void 0;
|
|
10156
|
+
var strokePattern = void 0;
|
|
10157
|
+
var rect = void 0;
|
|
10158
|
+
if (hasFillGradient || hasStrokeGradient) {
|
|
10159
|
+
rect = el.getBoundingRect();
|
|
9726
10160
|
}
|
|
9727
|
-
if (
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
updateClipStatus(clipPaths, ctx, scope);
|
|
9731
|
-
forceSetTransform = true;
|
|
10161
|
+
if (hasFillGradient) {
|
|
10162
|
+
fillGradient = dirtyFlag ? getCanvasGradient(ctx, fill, rect) : el.__canvasFillGradient;
|
|
10163
|
+
el.__canvasFillGradient = fillGradient;
|
|
9732
10164
|
}
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
el.__isRendered = false;
|
|
9737
|
-
return;
|
|
9738
|
-
}
|
|
9739
|
-
el.beforeBrush && el.beforeBrush();
|
|
9740
|
-
el.innerBeforeBrush();
|
|
9741
|
-
var prevEl = scope.prevEl;
|
|
9742
|
-
if (!prevEl) {
|
|
9743
|
-
forceSetStyle = forceSetTransform = true;
|
|
9744
|
-
}
|
|
9745
|
-
var canBatchPath = el instanceof Path_default && el.autoBatch && canPathBatch(el.style);
|
|
9746
|
-
if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {
|
|
9747
|
-
flushPathDrawn(ctx, scope);
|
|
9748
|
-
setContextTransform(ctx, el);
|
|
9749
|
-
} else if (!canBatchPath) {
|
|
9750
|
-
flushPathDrawn(ctx, scope);
|
|
9751
|
-
}
|
|
9752
|
-
var style = getStyle(el, scope.inHover);
|
|
9753
|
-
if (el instanceof Path_default) {
|
|
9754
|
-
if (scope.lastDrawType !== DRAW_TYPE_PATH) {
|
|
9755
|
-
forceSetStyle = true;
|
|
9756
|
-
scope.lastDrawType = DRAW_TYPE_PATH;
|
|
10165
|
+
if (hasStrokeGradient) {
|
|
10166
|
+
strokeGradient = dirtyFlag ? getCanvasGradient(ctx, stroke, rect) : el.__canvasStrokeGradient;
|
|
10167
|
+
el.__canvasStrokeGradient = strokeGradient;
|
|
9757
10168
|
}
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
10169
|
+
if (hasFillPattern) {
|
|
10170
|
+
fillPattern = dirtyFlag || !el.__canvasFillPattern ? createCanvasPattern(ctx, fill, el) : el.__canvasFillPattern;
|
|
10171
|
+
el.__canvasFillPattern = fillPattern;
|
|
9761
10172
|
}
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
scope.batchStroke = style.stroke || "";
|
|
10173
|
+
if (hasStrokePattern) {
|
|
10174
|
+
strokePattern = dirtyFlag || !el.__canvasStrokePattern ? createCanvasPattern(ctx, stroke, el) : el.__canvasStrokePattern;
|
|
10175
|
+
el.__canvasStrokePattern = strokePattern;
|
|
9766
10176
|
}
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
}
|
|
9773
|
-
|
|
9774
|
-
brushText(ctx, el, style);
|
|
9775
|
-
} else if (el instanceof Image_default) {
|
|
9776
|
-
if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {
|
|
9777
|
-
forceSetStyle = true;
|
|
9778
|
-
scope.lastDrawType = DRAW_TYPE_IMAGE;
|
|
10177
|
+
if (hasFillGradient) {
|
|
10178
|
+
ctx.fillStyle = fillGradient;
|
|
10179
|
+
} else if (hasFillPattern) {
|
|
10180
|
+
if (fillPattern) {
|
|
10181
|
+
ctx.fillStyle = fillPattern;
|
|
10182
|
+
} else {
|
|
10183
|
+
hasFill = false;
|
|
9779
10184
|
}
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
10185
|
+
}
|
|
10186
|
+
if (hasStrokeGradient) {
|
|
10187
|
+
ctx.strokeStyle = strokeGradient;
|
|
10188
|
+
} else if (hasStrokePattern) {
|
|
10189
|
+
if (strokePattern) {
|
|
10190
|
+
ctx.strokeStyle = strokePattern;
|
|
10191
|
+
} else {
|
|
10192
|
+
hasStroke = false;
|
|
9786
10193
|
}
|
|
9787
|
-
brushIncremental(ctx, el, scope);
|
|
9788
10194
|
}
|
|
9789
10195
|
}
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
el.__dirty = 0;
|
|
9797
|
-
el.__isRendered = true;
|
|
9798
|
-
}
|
|
9799
|
-
function brushIncremental(ctx, el, scope) {
|
|
9800
|
-
var displayables = el.getDisplayables();
|
|
9801
|
-
var temporalDisplayables = el.getTemporalDisplayables();
|
|
9802
|
-
ctx.save();
|
|
9803
|
-
var innerScope = {
|
|
9804
|
-
prevElClipPaths: null,
|
|
9805
|
-
prevEl: null,
|
|
9806
|
-
allClipped: false,
|
|
9807
|
-
viewWidth: scope.viewWidth,
|
|
9808
|
-
viewHeight: scope.viewHeight,
|
|
9809
|
-
inHover: scope.inHover
|
|
9810
|
-
};
|
|
9811
|
-
var i;
|
|
9812
|
-
var len2;
|
|
9813
|
-
for (i = el.getCursor(), len2 = displayables.length; i < len2; i++) {
|
|
9814
|
-
var displayable = displayables[i];
|
|
9815
|
-
displayable.beforeBrush && displayable.beforeBrush();
|
|
9816
|
-
displayable.innerBeforeBrush();
|
|
9817
|
-
brush(ctx, displayable, innerScope, i === len2 - 1);
|
|
9818
|
-
displayable.innerAfterBrush();
|
|
9819
|
-
displayable.afterBrush && displayable.afterBrush();
|
|
9820
|
-
innerScope.prevEl = displayable;
|
|
10196
|
+
var scale3 = el.getGlobalScale();
|
|
10197
|
+
path.setScale(scale3[0], scale3[1], el.segmentIgnoreThreshold);
|
|
10198
|
+
var lineDash;
|
|
10199
|
+
var lineDashOffset;
|
|
10200
|
+
if (ctx.setLineDash && style.lineDash) {
|
|
10201
|
+
_a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];
|
|
9821
10202
|
}
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
10203
|
+
var needsRebuild = true;
|
|
10204
|
+
if (firstDraw || dirtyFlag & SHAPE_CHANGED_BIT) {
|
|
10205
|
+
path.setDPR(ctx.dpr);
|
|
10206
|
+
if (strokePart) {
|
|
10207
|
+
path.setContext(null);
|
|
10208
|
+
} else {
|
|
10209
|
+
path.setContext(ctx);
|
|
10210
|
+
needsRebuild = false;
|
|
10211
|
+
}
|
|
10212
|
+
path.reset();
|
|
10213
|
+
el.buildPath(path, el.shape, canBatch);
|
|
10214
|
+
path.toStatic();
|
|
10215
|
+
el.pathUpdated();
|
|
9830
10216
|
}
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
ctx.restore();
|
|
9834
|
-
}
|
|
9835
|
-
|
|
9836
|
-
// ../../node_modules/.pnpm/zrender@5.5.0/node_modules/zrender/lib/graphic/helper/parseText.js
|
|
9837
|
-
var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
|
|
9838
|
-
function truncateText(text, containerWidth, font, ellipsis, options) {
|
|
9839
|
-
if (!containerWidth) {
|
|
9840
|
-
return "";
|
|
10217
|
+
if (needsRebuild) {
|
|
10218
|
+
path.rebuildPath(ctx, strokePart ? strokePercent : 1);
|
|
9841
10219
|
}
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
textLines[i] = truncateSingleLine(textLines[i], options);
|
|
10220
|
+
if (lineDash) {
|
|
10221
|
+
ctx.setLineDash(lineDash);
|
|
10222
|
+
ctx.lineDashOffset = lineDashOffset;
|
|
9846
10223
|
}
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
10224
|
+
if (!canBatch) {
|
|
10225
|
+
if (style.strokeFirst) {
|
|
10226
|
+
if (hasStroke) {
|
|
10227
|
+
doStrokePath(ctx, style);
|
|
10228
|
+
}
|
|
10229
|
+
if (hasFill) {
|
|
10230
|
+
doFillPath(ctx, style);
|
|
10231
|
+
}
|
|
10232
|
+
} else {
|
|
10233
|
+
if (hasFill) {
|
|
10234
|
+
doFillPath(ctx, style);
|
|
10235
|
+
}
|
|
10236
|
+
if (hasStroke) {
|
|
10237
|
+
doStrokePath(ctx, style);
|
|
10238
|
+
}
|
|
10239
|
+
}
|
|
10240
|
+
} else {
|
|
10241
|
+
scope.batchFill = hasFill;
|
|
10242
|
+
scope.batchStroke = hasStroke;
|
|
9862
10243
|
}
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
ellipsis = "";
|
|
9866
|
-
ellipsisWidth = 0;
|
|
10244
|
+
if (lineDash) {
|
|
10245
|
+
ctx.setLineDash([]);
|
|
9867
10246
|
}
|
|
9868
|
-
contentWidth = containerWidth - ellipsisWidth;
|
|
9869
|
-
preparedOpts.ellipsis = ellipsis;
|
|
9870
|
-
preparedOpts.ellipsisWidth = ellipsisWidth;
|
|
9871
|
-
preparedOpts.contentWidth = contentWidth;
|
|
9872
|
-
preparedOpts.containerWidth = containerWidth;
|
|
9873
|
-
return preparedOpts;
|
|
9874
10247
|
}
|
|
9875
|
-
function
|
|
9876
|
-
var
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
if (!containerWidth) {
|
|
9880
|
-
return "";
|
|
9881
|
-
}
|
|
9882
|
-
var lineWidth = getWidth(textLine, font);
|
|
9883
|
-
if (lineWidth <= containerWidth) {
|
|
9884
|
-
return textLine;
|
|
9885
|
-
}
|
|
9886
|
-
for (var j = 0; ; j++) {
|
|
9887
|
-
if (lineWidth <= contentWidth || j >= options.maxIterations) {
|
|
9888
|
-
textLine += options.ellipsis;
|
|
9889
|
-
break;
|
|
9890
|
-
}
|
|
9891
|
-
var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0;
|
|
9892
|
-
textLine = textLine.substr(0, subLength);
|
|
9893
|
-
lineWidth = getWidth(textLine, font);
|
|
10248
|
+
function brushImage(ctx, el, style) {
|
|
10249
|
+
var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);
|
|
10250
|
+
if (!image || !isImageReady(image)) {
|
|
10251
|
+
return;
|
|
9894
10252
|
}
|
|
9895
|
-
|
|
9896
|
-
|
|
10253
|
+
var x = style.x || 0;
|
|
10254
|
+
var y = style.y || 0;
|
|
10255
|
+
var width = el.getWidth();
|
|
10256
|
+
var height = el.getHeight();
|
|
10257
|
+
var aspect = image.width / image.height;
|
|
10258
|
+
if (width == null && height != null) {
|
|
10259
|
+
width = height * aspect;
|
|
10260
|
+
} else if (height == null && width != null) {
|
|
10261
|
+
height = width / aspect;
|
|
10262
|
+
} else if (width == null && height == null) {
|
|
10263
|
+
width = image.width;
|
|
10264
|
+
height = image.height;
|
|
9897
10265
|
}
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
var
|
|
9905
|
-
|
|
10266
|
+
if (style.sWidth && style.sHeight) {
|
|
10267
|
+
var sx = style.sx || 0;
|
|
10268
|
+
var sy = style.sy || 0;
|
|
10269
|
+
ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
|
|
10270
|
+
} else if (style.sx && style.sy) {
|
|
10271
|
+
var sx = style.sx;
|
|
10272
|
+
var sy = style.sy;
|
|
10273
|
+
var sWidth = width - sx;
|
|
10274
|
+
var sHeight = height - sy;
|
|
10275
|
+
ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);
|
|
10276
|
+
} else {
|
|
10277
|
+
ctx.drawImage(image, x, y, width, height);
|
|
9906
10278
|
}
|
|
9907
|
-
return i;
|
|
9908
10279
|
}
|
|
9909
|
-
function
|
|
10280
|
+
function brushText(ctx, el, style) {
|
|
10281
|
+
var _a;
|
|
10282
|
+
var text = style.text;
|
|
9910
10283
|
text != null && (text += "");
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
10284
|
+
if (text) {
|
|
10285
|
+
ctx.font = style.font || DEFAULT_FONT;
|
|
10286
|
+
ctx.textAlign = style.textAlign;
|
|
10287
|
+
ctx.textBaseline = style.textBaseline;
|
|
10288
|
+
var lineDash = void 0;
|
|
10289
|
+
var lineDashOffset = void 0;
|
|
10290
|
+
if (ctx.setLineDash && style.lineDash) {
|
|
10291
|
+
_a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];
|
|
10292
|
+
}
|
|
10293
|
+
if (lineDash) {
|
|
10294
|
+
ctx.setLineDash(lineDash);
|
|
10295
|
+
ctx.lineDashOffset = lineDashOffset;
|
|
10296
|
+
}
|
|
10297
|
+
if (style.strokeFirst) {
|
|
10298
|
+
if (styleHasStroke(style)) {
|
|
10299
|
+
ctx.strokeText(text, style.x, style.y);
|
|
10300
|
+
}
|
|
10301
|
+
if (styleHasFill(style)) {
|
|
10302
|
+
ctx.fillText(text, style.x, style.y);
|
|
10303
|
+
}
|
|
10304
|
+
} else {
|
|
10305
|
+
if (styleHasFill(style)) {
|
|
10306
|
+
ctx.fillText(text, style.x, style.y);
|
|
10307
|
+
}
|
|
10308
|
+
if (styleHasStroke(style)) {
|
|
10309
|
+
ctx.strokeText(text, style.x, style.y);
|
|
10310
|
+
}
|
|
10311
|
+
}
|
|
10312
|
+
if (lineDash) {
|
|
10313
|
+
ctx.setLineDash([]);
|
|
9939
10314
|
}
|
|
9940
10315
|
}
|
|
9941
|
-
var outerHeight = height;
|
|
9942
|
-
var contentWidth = 0;
|
|
9943
|
-
for (var i = 0; i < lines.length; i++) {
|
|
9944
|
-
contentWidth = Math.max(getWidth(lines[i], font), contentWidth);
|
|
9945
|
-
}
|
|
9946
|
-
if (width == null) {
|
|
9947
|
-
width = contentWidth;
|
|
9948
|
-
}
|
|
9949
|
-
var outerWidth = contentWidth;
|
|
9950
|
-
if (padding) {
|
|
9951
|
-
outerHeight += padding[0] + padding[2];
|
|
9952
|
-
outerWidth += padding[1] + padding[3];
|
|
9953
|
-
width += padding[1] + padding[3];
|
|
9954
|
-
}
|
|
9955
|
-
if (bgColorDrawn) {
|
|
9956
|
-
outerWidth = width;
|
|
9957
|
-
}
|
|
9958
|
-
return {
|
|
9959
|
-
lines,
|
|
9960
|
-
height,
|
|
9961
|
-
outerWidth,
|
|
9962
|
-
outerHeight,
|
|
9963
|
-
lineHeight,
|
|
9964
|
-
calculatedLineHeight,
|
|
9965
|
-
contentWidth,
|
|
9966
|
-
contentHeight,
|
|
9967
|
-
width
|
|
9968
|
-
};
|
|
9969
10316
|
}
|
|
9970
|
-
var
|
|
9971
|
-
|
|
10317
|
+
var SHADOW_NUMBER_PROPS = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"];
|
|
10318
|
+
var STROKE_PROPS = [
|
|
10319
|
+
["lineCap", "butt"],
|
|
10320
|
+
["lineJoin", "miter"],
|
|
10321
|
+
["miterLimit", 10]
|
|
10322
|
+
];
|
|
10323
|
+
function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {
|
|
10324
|
+
var styleChanged = false;
|
|
10325
|
+
if (!forceSetAll) {
|
|
10326
|
+
prevStyle = prevStyle || {};
|
|
10327
|
+
if (style === prevStyle) {
|
|
10328
|
+
return false;
|
|
10329
|
+
}
|
|
10330
|
+
}
|
|
10331
|
+
if (forceSetAll || style.opacity !== prevStyle.opacity) {
|
|
10332
|
+
flushPathDrawn(ctx, scope);
|
|
10333
|
+
styleChanged = true;
|
|
10334
|
+
var opacity = Math.max(Math.min(style.opacity, 1), 0);
|
|
10335
|
+
ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;
|
|
9972
10336
|
}
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
this.tokens = [];
|
|
9978
|
-
if (tokens) {
|
|
9979
|
-
this.tokens = tokens;
|
|
10337
|
+
if (forceSetAll || style.blend !== prevStyle.blend) {
|
|
10338
|
+
if (!styleChanged) {
|
|
10339
|
+
flushPathDrawn(ctx, scope);
|
|
10340
|
+
styleChanged = true;
|
|
9980
10341
|
}
|
|
10342
|
+
ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;
|
|
9981
10343
|
}
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
this.outerHeight = 0;
|
|
9992
|
-
this.lines = [];
|
|
10344
|
+
for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {
|
|
10345
|
+
var propName = SHADOW_NUMBER_PROPS[i];
|
|
10346
|
+
if (forceSetAll || style[propName] !== prevStyle[propName]) {
|
|
10347
|
+
if (!styleChanged) {
|
|
10348
|
+
flushPathDrawn(ctx, scope);
|
|
10349
|
+
styleChanged = true;
|
|
10350
|
+
}
|
|
10351
|
+
ctx[propName] = ctx.dpr * (style[propName] || 0);
|
|
10352
|
+
}
|
|
9993
10353
|
}
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
return contentBlock;
|
|
10354
|
+
if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {
|
|
10355
|
+
if (!styleChanged) {
|
|
10356
|
+
flushPathDrawn(ctx, scope);
|
|
10357
|
+
styleChanged = true;
|
|
10358
|
+
}
|
|
10359
|
+
ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;
|
|
10001
10360
|
}
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
var
|
|
10006
|
-
var
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10361
|
+
return styleChanged;
|
|
10362
|
+
}
|
|
10363
|
+
function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {
|
|
10364
|
+
var style = el.style;
|
|
10365
|
+
var prevStyle = forceSetAll ? null : prevEl && prevEl.style || {};
|
|
10366
|
+
if (style === prevStyle) {
|
|
10367
|
+
return false;
|
|
10368
|
+
}
|
|
10369
|
+
var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);
|
|
10370
|
+
if (forceSetAll || style.fill !== prevStyle.fill) {
|
|
10371
|
+
if (!styleChanged) {
|
|
10372
|
+
flushPathDrawn(ctx, scope);
|
|
10373
|
+
styleChanged = true;
|
|
10012
10374
|
}
|
|
10013
|
-
|
|
10014
|
-
lastIndex = STYLE_REG.lastIndex;
|
|
10375
|
+
isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);
|
|
10015
10376
|
}
|
|
10016
|
-
if (
|
|
10017
|
-
|
|
10377
|
+
if (forceSetAll || style.stroke !== prevStyle.stroke) {
|
|
10378
|
+
if (!styleChanged) {
|
|
10379
|
+
flushPathDrawn(ctx, scope);
|
|
10380
|
+
styleChanged = true;
|
|
10381
|
+
}
|
|
10382
|
+
isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);
|
|
10018
10383
|
}
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
function finishLine(line2, lineWidth2, lineHeight2) {
|
|
10026
|
-
line2.width = lineWidth2;
|
|
10027
|
-
line2.lineHeight = lineHeight2;
|
|
10028
|
-
calculatedHeight += lineHeight2;
|
|
10029
|
-
calculatedWidth = Math.max(calculatedWidth, lineWidth2);
|
|
10384
|
+
if (forceSetAll || style.opacity !== prevStyle.opacity) {
|
|
10385
|
+
if (!styleChanged) {
|
|
10386
|
+
flushPathDrawn(ctx, scope);
|
|
10387
|
+
styleChanged = true;
|
|
10388
|
+
}
|
|
10389
|
+
ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;
|
|
10030
10390
|
}
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
var tokenStyle = token.styleName && style.rich[token.styleName] || {};
|
|
10039
|
-
var textPadding = token.textPadding = tokenStyle.padding;
|
|
10040
|
-
var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;
|
|
10041
|
-
var font = token.font = tokenStyle.font || style.font;
|
|
10042
|
-
token.contentHeight = getLineHeight(font);
|
|
10043
|
-
var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);
|
|
10044
|
-
token.innerHeight = tokenHeight;
|
|
10045
|
-
textPadding && (tokenHeight += textPadding[0] + textPadding[2]);
|
|
10046
|
-
token.height = tokenHeight;
|
|
10047
|
-
token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);
|
|
10048
|
-
token.align = tokenStyle && tokenStyle.align || style.align;
|
|
10049
|
-
token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || "middle";
|
|
10050
|
-
if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {
|
|
10051
|
-
if (j > 0) {
|
|
10052
|
-
line.tokens = line.tokens.slice(0, j);
|
|
10053
|
-
finishLine(line, lineWidth, lineHeight);
|
|
10054
|
-
contentBlock.lines = contentBlock.lines.slice(0, i + 1);
|
|
10055
|
-
} else {
|
|
10056
|
-
contentBlock.lines = contentBlock.lines.slice(0, i);
|
|
10057
|
-
}
|
|
10058
|
-
break outer;
|
|
10059
|
-
}
|
|
10060
|
-
var styleTokenWidth = tokenStyle.width;
|
|
10061
|
-
var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === "auto";
|
|
10062
|
-
if (typeof styleTokenWidth === "string" && styleTokenWidth.charAt(styleTokenWidth.length - 1) === "%") {
|
|
10063
|
-
token.percentWidth = styleTokenWidth;
|
|
10064
|
-
pendingList.push(token);
|
|
10065
|
-
token.contentWidth = getWidth(token.text, font);
|
|
10066
|
-
} else {
|
|
10067
|
-
if (tokenWidthNotSpecified) {
|
|
10068
|
-
var textBackgroundColor = tokenStyle.backgroundColor;
|
|
10069
|
-
var bgImg = textBackgroundColor && textBackgroundColor.image;
|
|
10070
|
-
if (bgImg) {
|
|
10071
|
-
bgImg = findExistImage(bgImg);
|
|
10072
|
-
if (isImageReady(bgImg)) {
|
|
10073
|
-
token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);
|
|
10074
|
-
}
|
|
10075
|
-
}
|
|
10076
|
-
}
|
|
10077
|
-
var remainTruncWidth = truncate && topWidth != null ? topWidth - lineWidth : null;
|
|
10078
|
-
if (remainTruncWidth != null && remainTruncWidth < token.width) {
|
|
10079
|
-
if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {
|
|
10080
|
-
token.text = "";
|
|
10081
|
-
token.width = token.contentWidth = 0;
|
|
10082
|
-
} else {
|
|
10083
|
-
token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });
|
|
10084
|
-
token.width = token.contentWidth = getWidth(token.text, font);
|
|
10085
|
-
}
|
|
10086
|
-
} else {
|
|
10087
|
-
token.contentWidth = getWidth(token.text, font);
|
|
10088
|
-
}
|
|
10089
|
-
}
|
|
10090
|
-
token.width += paddingH;
|
|
10091
|
-
lineWidth += token.width;
|
|
10092
|
-
tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));
|
|
10391
|
+
if (el.hasStroke()) {
|
|
10392
|
+
var lineWidth = style.lineWidth;
|
|
10393
|
+
var newLineWidth = lineWidth / (style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1);
|
|
10394
|
+
if (ctx.lineWidth !== newLineWidth) {
|
|
10395
|
+
if (!styleChanged) {
|
|
10396
|
+
flushPathDrawn(ctx, scope);
|
|
10397
|
+
styleChanged = true;
|
|
10093
10398
|
}
|
|
10094
|
-
|
|
10399
|
+
ctx.lineWidth = newLineWidth;
|
|
10095
10400
|
}
|
|
10096
|
-
contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);
|
|
10097
|
-
contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);
|
|
10098
|
-
contentBlock.contentHeight = calculatedHeight;
|
|
10099
|
-
contentBlock.contentWidth = calculatedWidth;
|
|
10100
|
-
if (stlPadding) {
|
|
10101
|
-
contentBlock.outerWidth += stlPadding[1] + stlPadding[3];
|
|
10102
|
-
contentBlock.outerHeight += stlPadding[0] + stlPadding[2];
|
|
10103
|
-
}
|
|
10104
|
-
for (var i = 0; i < pendingList.length; i++) {
|
|
10105
|
-
var token = pendingList[i];
|
|
10106
|
-
var percentWidth = token.percentWidth;
|
|
10107
|
-
token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;
|
|
10108
10401
|
}
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
var newLine = false;
|
|
10117
|
-
var strLines;
|
|
10118
|
-
var linesWidths;
|
|
10119
|
-
if (wrapInfo) {
|
|
10120
|
-
var tokenPadding = tokenStyle.padding;
|
|
10121
|
-
var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;
|
|
10122
|
-
if (tokenStyle.width != null && tokenStyle.width !== "auto") {
|
|
10123
|
-
var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;
|
|
10124
|
-
if (lines.length > 0) {
|
|
10125
|
-
if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {
|
|
10126
|
-
strLines = str.split("\n");
|
|
10127
|
-
newLine = true;
|
|
10128
|
-
}
|
|
10402
|
+
for (var i = 0; i < STROKE_PROPS.length; i++) {
|
|
10403
|
+
var prop = STROKE_PROPS[i];
|
|
10404
|
+
var propName = prop[0];
|
|
10405
|
+
if (forceSetAll || style[propName] !== prevStyle[propName]) {
|
|
10406
|
+
if (!styleChanged) {
|
|
10407
|
+
flushPathDrawn(ctx, scope);
|
|
10408
|
+
styleChanged = true;
|
|
10129
10409
|
}
|
|
10130
|
-
|
|
10131
|
-
} else {
|
|
10132
|
-
var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);
|
|
10133
|
-
wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;
|
|
10134
|
-
linesWidths = res.linesWidths;
|
|
10135
|
-
strLines = res.lines;
|
|
10410
|
+
ctx[propName] = style[propName] || prop[1];
|
|
10136
10411
|
}
|
|
10412
|
+
}
|
|
10413
|
+
return styleChanged;
|
|
10414
|
+
}
|
|
10415
|
+
function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {
|
|
10416
|
+
return bindCommonProps(ctx, el.style, prevEl && prevEl.style, forceSetAll, scope);
|
|
10417
|
+
}
|
|
10418
|
+
function setContextTransform(ctx, el) {
|
|
10419
|
+
var m = el.transform;
|
|
10420
|
+
var dpr2 = ctx.dpr || 1;
|
|
10421
|
+
if (m) {
|
|
10422
|
+
ctx.setTransform(dpr2 * m[0], dpr2 * m[1], dpr2 * m[2], dpr2 * m[3], dpr2 * m[4], dpr2 * m[5]);
|
|
10137
10423
|
} else {
|
|
10138
|
-
|
|
10424
|
+
ctx.setTransform(dpr2, 0, 0, dpr2, 0, 0);
|
|
10139
10425
|
}
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10426
|
+
}
|
|
10427
|
+
function updateClipStatus(clipPaths, ctx, scope) {
|
|
10428
|
+
var allClipped = false;
|
|
10429
|
+
for (var i = 0; i < clipPaths.length; i++) {
|
|
10430
|
+
var clipPath = clipPaths[i];
|
|
10431
|
+
allClipped = allClipped || clipPath.isZeroArea();
|
|
10432
|
+
setContextTransform(ctx, clipPath);
|
|
10433
|
+
ctx.beginPath();
|
|
10434
|
+
clipPath.buildPath(ctx, clipPath.shape);
|
|
10435
|
+
ctx.clip();
|
|
10436
|
+
}
|
|
10437
|
+
scope.allClipped = allClipped;
|
|
10438
|
+
}
|
|
10439
|
+
function isTransformChanged(m0, m1) {
|
|
10440
|
+
if (m0 && m1) {
|
|
10441
|
+
return m0[0] !== m1[0] || m0[1] !== m1[1] || m0[2] !== m1[2] || m0[3] !== m1[3] || m0[4] !== m1[4] || m0[5] !== m1[5];
|
|
10442
|
+
} else if (!m0 && !m1) {
|
|
10443
|
+
return false;
|
|
10444
|
+
}
|
|
10445
|
+
return true;
|
|
10446
|
+
}
|
|
10447
|
+
var DRAW_TYPE_PATH = 1;
|
|
10448
|
+
var DRAW_TYPE_IMAGE = 2;
|
|
10449
|
+
var DRAW_TYPE_TEXT = 3;
|
|
10450
|
+
var DRAW_TYPE_INCREMENTAL = 4;
|
|
10451
|
+
function canPathBatch(style) {
|
|
10452
|
+
var hasFill = styleHasFill(style);
|
|
10453
|
+
var hasStroke = styleHasStroke(style);
|
|
10454
|
+
return !(style.lineDash || !(+hasFill ^ +hasStroke) || hasFill && typeof style.fill !== "string" || hasStroke && typeof style.stroke !== "string" || style.strokePercent < 1 || style.strokeOpacity < 1 || style.fillOpacity < 1);
|
|
10455
|
+
}
|
|
10456
|
+
function flushPathDrawn(ctx, scope) {
|
|
10457
|
+
if (scope.batchFill) {
|
|
10458
|
+
scope.batchFill = false;
|
|
10459
|
+
ctx.fill();
|
|
10460
|
+
}
|
|
10461
|
+
if (scope.batchStroke) {
|
|
10462
|
+
scope.batchStroke = false;
|
|
10463
|
+
ctx.stroke();
|
|
10158
10464
|
}
|
|
10159
10465
|
}
|
|
10160
|
-
function
|
|
10161
|
-
var
|
|
10162
|
-
|
|
10466
|
+
function brushSingle(ctx, el) {
|
|
10467
|
+
var scope = { inHover: false, viewWidth: 0, viewHeight: 0, beforeBrushParam: {} };
|
|
10468
|
+
brush(ctx, el, scope);
|
|
10469
|
+
brushLoopFinalize(ctx, scope);
|
|
10163
10470
|
}
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10471
|
+
function brush(ctx, el, scope) {
|
|
10472
|
+
var m = el.transform;
|
|
10473
|
+
if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
|
|
10474
|
+
el.__dirty &= ~REDRAW_BIT;
|
|
10475
|
+
el.__isRendered = false;
|
|
10476
|
+
return;
|
|
10477
|
+
}
|
|
10478
|
+
var clipPaths = el.__clipPaths;
|
|
10479
|
+
var prevElClipPaths = scope.prevElClipPaths;
|
|
10480
|
+
var style = el.style;
|
|
10481
|
+
var forceSetTransform = false;
|
|
10482
|
+
var forceSetStyle = false;
|
|
10483
|
+
if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {
|
|
10484
|
+
if (prevElClipPaths) {
|
|
10485
|
+
flushPathDrawn(ctx, scope);
|
|
10486
|
+
ctx.restore();
|
|
10487
|
+
forceSetStyle = forceSetTransform = true;
|
|
10488
|
+
scope.prevElClipPaths = null;
|
|
10489
|
+
scope.allClipped = false;
|
|
10490
|
+
scope.prevEl = null;
|
|
10491
|
+
}
|
|
10492
|
+
if (clipPaths && clipPaths.length) {
|
|
10493
|
+
flushPathDrawn(ctx, scope);
|
|
10494
|
+
ctx.save();
|
|
10495
|
+
updateClipStatus(clipPaths, ctx, scope);
|
|
10496
|
+
forceSetTransform = true;
|
|
10497
|
+
scope.prevElClipPaths = clipPaths;
|
|
10172
10498
|
}
|
|
10173
|
-
return false;
|
|
10174
10499
|
}
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
var
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
continue;
|
|
10500
|
+
if (scope.allClipped) {
|
|
10501
|
+
el.__dirty &= ~REDRAW_BIT;
|
|
10502
|
+
el.__isRendered = false;
|
|
10503
|
+
return;
|
|
10504
|
+
}
|
|
10505
|
+
el.beforeBrush && el.beforeBrush(scope.beforeBrushParam);
|
|
10506
|
+
el.innerBeforeBrush();
|
|
10507
|
+
var prevEl = scope.prevEl;
|
|
10508
|
+
if (!prevEl) {
|
|
10509
|
+
forceSetStyle = forceSetTransform = true;
|
|
10510
|
+
}
|
|
10511
|
+
var canBatchPath = el instanceof Path_default && el.autoBatch && canPathBatch(style);
|
|
10512
|
+
if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {
|
|
10513
|
+
flushPathDrawn(ctx, scope);
|
|
10514
|
+
setContextTransform(ctx, el);
|
|
10515
|
+
} else if (!canBatchPath) {
|
|
10516
|
+
flushPathDrawn(ctx, scope);
|
|
10517
|
+
}
|
|
10518
|
+
if (el instanceof Path_default) {
|
|
10519
|
+
if (scope.lastDrawType !== DRAW_TYPE_PATH) {
|
|
10520
|
+
forceSetStyle = true;
|
|
10521
|
+
scope.lastDrawType = DRAW_TYPE_PATH;
|
|
10198
10522
|
}
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
if (!accumWidth) {
|
|
10203
|
-
if (inWord) {
|
|
10204
|
-
lines.push(currentWord);
|
|
10205
|
-
linesWidths.push(currentWordWidth);
|
|
10206
|
-
currentWord = ch;
|
|
10207
|
-
currentWordWidth = chWidth;
|
|
10208
|
-
} else {
|
|
10209
|
-
lines.push(ch);
|
|
10210
|
-
linesWidths.push(chWidth);
|
|
10211
|
-
}
|
|
10212
|
-
} else if (line || currentWord) {
|
|
10213
|
-
if (inWord) {
|
|
10214
|
-
if (!line) {
|
|
10215
|
-
line = currentWord;
|
|
10216
|
-
currentWord = "";
|
|
10217
|
-
currentWordWidth = 0;
|
|
10218
|
-
accumWidth = currentWordWidth;
|
|
10219
|
-
}
|
|
10220
|
-
lines.push(line);
|
|
10221
|
-
linesWidths.push(accumWidth - currentWordWidth);
|
|
10222
|
-
currentWord += ch;
|
|
10223
|
-
currentWordWidth += chWidth;
|
|
10224
|
-
line = "";
|
|
10225
|
-
accumWidth = currentWordWidth;
|
|
10226
|
-
} else {
|
|
10227
|
-
if (currentWord) {
|
|
10228
|
-
line += currentWord;
|
|
10229
|
-
currentWord = "";
|
|
10230
|
-
currentWordWidth = 0;
|
|
10231
|
-
}
|
|
10232
|
-
lines.push(line);
|
|
10233
|
-
linesWidths.push(accumWidth);
|
|
10234
|
-
line = ch;
|
|
10235
|
-
accumWidth = chWidth;
|
|
10236
|
-
}
|
|
10237
|
-
}
|
|
10238
|
-
continue;
|
|
10523
|
+
bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);
|
|
10524
|
+
if (!canBatchPath || !scope.batchFill && !scope.batchStroke) {
|
|
10525
|
+
ctx.beginPath();
|
|
10239
10526
|
}
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
line += currentWord;
|
|
10247
|
-
currentWord = "";
|
|
10248
|
-
currentWordWidth = 0;
|
|
10527
|
+
brushPath(ctx, el, style, canBatchPath, scope);
|
|
10528
|
+
} else {
|
|
10529
|
+
if (el instanceof TSpan_default) {
|
|
10530
|
+
if (scope.lastDrawType !== DRAW_TYPE_TEXT) {
|
|
10531
|
+
forceSetStyle = true;
|
|
10532
|
+
scope.lastDrawType = DRAW_TYPE_TEXT;
|
|
10249
10533
|
}
|
|
10250
|
-
|
|
10534
|
+
bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);
|
|
10535
|
+
brushText(ctx, el, style);
|
|
10536
|
+
} else if (el instanceof Image_default) {
|
|
10537
|
+
if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {
|
|
10538
|
+
forceSetStyle = true;
|
|
10539
|
+
scope.lastDrawType = DRAW_TYPE_IMAGE;
|
|
10540
|
+
}
|
|
10541
|
+
bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);
|
|
10542
|
+
brushImage(ctx, el, style);
|
|
10543
|
+
} else if (el.getTemporalDisplayables) {
|
|
10544
|
+
if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {
|
|
10545
|
+
forceSetStyle = true;
|
|
10546
|
+
scope.lastDrawType = DRAW_TYPE_INCREMENTAL;
|
|
10547
|
+
}
|
|
10548
|
+
brushIncremental(ctx, el, scope);
|
|
10251
10549
|
}
|
|
10252
10550
|
}
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10551
|
+
el.innerAfterBrush();
|
|
10552
|
+
if (el.afterBrush) {
|
|
10553
|
+
if (canBatchPath) {
|
|
10554
|
+
flushPathDrawn(ctx, scope);
|
|
10555
|
+
}
|
|
10556
|
+
el.afterBrush();
|
|
10257
10557
|
}
|
|
10258
|
-
|
|
10259
|
-
|
|
10558
|
+
scope.prevEl = el;
|
|
10559
|
+
el.__dirty = 0;
|
|
10560
|
+
el.__isRendered = true;
|
|
10561
|
+
}
|
|
10562
|
+
function brushLoopFinalize(ctx, scope) {
|
|
10563
|
+
flushPathDrawn(ctx, scope);
|
|
10564
|
+
if (scope.prevElClipPaths) {
|
|
10565
|
+
ctx.restore();
|
|
10260
10566
|
}
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10567
|
+
}
|
|
10568
|
+
function brushIncremental(ctx, el, scope) {
|
|
10569
|
+
var displayables = el.getDisplayables();
|
|
10570
|
+
var temporalDisplayables = el.getTemporalDisplayables();
|
|
10571
|
+
ctx.save();
|
|
10572
|
+
var innerScope = {
|
|
10573
|
+
prevElClipPaths: null,
|
|
10574
|
+
prevEl: null,
|
|
10575
|
+
allClipped: false,
|
|
10576
|
+
viewWidth: scope.viewWidth,
|
|
10577
|
+
viewHeight: scope.viewHeight,
|
|
10578
|
+
inHover: scope.inHover,
|
|
10579
|
+
beforeBrushParam: {}
|
|
10580
|
+
};
|
|
10581
|
+
var i;
|
|
10582
|
+
var len2;
|
|
10583
|
+
for (i = el.getCursor(), len2 = displayables.length; i < len2; i++) {
|
|
10584
|
+
var displayable = displayables[i];
|
|
10585
|
+
displayable.beforeBrush && displayable.beforeBrush(scope.beforeBrushParam);
|
|
10586
|
+
displayable.innerBeforeBrush();
|
|
10587
|
+
brush(ctx, displayable, innerScope);
|
|
10588
|
+
displayable.innerAfterBrush();
|
|
10589
|
+
displayable.afterBrush && displayable.afterBrush();
|
|
10590
|
+
innerScope.prevEl = displayable;
|
|
10264
10591
|
}
|
|
10265
|
-
|
|
10266
|
-
|
|
10592
|
+
brushLoopFinalize(ctx, innerScope);
|
|
10593
|
+
for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {
|
|
10594
|
+
var displayable = temporalDisplayables[i_1];
|
|
10595
|
+
displayable.beforeBrush && displayable.beforeBrush(scope.beforeBrushParam);
|
|
10596
|
+
displayable.innerBeforeBrush();
|
|
10597
|
+
brush(ctx, displayable, innerScope);
|
|
10598
|
+
displayable.innerAfterBrush();
|
|
10599
|
+
displayable.afterBrush && displayable.afterBrush();
|
|
10600
|
+
innerScope.prevEl = displayable;
|
|
10267
10601
|
}
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
};
|
|
10602
|
+
brushLoopFinalize(ctx, innerScope);
|
|
10603
|
+
el.clearTemporalDisplayables();
|
|
10604
|
+
el.notClear = true;
|
|
10605
|
+
ctx.restore();
|
|
10273
10606
|
}
|
|
10274
10607
|
|
|
10275
|
-
// ../../node_modules/.pnpm/zrender@
|
|
10608
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/helper/roundRect.js
|
|
10276
10609
|
function buildPath(ctx, shape) {
|
|
10277
10610
|
var x = shape.x;
|
|
10278
10611
|
var y = shape.y;
|
|
@@ -10342,9 +10675,10 @@ function buildPath(ctx, shape) {
|
|
|
10342
10675
|
r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);
|
|
10343
10676
|
ctx.lineTo(x, y + r1);
|
|
10344
10677
|
r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);
|
|
10678
|
+
ctx.closePath();
|
|
10345
10679
|
}
|
|
10346
10680
|
|
|
10347
|
-
// ../../node_modules/.pnpm/zrender@
|
|
10681
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/helper/subPixelOptimize.js
|
|
10348
10682
|
var round = Math.round;
|
|
10349
10683
|
function subPixelOptimizeLine(outputShape, inputShape, style) {
|
|
10350
10684
|
if (!inputShape) {
|
|
@@ -10400,7 +10734,7 @@ function subPixelOptimize(position, lineWidth, positiveOrNegative) {
|
|
|
10400
10734
|
return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
|
|
10401
10735
|
}
|
|
10402
10736
|
|
|
10403
|
-
// ../../node_modules/.pnpm/zrender@
|
|
10737
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/shape/Rect.js
|
|
10404
10738
|
var RectShape = function() {
|
|
10405
10739
|
function RectShape2() {
|
|
10406
10740
|
this.x = 0;
|
|
@@ -10452,11 +10786,12 @@ var Rect = function(_super) {
|
|
|
10452
10786
|
Rect.prototype.type = "rect";
|
|
10453
10787
|
var Rect_default = Rect;
|
|
10454
10788
|
|
|
10455
|
-
// ../../node_modules/.pnpm/zrender@
|
|
10789
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/Text.js
|
|
10456
10790
|
var DEFAULT_RICH_TEXT_COLOR = {
|
|
10457
10791
|
fill: "#000"
|
|
10458
10792
|
};
|
|
10459
10793
|
var DEFAULT_STROKE_LINE_WIDTH = 2;
|
|
10794
|
+
var tmpCITOverflowAreaOut = {};
|
|
10460
10795
|
var DEFAULT_TEXT_ANIMATION_PROPS = {
|
|
10461
10796
|
style: defaults({
|
|
10462
10797
|
fill: true,
|
|
@@ -10623,20 +10958,23 @@ var ZRText = function(_super) {
|
|
|
10623
10958
|
var style = this.style;
|
|
10624
10959
|
var textFont = style.font || DEFAULT_FONT;
|
|
10625
10960
|
var textPadding = style.padding;
|
|
10961
|
+
var defaultStyle = this._defaultStyle;
|
|
10962
|
+
var baseX = style.x || 0;
|
|
10963
|
+
var baseY = style.y || 0;
|
|
10964
|
+
var textAlign = style.align || defaultStyle.align || "left";
|
|
10965
|
+
var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || "top";
|
|
10966
|
+
calcInnerTextOverflowArea(tmpCITOverflowAreaOut, defaultStyle.overflowRect, baseX, baseY, textAlign, verticalAlign);
|
|
10967
|
+
baseX = tmpCITOverflowAreaOut.baseX;
|
|
10968
|
+
baseY = tmpCITOverflowAreaOut.baseY;
|
|
10626
10969
|
var text = getStyleText(style);
|
|
10627
|
-
var contentBlock = parsePlainText(text, style);
|
|
10970
|
+
var contentBlock = parsePlainText(text, style, tmpCITOverflowAreaOut.outerWidth, tmpCITOverflowAreaOut.outerHeight);
|
|
10628
10971
|
var needDrawBg = needDrawBackground(style);
|
|
10629
10972
|
var bgColorDrawn = !!style.backgroundColor;
|
|
10630
10973
|
var outerHeight = contentBlock.outerHeight;
|
|
10631
10974
|
var outerWidth = contentBlock.outerWidth;
|
|
10632
|
-
var contentWidth = contentBlock.contentWidth;
|
|
10633
10975
|
var textLines = contentBlock.lines;
|
|
10634
10976
|
var lineHeight = contentBlock.lineHeight;
|
|
10635
|
-
|
|
10636
|
-
var baseX = style.x || 0;
|
|
10637
|
-
var baseY = style.y || 0;
|
|
10638
|
-
var textAlign = style.align || defaultStyle.align || "left";
|
|
10639
|
-
var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || "top";
|
|
10977
|
+
this.isTruncated = !!contentBlock.isTruncated;
|
|
10640
10978
|
var textX = baseX;
|
|
10641
10979
|
var textY = adjustTextY2(baseY, contentBlock.contentHeight, verticalAlign);
|
|
10642
10980
|
if (needDrawBg || textPadding) {
|
|
@@ -10654,12 +10992,11 @@ var ZRText = function(_super) {
|
|
|
10654
10992
|
}
|
|
10655
10993
|
}
|
|
10656
10994
|
var defaultLineWidth = 0;
|
|
10995
|
+
var usingDefaultStroke = false;
|
|
10657
10996
|
var useDefaultFill = false;
|
|
10658
10997
|
var textFill = getFill("fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill));
|
|
10659
|
-
var textStroke = getStroke("stroke" in style ? style.stroke : !bgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null);
|
|
10998
|
+
var textStroke = getStroke("stroke" in style ? style.stroke : !bgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, usingDefaultStroke = true, defaultStyle.stroke) : null);
|
|
10660
10999
|
var hasShadow2 = style.textShadowBlur > 0;
|
|
10661
|
-
var fixedBoundingRect = style.width != null && (style.overflow === "truncate" || style.overflow === "break" || style.overflow === "breakAll");
|
|
10662
|
-
var calculatedLineHeight = contentBlock.calculatedLineHeight;
|
|
10663
11000
|
for (var i = 0; i < textLines.length; i++) {
|
|
10664
11001
|
var el = this._getOrCreateChild(TSpan_default);
|
|
10665
11002
|
var subElStyle = el.createStyle();
|
|
@@ -10689,24 +11026,26 @@ var ZRText = function(_super) {
|
|
|
10689
11026
|
subElStyle.font = textFont;
|
|
10690
11027
|
setSeparateFont(subElStyle, style);
|
|
10691
11028
|
textY += lineHeight;
|
|
10692
|
-
|
|
10693
|
-
el.setBoundingRect(new BoundingRect_default(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY2(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight));
|
|
10694
|
-
}
|
|
11029
|
+
el.setBoundingRect(tSpanCreateBoundingRect2(subElStyle, contentBlock.contentWidth, contentBlock.calculatedLineHeight, usingDefaultStroke ? 0 : null));
|
|
10695
11030
|
}
|
|
10696
11031
|
};
|
|
10697
11032
|
ZRText2.prototype._updateRichTexts = function() {
|
|
10698
11033
|
var style = this.style;
|
|
11034
|
+
var defaultStyle = this._defaultStyle;
|
|
11035
|
+
var textAlign = style.align || defaultStyle.align;
|
|
11036
|
+
var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;
|
|
11037
|
+
var baseX = style.x || 0;
|
|
11038
|
+
var baseY = style.y || 0;
|
|
11039
|
+
calcInnerTextOverflowArea(tmpCITOverflowAreaOut, defaultStyle.overflowRect, baseX, baseY, textAlign, verticalAlign);
|
|
11040
|
+
baseX = tmpCITOverflowAreaOut.baseX;
|
|
11041
|
+
baseY = tmpCITOverflowAreaOut.baseY;
|
|
10699
11042
|
var text = getStyleText(style);
|
|
10700
|
-
var contentBlock = parseRichText(text, style);
|
|
11043
|
+
var contentBlock = parseRichText(text, style, tmpCITOverflowAreaOut.outerWidth, tmpCITOverflowAreaOut.outerHeight, textAlign);
|
|
10701
11044
|
var contentWidth = contentBlock.width;
|
|
10702
11045
|
var outerWidth = contentBlock.outerWidth;
|
|
10703
11046
|
var outerHeight = contentBlock.outerHeight;
|
|
10704
11047
|
var textPadding = style.padding;
|
|
10705
|
-
|
|
10706
|
-
var baseY = style.y || 0;
|
|
10707
|
-
var defaultStyle = this._defaultStyle;
|
|
10708
|
-
var textAlign = style.align || defaultStyle.align;
|
|
10709
|
-
var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;
|
|
11048
|
+
this.isTruncated = !!contentBlock.isTruncated;
|
|
10710
11049
|
var boxX = adjustTextX(baseX, outerWidth, textAlign);
|
|
10711
11050
|
var boxY = adjustTextY2(baseY, outerHeight, verticalAlign);
|
|
10712
11051
|
var xLeft = boxX;
|
|
@@ -10777,8 +11116,9 @@ var ZRText = function(_super) {
|
|
|
10777
11116
|
var defaultStyle = this._defaultStyle;
|
|
10778
11117
|
var useDefaultFill = false;
|
|
10779
11118
|
var defaultLineWidth = 0;
|
|
11119
|
+
var usingDefaultStroke = false;
|
|
10780
11120
|
var textFill = getFill("fill" in tokenStyle ? tokenStyle.fill : "fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill));
|
|
10781
|
-
var textStroke = getStroke("stroke" in tokenStyle ? tokenStyle.stroke : "stroke" in style ? style.stroke : !bgColorDrawn && !parentBgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null);
|
|
11121
|
+
var textStroke = getStroke("stroke" in tokenStyle ? tokenStyle.stroke : "stroke" in style ? style.stroke : !bgColorDrawn && !parentBgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, usingDefaultStroke = true, defaultStyle.stroke) : null);
|
|
10782
11122
|
var hasShadow2 = tokenStyle.textShadowBlur > 0 || style.textShadowBlur > 0;
|
|
10783
11123
|
subElStyle.text = token.text;
|
|
10784
11124
|
subElStyle.x = x;
|
|
@@ -10803,9 +11143,7 @@ var ZRText = function(_super) {
|
|
|
10803
11143
|
if (textFill) {
|
|
10804
11144
|
subElStyle.fill = textFill;
|
|
10805
11145
|
}
|
|
10806
|
-
|
|
10807
|
-
var textHeight = token.contentHeight;
|
|
10808
|
-
el.setBoundingRect(new BoundingRect_default(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY2(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));
|
|
11146
|
+
el.setBoundingRect(tSpanCreateBoundingRect2(subElStyle, token.contentWidth, token.contentHeight, usingDefaultStroke ? 0 : null));
|
|
10809
11147
|
};
|
|
10810
11148
|
ZRText2.prototype._renderBackground = function(style, topStyle, x, y, width, height) {
|
|
10811
11149
|
var textBackgroundColor = style.backgroundColor;
|
|
@@ -10942,7 +11280,7 @@ function needDrawBackground(style) {
|
|
|
10942
11280
|
}
|
|
10943
11281
|
var Text_default = ZRText;
|
|
10944
11282
|
|
|
10945
|
-
// ../../node_modules/.pnpm/zrender@
|
|
11283
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/graphic/CompoundPath.js
|
|
10946
11284
|
var CompoundPath = function(_super) {
|
|
10947
11285
|
__extends(CompoundPath2, _super);
|
|
10948
11286
|
function CompoundPath2() {
|
|
@@ -10991,6 +11329,13 @@ var CompoundPath = function(_super) {
|
|
|
10991
11329
|
}(Path_default);
|
|
10992
11330
|
var CompoundPath_default = CompoundPath;
|
|
10993
11331
|
|
|
11332
|
+
// ../../node_modules/.pnpm/zrender@6.1.0/node_modules/zrender/lib/core/types.js
|
|
11333
|
+
var INCREMENTAL_ID_FALSE = 0;
|
|
11334
|
+
var INCREMENTAL_ID_TRUE_COMPAT = 1;
|
|
11335
|
+
var ZLEVEL2_NORMAL_ABOVE = 2;
|
|
11336
|
+
var ZLEVEL2_INCREMENTAL = 1;
|
|
11337
|
+
var ZLEVEL2_NORMAL_BELOW = 0;
|
|
11338
|
+
|
|
10994
11339
|
export {
|
|
10995
11340
|
__extends,
|
|
10996
11341
|
DEFAULT_FONT_FAMILY,
|
|
@@ -11041,6 +11386,9 @@ export {
|
|
|
11041
11386
|
hasOwn,
|
|
11042
11387
|
noop,
|
|
11043
11388
|
util_exports,
|
|
11389
|
+
env_default,
|
|
11390
|
+
LRU_default,
|
|
11391
|
+
createOrUpdateImage,
|
|
11044
11392
|
create,
|
|
11045
11393
|
identity,
|
|
11046
11394
|
copy,
|
|
@@ -11069,6 +11417,21 @@ export {
|
|
|
11069
11417
|
min,
|
|
11070
11418
|
max,
|
|
11071
11419
|
vector_exports,
|
|
11420
|
+
Point_default,
|
|
11421
|
+
boundingRectCreate,
|
|
11422
|
+
boundingRectCopy,
|
|
11423
|
+
boundingRectCalculateTransform,
|
|
11424
|
+
boundingRectApplyTransform,
|
|
11425
|
+
boundingRectContain,
|
|
11426
|
+
createIntersectContext,
|
|
11427
|
+
BoundingRect_default,
|
|
11428
|
+
getBoundingRect,
|
|
11429
|
+
getLineHeight,
|
|
11430
|
+
parsePercent,
|
|
11431
|
+
calculateTextPosition,
|
|
11432
|
+
truncateText,
|
|
11433
|
+
transformableGetLocalTransform,
|
|
11434
|
+
transformableCreate,
|
|
11072
11435
|
TRANSFORMABLE_PROPS,
|
|
11073
11436
|
copyTransform,
|
|
11074
11437
|
Transformable_default,
|
|
@@ -11082,7 +11445,7 @@ export {
|
|
|
11082
11445
|
quadraticSubdivide,
|
|
11083
11446
|
quadraticProjectPoint,
|
|
11084
11447
|
createCubicEasingFunc,
|
|
11085
|
-
|
|
11448
|
+
parseCssFloat,
|
|
11086
11449
|
parse,
|
|
11087
11450
|
lift,
|
|
11088
11451
|
fastLerp,
|
|
@@ -11092,7 +11455,6 @@ export {
|
|
|
11092
11455
|
stringify,
|
|
11093
11456
|
liftColor,
|
|
11094
11457
|
color_exports,
|
|
11095
|
-
env_default,
|
|
11096
11458
|
normalizeColor,
|
|
11097
11459
|
isAroundZero2 as isAroundZero,
|
|
11098
11460
|
round4,
|
|
@@ -11111,18 +11473,9 @@ export {
|
|
|
11111
11473
|
getSRTTransformString,
|
|
11112
11474
|
encodeBase64,
|
|
11113
11475
|
cloneValue,
|
|
11114
|
-
Point_default,
|
|
11115
|
-
BoundingRect_default,
|
|
11116
11476
|
Eventful_default,
|
|
11117
|
-
getBoundingRect,
|
|
11118
|
-
getLineHeight,
|
|
11119
|
-
parsePercent,
|
|
11120
|
-
calculateTextPosition,
|
|
11121
11477
|
devicePixelRatio,
|
|
11122
11478
|
REDRAW_BIT,
|
|
11123
|
-
Group_default,
|
|
11124
|
-
createOrUpdateImage,
|
|
11125
|
-
truncateText,
|
|
11126
11479
|
Displayable_default,
|
|
11127
11480
|
fromPoints,
|
|
11128
11481
|
normalizeArcAngles,
|
|
@@ -11142,8 +11495,15 @@ export {
|
|
|
11142
11495
|
parseFontSize,
|
|
11143
11496
|
hasSeparateFont,
|
|
11144
11497
|
Text_default,
|
|
11498
|
+
Group_default,
|
|
11145
11499
|
CompoundPath_default,
|
|
11500
|
+
INCREMENTAL_ID_FALSE,
|
|
11501
|
+
INCREMENTAL_ID_TRUE_COMPAT,
|
|
11502
|
+
ZLEVEL2_NORMAL_ABOVE,
|
|
11503
|
+
ZLEVEL2_INCREMENTAL,
|
|
11504
|
+
ZLEVEL2_NORMAL_BELOW,
|
|
11146
11505
|
transformLocalCoord,
|
|
11506
|
+
transformLocalCoordClear,
|
|
11147
11507
|
encodeHTML,
|
|
11148
11508
|
normalizeEvent,
|
|
11149
11509
|
addEventListener,
|
|
@@ -11161,7 +11521,8 @@ export {
|
|
|
11161
11521
|
getLineDash,
|
|
11162
11522
|
createCanvasPattern,
|
|
11163
11523
|
brushSingle,
|
|
11164
|
-
brush
|
|
11524
|
+
brush,
|
|
11525
|
+
brushLoopFinalize
|
|
11165
11526
|
};
|
|
11166
11527
|
/*! Bundled license information:
|
|
11167
11528
|
|
|
@@ -11189,7 +11550,7 @@ zrender/lib/zrender.js:
|
|
|
11189
11550
|
* All rights reserved.
|
|
11190
11551
|
*
|
|
11191
11552
|
* LICENSE
|
|
11192
|
-
* https://github.com/ecomfe/zrender/blob/master/LICENSE
|
|
11553
|
+
* https://github.com/ecomfe/zrender/blob/master/LICENSE
|
|
11193
11554
|
*)
|
|
11194
11555
|
*/
|
|
11195
|
-
//# sourceMappingURL=chunk-
|
|
11556
|
+
//# sourceMappingURL=chunk-DXNXWKU4.js.map
|