q2-tecton-elements 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere.cjs.entry.js +1 -1
- package/dist/cjs/{icons-e2bc9ee9.js → icons-afbdf88a.js} +1 -1
- package/dist/cjs/{index-eccd5617.js → index-3518c78c.js} +1 -1
- package/dist/cjs/{index-0128397d.js → index-734296a7.js} +476 -271
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +9 -6
- package/dist/cjs/q2-badge_2.cjs.entry.js +46 -7
- package/dist/cjs/q2-btn_2.cjs.entry.js +30 -5
- package/dist/cjs/q2-calendar.cjs.entry.js +102 -63
- package/dist/cjs/q2-card.cjs.entry.js +17 -6
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +7 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +196 -285
- package/dist/cjs/q2-chart-donut.cjs.entry.js +583 -504
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +9 -7
- package/dist/cjs/q2-checkbox.cjs.entry.js +17 -4
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +9 -3
- package/dist/cjs/q2-dropdown.cjs.entry.js +16 -5
- package/dist/cjs/q2-editable-field.cjs.entry.js +16 -6
- package/dist/cjs/q2-icon.cjs.entry.js +6 -4
- package/dist/cjs/q2-loading-element.cjs.entry.js +6 -2
- package/dist/cjs/q2-loc.cjs.entry.js +5 -3
- package/dist/cjs/q2-message.cjs.entry.js +4 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +9 -7
- package/dist/cjs/q2-optgroup.cjs.entry.js +6 -5
- package/dist/cjs/q2-option-list_2.cjs.entry.js +21 -7
- package/dist/cjs/q2-option.cjs.entry.js +12 -2
- package/dist/cjs/q2-pagination.cjs.entry.js +11 -3
- package/dist/cjs/q2-pill.cjs.entry.js +25 -7
- package/dist/cjs/q2-radio-group.cjs.entry.js +13 -6
- package/dist/cjs/q2-radio.cjs.entry.js +13 -8
- package/dist/cjs/q2-section.cjs.entry.js +44 -11
- package/dist/cjs/q2-select.cjs.entry.js +26 -17
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +8 -3
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +5 -4
- package/dist/cjs/q2-stepper.cjs.entry.js +9 -7
- package/dist/cjs/q2-tab-container.cjs.entry.js +14 -9
- package/dist/cjs/q2-tab-pane.cjs.entry.js +10 -2
- package/dist/cjs/q2-tag.cjs.entry.js +20 -7
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +20 -4
- package/dist/cjs/q2-tooltip.cjs.entry.js +9 -3
- package/dist/cjs/{shapes-c1a60d46.js → shapes-aad2b98f.js} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +17 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/click-elsewhere/index.js +18 -17
- package/dist/collection/components/q2-avatar/index.js +100 -92
- package/dist/collection/components/q2-avatar/styles.css +1 -1
- package/dist/collection/components/q2-badge/index.js +119 -111
- package/dist/collection/components/q2-badge/styles.css +1 -1
- package/dist/collection/components/q2-btn/index.js +349 -322
- package/dist/collection/components/q2-btn/styles.css +7 -7
- package/dist/collection/components/q2-calendar/index.js +578 -552
- package/dist/collection/components/q2-calendar/q2-month-picker.css +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +112 -116
- package/dist/collection/components/q2-calendar/styles.css +1 -1
- package/dist/collection/components/q2-card/index.js +262 -244
- package/dist/collection/components/q2-card/styles.css +9 -2
- package/dist/collection/components/q2-carousel/index.js +249 -253
- package/dist/collection/components/q2-carousel/styles.css +1 -1
- package/dist/collection/components/q2-carousel-pane/index.js +108 -96
- package/dist/collection/components/q2-carousel-pane/styles.css +5 -4
- package/dist/collection/components/q2-chart-donut/index.js +350 -334
- package/dist/collection/components/q2-chart-donut/styles.css +3 -3
- package/dist/collection/components/q2-checkbox/index.js +296 -287
- package/dist/collection/components/q2-checkbox/styles.css +2 -2
- package/dist/collection/components/q2-checkbox-group/index.js +156 -152
- package/dist/collection/components/q2-checkbox-group/styles.css +1 -1
- package/dist/collection/components/q2-dropdown/index.js +255 -240
- package/dist/collection/components/q2-dropdown/styles.css +1 -1
- package/dist/collection/components/q2-dropdown-item/index.js +134 -123
- package/dist/collection/components/q2-dropdown-item/styles.css +12 -10
- package/dist/collection/components/q2-editable-field/index.js +300 -293
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-icon/icons.js +358 -2158
- package/dist/collection/components/q2-icon/index.js +59 -49
- package/dist/collection/components/q2-icon/styles.css +1 -1
- package/dist/collection/components/q2-input/index.js +729 -705
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-loading/index.js +143 -132
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +85 -74
- package/dist/collection/components/q2-loading/skeleton/shapes.js +23 -36
- package/dist/collection/components/q2-loading/styles.css +1 -1
- package/dist/collection/components/q2-loc/index.js +49 -39
- package/dist/collection/components/q2-loc/styles.css +1 -1
- package/dist/collection/components/q2-message/index.js +101 -92
- package/dist/collection/components/q2-message/styles.css +1 -1
- package/dist/collection/components/q2-optgroup/index.js +64 -56
- package/dist/collection/components/q2-optgroup/styles.css +1 -1
- package/dist/collection/components/q2-option/index.js +244 -229
- package/dist/collection/components/q2-option/styles.css +5 -1
- package/dist/collection/components/q2-option-list/index.js +291 -270
- package/dist/collection/components/q2-option-list/styles.css +1 -1
- package/dist/collection/components/q2-pagination/index.js +183 -179
- package/dist/collection/components/q2-pagination/styles.css +1 -1
- package/dist/collection/components/q2-pill/index.js +260 -208
- package/dist/collection/components/q2-pill/styles.css +1 -1
- package/dist/collection/components/q2-popover/index.js +169 -151
- package/dist/collection/components/q2-popover/styles.css +2 -2
- package/dist/collection/components/q2-radio/index.js +233 -224
- package/dist/collection/components/q2-radio/styles.css +3 -3
- package/dist/collection/components/q2-radio-group/index.js +252 -244
- package/dist/collection/components/q2-radio-group/styles.css +1 -1
- package/dist/collection/components/q2-section/index.js +169 -131
- package/dist/collection/components/q2-section/styles.css +8 -6
- package/dist/collection/components/q2-select/index.js +393 -381
- package/dist/collection/components/q2-select/styles.css +1 -1
- package/dist/collection/components/q2-stepper/index.js +124 -126
- package/dist/collection/components/q2-stepper/styles.css +2 -1
- package/dist/collection/components/q2-stepper-pane/index.js +165 -149
- package/dist/collection/components/q2-stepper-pane/styles.css +1 -1
- package/dist/collection/components/q2-stepper-vertical/index.js +86 -85
- package/dist/collection/components/q2-stepper-vertical/styles.css +1 -1
- package/dist/collection/components/q2-tab-container/index.js +189 -184
- package/dist/collection/components/q2-tab-container/styles.css +1 -1
- package/dist/collection/components/q2-tab-pane/index.js +185 -166
- package/dist/collection/components/q2-tab-pane/styles.css +1 -1
- package/dist/collection/components/q2-tag/index.js +168 -116
- package/dist/collection/components/q2-tag/styles.css +1 -1
- package/dist/collection/components/q2-textarea/index.js +344 -327
- package/dist/collection/components/q2-textarea/styles.css +2 -2
- package/dist/collection/components/q2-tooltip/index.js +147 -133
- package/dist/collection/components/q2-tooltip/styles.css +1 -1
- package/dist/collection/components/tecton-tab-pane/index.js +287 -266
- package/dist/collection/components/tecton-tab-pane/styles.css +1 -1
- package/dist/collection/utils/index.js +2 -6
- package/dist/esm/click-elsewhere.entry.js +1 -1
- package/dist/esm/{icons-ed54e307.js → icons-78da5dd2.js} +1 -1
- package/dist/esm/{index-eac6b89e.js → index-9c591682.js} +1 -1
- package/dist/esm/{index-6d5ed7cc.js → index-bb1c8c7f.js} +476 -271
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +9 -6
- package/dist/esm/q2-badge_2.entry.js +46 -7
- package/dist/esm/q2-btn_2.entry.js +30 -5
- package/dist/esm/q2-calendar.entry.js +102 -63
- package/dist/esm/q2-card.entry.js +17 -6
- package/dist/esm/q2-carousel-pane.entry.js +7 -3
- package/dist/esm/q2-carousel.entry.js +196 -285
- package/dist/esm/q2-chart-donut.entry.js +583 -504
- package/dist/esm/q2-checkbox-group.entry.js +9 -7
- package/dist/esm/q2-checkbox.entry.js +17 -4
- package/dist/esm/q2-dropdown-item.entry.js +9 -3
- package/dist/esm/q2-dropdown.entry.js +16 -5
- package/dist/esm/q2-editable-field.entry.js +16 -6
- package/dist/esm/q2-icon.entry.js +6 -4
- package/dist/esm/q2-loading-element.entry.js +6 -2
- package/dist/esm/q2-loc.entry.js +5 -3
- package/dist/esm/q2-message.entry.js +4 -3
- package/dist/esm/q2-month-picker.entry.js +9 -7
- package/dist/esm/q2-optgroup.entry.js +6 -5
- package/dist/esm/q2-option-list_2.entry.js +21 -7
- package/dist/esm/q2-option.entry.js +12 -2
- package/dist/esm/q2-pagination.entry.js +11 -3
- package/dist/esm/q2-pill.entry.js +25 -7
- package/dist/esm/q2-radio-group.entry.js +13 -6
- package/dist/esm/q2-radio.entry.js +13 -8
- package/dist/esm/q2-section.entry.js +44 -11
- package/dist/esm/q2-select.entry.js +26 -17
- package/dist/esm/q2-stepper-pane.entry.js +8 -3
- package/dist/esm/q2-stepper-vertical.entry.js +5 -4
- package/dist/esm/q2-stepper.entry.js +9 -7
- package/dist/esm/q2-tab-container.entry.js +14 -9
- package/dist/esm/q2-tab-pane.entry.js +10 -2
- package/dist/esm/q2-tag.entry.js +20 -7
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +20 -4
- package/dist/esm/q2-tooltip.entry.js +9 -3
- package/dist/esm/{shapes-c32e3ba2.js → shapes-62b8a431.js} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +17 -2
- package/dist/loader/package.json +1 -0
- package/dist/q2-tecton-elements/p-0ba564b1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-73154834.js → p-13a639cf.js} +1 -1
- package/dist/q2-tecton-elements/p-16c11d74.entry.js +1 -0
- package/dist/q2-tecton-elements/p-17e0cbf1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2c9b1308.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2e832e42.entry.js +1 -0
- package/dist/q2-tecton-elements/p-315fdb74.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-c608e3c9.entry.js → p-444415b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4d700630.entry.js +1 -0
- package/dist/q2-tecton-elements/p-54e792bd.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-80014da0.js → p-5e374fbd.js} +1 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +39 -0
- package/dist/q2-tecton-elements/p-692f2d09.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6e6b5b80.entry.js +1 -0
- package/dist/q2-tecton-elements/p-74136b15.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7e8f43d1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8e380edf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-926a3e80.js +2 -0
- package/dist/q2-tecton-elements/{p-93c00587.js → p-92e1faf8.js} +1 -1
- package/dist/q2-tecton-elements/p-9772b15f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-97aa8423.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-17cffd7d.entry.js → p-a987402e.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aaf42539.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ac674c20.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b8b00394.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c444a60b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c6c489fe.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ce015552.entry.js +1 -0
- package/dist/q2-tecton-elements/p-d464fccc.entry.js +1 -0
- package/dist/q2-tecton-elements/p-de164483.entry.js +1 -0
- package/dist/q2-tecton-elements/p-df91e954.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e6d26f39.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e8e113c2.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f219fe9d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f800fd1e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fb37e67e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fc134a5d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fe88e979.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ffb48ccc.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +6 -0
- package/dist/types/components/q2-pill/index.d.ts +3 -0
- package/dist/types/components/q2-section/index.d.ts +3 -0
- package/dist/types/components/q2-tag/index.d.ts +3 -0
- package/dist/types/components.d.ts +154 -38
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/dist/types/workspace/workspace/{Tecton_tecton-production_master → tecton-production_release_1.19.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -0
- package/package.json +6 -6
- package/dist/q2-tecton-elements/p-02c1b7fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-04c743f2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-07dc509c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-12caa479.entry.js +0 -1
- package/dist/q2-tecton-elements/p-160dd1c2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1a3de749.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2061c3fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2a217895.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2b94ae62.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2e54f9a0.entry.js +0 -1
- package/dist/q2-tecton-elements/p-375569ff.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3766cc6c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3eda2714.entry.js +0 -1
- package/dist/q2-tecton-elements/p-421af42d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4c53713d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4fd405f5.entry.js +0 -1
- package/dist/q2-tecton-elements/p-509c8924.entry.js +0 -1
- package/dist/q2-tecton-elements/p-55dc3dc1.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5fffb28a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-612e9974.entry.js +0 -1
- package/dist/q2-tecton-elements/p-64ca8c59.entry.js +0 -1
- package/dist/q2-tecton-elements/p-796c2bb5.entry.js +0 -1
- package/dist/q2-tecton-elements/p-86887866.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9204c34d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9725d55f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a0fa416d.entry.js +0 -39
- package/dist/q2-tecton-elements/p-bd83e8e2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-be0f2539.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c05b0b55.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5691700.js +0 -1
- package/dist/q2-tecton-elements/p-d826d7ad.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d9e9340c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e5757895.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e68c9ef0.entry.js +0 -1
- package/dist/q2-tecton-elements/p-eb33bda4.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f319549d.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
2
|
-
import { o as overrideFocus, l as loc, i as isEventFromElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-bb1c8c7f.js';
|
|
2
|
+
import { o as overrideFocus, l as loc, i as isEventFromElement } from './index-9c591682.js';
|
|
3
3
|
|
|
4
4
|
/*! *****************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1128,6 +1128,21 @@ function preparePointerTransformer(markers, saved, inverse) {
|
|
|
1128
1128
|
function isCanvasEl(el) {
|
|
1129
1129
|
return el.nodeName.toUpperCase() === 'CANVAS';
|
|
1130
1130
|
}
|
|
1131
|
+
var replaceReg = /([&<>"'])/g;
|
|
1132
|
+
var replaceMap = {
|
|
1133
|
+
'&': '&',
|
|
1134
|
+
'<': '<',
|
|
1135
|
+
'>': '>',
|
|
1136
|
+
'"': '"',
|
|
1137
|
+
'\'': '''
|
|
1138
|
+
};
|
|
1139
|
+
function encodeHTML(source) {
|
|
1140
|
+
return source == null
|
|
1141
|
+
? ''
|
|
1142
|
+
: (source + '').replace(replaceReg, function (str, c) {
|
|
1143
|
+
return replaceMap[c];
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1131
1146
|
|
|
1132
1147
|
var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
|
|
1133
1148
|
var _calcOut = [];
|
|
@@ -1311,6 +1326,442 @@ var recognizers = {
|
|
|
1311
1326
|
}
|
|
1312
1327
|
};
|
|
1313
1328
|
|
|
1329
|
+
function create() {
|
|
1330
|
+
return [1, 0, 0, 1, 0, 0];
|
|
1331
|
+
}
|
|
1332
|
+
function identity(out) {
|
|
1333
|
+
out[0] = 1;
|
|
1334
|
+
out[1] = 0;
|
|
1335
|
+
out[2] = 0;
|
|
1336
|
+
out[3] = 1;
|
|
1337
|
+
out[4] = 0;
|
|
1338
|
+
out[5] = 0;
|
|
1339
|
+
return out;
|
|
1340
|
+
}
|
|
1341
|
+
function copy(out, m) {
|
|
1342
|
+
out[0] = m[0];
|
|
1343
|
+
out[1] = m[1];
|
|
1344
|
+
out[2] = m[2];
|
|
1345
|
+
out[3] = m[3];
|
|
1346
|
+
out[4] = m[4];
|
|
1347
|
+
out[5] = m[5];
|
|
1348
|
+
return out;
|
|
1349
|
+
}
|
|
1350
|
+
function mul(out, m1, m2) {
|
|
1351
|
+
var out0 = m1[0] * m2[0] + m1[2] * m2[1];
|
|
1352
|
+
var out1 = m1[1] * m2[0] + m1[3] * m2[1];
|
|
1353
|
+
var out2 = m1[0] * m2[2] + m1[2] * m2[3];
|
|
1354
|
+
var out3 = m1[1] * m2[2] + m1[3] * m2[3];
|
|
1355
|
+
var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
|
|
1356
|
+
var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
|
|
1357
|
+
out[0] = out0;
|
|
1358
|
+
out[1] = out1;
|
|
1359
|
+
out[2] = out2;
|
|
1360
|
+
out[3] = out3;
|
|
1361
|
+
out[4] = out4;
|
|
1362
|
+
out[5] = out5;
|
|
1363
|
+
return out;
|
|
1364
|
+
}
|
|
1365
|
+
function translate(out, a, v) {
|
|
1366
|
+
out[0] = a[0];
|
|
1367
|
+
out[1] = a[1];
|
|
1368
|
+
out[2] = a[2];
|
|
1369
|
+
out[3] = a[3];
|
|
1370
|
+
out[4] = a[4] + v[0];
|
|
1371
|
+
out[5] = a[5] + v[1];
|
|
1372
|
+
return out;
|
|
1373
|
+
}
|
|
1374
|
+
function rotate(out, a, rad) {
|
|
1375
|
+
var aa = a[0];
|
|
1376
|
+
var ac = a[2];
|
|
1377
|
+
var atx = a[4];
|
|
1378
|
+
var ab = a[1];
|
|
1379
|
+
var ad = a[3];
|
|
1380
|
+
var aty = a[5];
|
|
1381
|
+
var st = Math.sin(rad);
|
|
1382
|
+
var ct = Math.cos(rad);
|
|
1383
|
+
out[0] = aa * ct + ab * st;
|
|
1384
|
+
out[1] = -aa * st + ab * ct;
|
|
1385
|
+
out[2] = ac * ct + ad * st;
|
|
1386
|
+
out[3] = -ac * st + ct * ad;
|
|
1387
|
+
out[4] = ct * atx + st * aty;
|
|
1388
|
+
out[5] = ct * aty - st * atx;
|
|
1389
|
+
return out;
|
|
1390
|
+
}
|
|
1391
|
+
function scale(out, a, v) {
|
|
1392
|
+
var vx = v[0];
|
|
1393
|
+
var vy = v[1];
|
|
1394
|
+
out[0] = a[0] * vx;
|
|
1395
|
+
out[1] = a[1] * vy;
|
|
1396
|
+
out[2] = a[2] * vx;
|
|
1397
|
+
out[3] = a[3] * vy;
|
|
1398
|
+
out[4] = a[4] * vx;
|
|
1399
|
+
out[5] = a[5] * vy;
|
|
1400
|
+
return out;
|
|
1401
|
+
}
|
|
1402
|
+
function invert(out, a) {
|
|
1403
|
+
var aa = a[0];
|
|
1404
|
+
var ac = a[2];
|
|
1405
|
+
var atx = a[4];
|
|
1406
|
+
var ab = a[1];
|
|
1407
|
+
var ad = a[3];
|
|
1408
|
+
var aty = a[5];
|
|
1409
|
+
var det = aa * ad - ab * ac;
|
|
1410
|
+
if (!det) {
|
|
1411
|
+
return null;
|
|
1412
|
+
}
|
|
1413
|
+
det = 1.0 / det;
|
|
1414
|
+
out[0] = ad * det;
|
|
1415
|
+
out[1] = -ab * det;
|
|
1416
|
+
out[2] = -ac * det;
|
|
1417
|
+
out[3] = aa * det;
|
|
1418
|
+
out[4] = (ac * aty - ad * atx) * det;
|
|
1419
|
+
out[5] = (ab * atx - aa * aty) * det;
|
|
1420
|
+
return out;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
var Point = (function () {
|
|
1424
|
+
function Point(x, y) {
|
|
1425
|
+
this.x = x || 0;
|
|
1426
|
+
this.y = y || 0;
|
|
1427
|
+
}
|
|
1428
|
+
Point.prototype.copy = function (other) {
|
|
1429
|
+
this.x = other.x;
|
|
1430
|
+
this.y = other.y;
|
|
1431
|
+
return this;
|
|
1432
|
+
};
|
|
1433
|
+
Point.prototype.clone = function () {
|
|
1434
|
+
return new Point(this.x, this.y);
|
|
1435
|
+
};
|
|
1436
|
+
Point.prototype.set = function (x, y) {
|
|
1437
|
+
this.x = x;
|
|
1438
|
+
this.y = y;
|
|
1439
|
+
return this;
|
|
1440
|
+
};
|
|
1441
|
+
Point.prototype.equal = function (other) {
|
|
1442
|
+
return other.x === this.x && other.y === this.y;
|
|
1443
|
+
};
|
|
1444
|
+
Point.prototype.add = function (other) {
|
|
1445
|
+
this.x += other.x;
|
|
1446
|
+
this.y += other.y;
|
|
1447
|
+
return this;
|
|
1448
|
+
};
|
|
1449
|
+
Point.prototype.scale = function (scalar) {
|
|
1450
|
+
this.x *= scalar;
|
|
1451
|
+
this.y *= scalar;
|
|
1452
|
+
};
|
|
1453
|
+
Point.prototype.scaleAndAdd = function (other, scalar) {
|
|
1454
|
+
this.x += other.x * scalar;
|
|
1455
|
+
this.y += other.y * scalar;
|
|
1456
|
+
};
|
|
1457
|
+
Point.prototype.sub = function (other) {
|
|
1458
|
+
this.x -= other.x;
|
|
1459
|
+
this.y -= other.y;
|
|
1460
|
+
return this;
|
|
1461
|
+
};
|
|
1462
|
+
Point.prototype.dot = function (other) {
|
|
1463
|
+
return this.x * other.x + this.y * other.y;
|
|
1464
|
+
};
|
|
1465
|
+
Point.prototype.len = function () {
|
|
1466
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
1467
|
+
};
|
|
1468
|
+
Point.prototype.lenSquare = function () {
|
|
1469
|
+
return this.x * this.x + this.y * this.y;
|
|
1470
|
+
};
|
|
1471
|
+
Point.prototype.normalize = function () {
|
|
1472
|
+
var len = this.len();
|
|
1473
|
+
this.x /= len;
|
|
1474
|
+
this.y /= len;
|
|
1475
|
+
return this;
|
|
1476
|
+
};
|
|
1477
|
+
Point.prototype.distance = function (other) {
|
|
1478
|
+
var dx = this.x - other.x;
|
|
1479
|
+
var dy = this.y - other.y;
|
|
1480
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
1481
|
+
};
|
|
1482
|
+
Point.prototype.distanceSquare = function (other) {
|
|
1483
|
+
var dx = this.x - other.x;
|
|
1484
|
+
var dy = this.y - other.y;
|
|
1485
|
+
return dx * dx + dy * dy;
|
|
1486
|
+
};
|
|
1487
|
+
Point.prototype.negate = function () {
|
|
1488
|
+
this.x = -this.x;
|
|
1489
|
+
this.y = -this.y;
|
|
1490
|
+
return this;
|
|
1491
|
+
};
|
|
1492
|
+
Point.prototype.transform = function (m) {
|
|
1493
|
+
if (!m) {
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
var x = this.x;
|
|
1497
|
+
var y = this.y;
|
|
1498
|
+
this.x = m[0] * x + m[2] * y + m[4];
|
|
1499
|
+
this.y = m[1] * x + m[3] * y + m[5];
|
|
1500
|
+
return this;
|
|
1501
|
+
};
|
|
1502
|
+
Point.prototype.toArray = function (out) {
|
|
1503
|
+
out[0] = this.x;
|
|
1504
|
+
out[1] = this.y;
|
|
1505
|
+
return out;
|
|
1506
|
+
};
|
|
1507
|
+
Point.prototype.fromArray = function (input) {
|
|
1508
|
+
this.x = input[0];
|
|
1509
|
+
this.y = input[1];
|
|
1510
|
+
};
|
|
1511
|
+
Point.set = function (p, x, y) {
|
|
1512
|
+
p.x = x;
|
|
1513
|
+
p.y = y;
|
|
1514
|
+
};
|
|
1515
|
+
Point.copy = function (p, p2) {
|
|
1516
|
+
p.x = p2.x;
|
|
1517
|
+
p.y = p2.y;
|
|
1518
|
+
};
|
|
1519
|
+
Point.len = function (p) {
|
|
1520
|
+
return Math.sqrt(p.x * p.x + p.y * p.y);
|
|
1521
|
+
};
|
|
1522
|
+
Point.lenSquare = function (p) {
|
|
1523
|
+
return p.x * p.x + p.y * p.y;
|
|
1524
|
+
};
|
|
1525
|
+
Point.dot = function (p0, p1) {
|
|
1526
|
+
return p0.x * p1.x + p0.y * p1.y;
|
|
1527
|
+
};
|
|
1528
|
+
Point.add = function (out, p0, p1) {
|
|
1529
|
+
out.x = p0.x + p1.x;
|
|
1530
|
+
out.y = p0.y + p1.y;
|
|
1531
|
+
};
|
|
1532
|
+
Point.sub = function (out, p0, p1) {
|
|
1533
|
+
out.x = p0.x - p1.x;
|
|
1534
|
+
out.y = p0.y - p1.y;
|
|
1535
|
+
};
|
|
1536
|
+
Point.scale = function (out, p0, scalar) {
|
|
1537
|
+
out.x = p0.x * scalar;
|
|
1538
|
+
out.y = p0.y * scalar;
|
|
1539
|
+
};
|
|
1540
|
+
Point.scaleAndAdd = function (out, p0, p1, scalar) {
|
|
1541
|
+
out.x = p0.x + p1.x * scalar;
|
|
1542
|
+
out.y = p0.y + p1.y * scalar;
|
|
1543
|
+
};
|
|
1544
|
+
Point.lerp = function (out, p0, p1, t) {
|
|
1545
|
+
var onet = 1 - t;
|
|
1546
|
+
out.x = onet * p0.x + t * p1.x;
|
|
1547
|
+
out.y = onet * p0.y + t * p1.y;
|
|
1548
|
+
};
|
|
1549
|
+
return Point;
|
|
1550
|
+
}());
|
|
1551
|
+
|
|
1552
|
+
var mathMin$4 = Math.min;
|
|
1553
|
+
var mathMax$4 = Math.max;
|
|
1554
|
+
var lt = new Point();
|
|
1555
|
+
var rb = new Point();
|
|
1556
|
+
var lb = new Point();
|
|
1557
|
+
var rt = new Point();
|
|
1558
|
+
var minTv$1 = new Point();
|
|
1559
|
+
var maxTv$1 = new Point();
|
|
1560
|
+
var BoundingRect = (function () {
|
|
1561
|
+
function BoundingRect(x, y, width, height) {
|
|
1562
|
+
if (width < 0) {
|
|
1563
|
+
x = x + width;
|
|
1564
|
+
width = -width;
|
|
1565
|
+
}
|
|
1566
|
+
if (height < 0) {
|
|
1567
|
+
y = y + height;
|
|
1568
|
+
height = -height;
|
|
1569
|
+
}
|
|
1570
|
+
this.x = x;
|
|
1571
|
+
this.y = y;
|
|
1572
|
+
this.width = width;
|
|
1573
|
+
this.height = height;
|
|
1574
|
+
}
|
|
1575
|
+
BoundingRect.prototype.union = function (other) {
|
|
1576
|
+
var x = mathMin$4(other.x, this.x);
|
|
1577
|
+
var y = mathMin$4(other.y, this.y);
|
|
1578
|
+
if (isFinite(this.x) && isFinite(this.width)) {
|
|
1579
|
+
this.width = mathMax$4(other.x + other.width, this.x + this.width) - x;
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
this.width = other.width;
|
|
1583
|
+
}
|
|
1584
|
+
if (isFinite(this.y) && isFinite(this.height)) {
|
|
1585
|
+
this.height = mathMax$4(other.y + other.height, this.y + this.height) - y;
|
|
1586
|
+
}
|
|
1587
|
+
else {
|
|
1588
|
+
this.height = other.height;
|
|
1589
|
+
}
|
|
1590
|
+
this.x = x;
|
|
1591
|
+
this.y = y;
|
|
1592
|
+
};
|
|
1593
|
+
BoundingRect.prototype.applyTransform = function (m) {
|
|
1594
|
+
BoundingRect.applyTransform(this, this, m);
|
|
1595
|
+
};
|
|
1596
|
+
BoundingRect.prototype.calculateTransform = function (b) {
|
|
1597
|
+
var a = this;
|
|
1598
|
+
var sx = b.width / a.width;
|
|
1599
|
+
var sy = b.height / a.height;
|
|
1600
|
+
var m = create();
|
|
1601
|
+
translate(m, m, [-a.x, -a.y]);
|
|
1602
|
+
scale(m, m, [sx, sy]);
|
|
1603
|
+
translate(m, m, [b.x, b.y]);
|
|
1604
|
+
return m;
|
|
1605
|
+
};
|
|
1606
|
+
BoundingRect.prototype.intersect = function (b, mtv) {
|
|
1607
|
+
if (!b) {
|
|
1608
|
+
return false;
|
|
1609
|
+
}
|
|
1610
|
+
if (!(b instanceof BoundingRect)) {
|
|
1611
|
+
b = BoundingRect.create(b);
|
|
1612
|
+
}
|
|
1613
|
+
var a = this;
|
|
1614
|
+
var ax0 = a.x;
|
|
1615
|
+
var ax1 = a.x + a.width;
|
|
1616
|
+
var ay0 = a.y;
|
|
1617
|
+
var ay1 = a.y + a.height;
|
|
1618
|
+
var bx0 = b.x;
|
|
1619
|
+
var bx1 = b.x + b.width;
|
|
1620
|
+
var by0 = b.y;
|
|
1621
|
+
var by1 = b.y + b.height;
|
|
1622
|
+
var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
|
|
1623
|
+
if (mtv) {
|
|
1624
|
+
var dMin = Infinity;
|
|
1625
|
+
var dMax = 0;
|
|
1626
|
+
var d0 = Math.abs(ax1 - bx0);
|
|
1627
|
+
var d1 = Math.abs(bx1 - ax0);
|
|
1628
|
+
var d2 = Math.abs(ay1 - by0);
|
|
1629
|
+
var d3 = Math.abs(by1 - ay0);
|
|
1630
|
+
var dx = Math.min(d0, d1);
|
|
1631
|
+
var dy = Math.min(d2, d3);
|
|
1632
|
+
if (ax1 < bx0 || bx1 < ax0) {
|
|
1633
|
+
if (dx > dMax) {
|
|
1634
|
+
dMax = dx;
|
|
1635
|
+
if (d0 < d1) {
|
|
1636
|
+
Point.set(maxTv$1, -d0, 0);
|
|
1637
|
+
}
|
|
1638
|
+
else {
|
|
1639
|
+
Point.set(maxTv$1, d1, 0);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
else {
|
|
1644
|
+
if (dx < dMin) {
|
|
1645
|
+
dMin = dx;
|
|
1646
|
+
if (d0 < d1) {
|
|
1647
|
+
Point.set(minTv$1, d0, 0);
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
Point.set(minTv$1, -d1, 0);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
if (ay1 < by0 || by1 < ay0) {
|
|
1655
|
+
if (dy > dMax) {
|
|
1656
|
+
dMax = dy;
|
|
1657
|
+
if (d2 < d3) {
|
|
1658
|
+
Point.set(maxTv$1, 0, -d2);
|
|
1659
|
+
}
|
|
1660
|
+
else {
|
|
1661
|
+
Point.set(maxTv$1, 0, d3);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
else {
|
|
1666
|
+
if (dx < dMin) {
|
|
1667
|
+
dMin = dx;
|
|
1668
|
+
if (d2 < d3) {
|
|
1669
|
+
Point.set(minTv$1, 0, d2);
|
|
1670
|
+
}
|
|
1671
|
+
else {
|
|
1672
|
+
Point.set(minTv$1, 0, -d3);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
if (mtv) {
|
|
1678
|
+
Point.copy(mtv, overlap ? minTv$1 : maxTv$1);
|
|
1679
|
+
}
|
|
1680
|
+
return overlap;
|
|
1681
|
+
};
|
|
1682
|
+
BoundingRect.prototype.contain = function (x, y) {
|
|
1683
|
+
var rect = this;
|
|
1684
|
+
return x >= rect.x
|
|
1685
|
+
&& x <= (rect.x + rect.width)
|
|
1686
|
+
&& y >= rect.y
|
|
1687
|
+
&& y <= (rect.y + rect.height);
|
|
1688
|
+
};
|
|
1689
|
+
BoundingRect.prototype.clone = function () {
|
|
1690
|
+
return new BoundingRect(this.x, this.y, this.width, this.height);
|
|
1691
|
+
};
|
|
1692
|
+
BoundingRect.prototype.copy = function (other) {
|
|
1693
|
+
BoundingRect.copy(this, other);
|
|
1694
|
+
};
|
|
1695
|
+
BoundingRect.prototype.plain = function () {
|
|
1696
|
+
return {
|
|
1697
|
+
x: this.x,
|
|
1698
|
+
y: this.y,
|
|
1699
|
+
width: this.width,
|
|
1700
|
+
height: this.height
|
|
1701
|
+
};
|
|
1702
|
+
};
|
|
1703
|
+
BoundingRect.prototype.isFinite = function () {
|
|
1704
|
+
return isFinite(this.x)
|
|
1705
|
+
&& isFinite(this.y)
|
|
1706
|
+
&& isFinite(this.width)
|
|
1707
|
+
&& isFinite(this.height);
|
|
1708
|
+
};
|
|
1709
|
+
BoundingRect.prototype.isZero = function () {
|
|
1710
|
+
return this.width === 0 || this.height === 0;
|
|
1711
|
+
};
|
|
1712
|
+
BoundingRect.create = function (rect) {
|
|
1713
|
+
return new BoundingRect(rect.x, rect.y, rect.width, rect.height);
|
|
1714
|
+
};
|
|
1715
|
+
BoundingRect.copy = function (target, source) {
|
|
1716
|
+
target.x = source.x;
|
|
1717
|
+
target.y = source.y;
|
|
1718
|
+
target.width = source.width;
|
|
1719
|
+
target.height = source.height;
|
|
1720
|
+
};
|
|
1721
|
+
BoundingRect.applyTransform = function (target, source, m) {
|
|
1722
|
+
if (!m) {
|
|
1723
|
+
if (target !== source) {
|
|
1724
|
+
BoundingRect.copy(target, source);
|
|
1725
|
+
}
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {
|
|
1729
|
+
var sx = m[0];
|
|
1730
|
+
var sy = m[3];
|
|
1731
|
+
var tx = m[4];
|
|
1732
|
+
var ty = m[5];
|
|
1733
|
+
target.x = source.x * sx + tx;
|
|
1734
|
+
target.y = source.y * sy + ty;
|
|
1735
|
+
target.width = source.width * sx;
|
|
1736
|
+
target.height = source.height * sy;
|
|
1737
|
+
if (target.width < 0) {
|
|
1738
|
+
target.x += target.width;
|
|
1739
|
+
target.width = -target.width;
|
|
1740
|
+
}
|
|
1741
|
+
if (target.height < 0) {
|
|
1742
|
+
target.y += target.height;
|
|
1743
|
+
target.height = -target.height;
|
|
1744
|
+
}
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
lt.x = lb.x = source.x;
|
|
1748
|
+
lt.y = rt.y = source.y;
|
|
1749
|
+
rb.x = rt.x = source.x + source.width;
|
|
1750
|
+
rb.y = lb.y = source.y + source.height;
|
|
1751
|
+
lt.transform(m);
|
|
1752
|
+
rt.transform(m);
|
|
1753
|
+
rb.transform(m);
|
|
1754
|
+
lb.transform(m);
|
|
1755
|
+
target.x = mathMin$4(lt.x, rb.x, lb.x, rt.x);
|
|
1756
|
+
target.y = mathMin$4(lt.y, rb.y, lb.y, rt.y);
|
|
1757
|
+
var maxX = mathMax$4(lt.x, rb.x, lb.x, rt.x);
|
|
1758
|
+
var maxY = mathMax$4(lt.y, rb.y, lb.y, rt.y);
|
|
1759
|
+
target.width = maxX - target.x;
|
|
1760
|
+
target.height = maxY - target.y;
|
|
1761
|
+
};
|
|
1762
|
+
return BoundingRect;
|
|
1763
|
+
}());
|
|
1764
|
+
|
|
1314
1765
|
var SILENT = 'silent';
|
|
1315
1766
|
function makeEventPacket(eveType, targetInfo, event) {
|
|
1316
1767
|
return {
|
|
@@ -1356,14 +1807,16 @@ var handlerNames = [
|
|
|
1356
1807
|
'click', 'dblclick', 'mousewheel', 'mouseout',
|
|
1357
1808
|
'mouseup', 'mousedown', 'mousemove', 'contextmenu'
|
|
1358
1809
|
];
|
|
1810
|
+
var tmpRect$1 = new BoundingRect(0, 0, 0, 0);
|
|
1359
1811
|
var Handler = (function (_super) {
|
|
1360
1812
|
__extends(Handler, _super);
|
|
1361
|
-
function Handler(storage, painter, proxy, painterRoot) {
|
|
1813
|
+
function Handler(storage, painter, proxy, painterRoot, pointerSize) {
|
|
1362
1814
|
var _this = _super.call(this) || this;
|
|
1363
1815
|
_this._hovered = new HoveredResult(0, 0);
|
|
1364
1816
|
_this.storage = storage;
|
|
1365
1817
|
_this.painter = painter;
|
|
1366
1818
|
_this.painterRoot = painterRoot;
|
|
1819
|
+
_this._pointerSize = pointerSize;
|
|
1367
1820
|
proxy = proxy || new EmptyProxy();
|
|
1368
1821
|
_this.proxy = null;
|
|
1369
1822
|
_this.setHandlerProxy(proxy);
|
|
@@ -1464,15 +1917,40 @@ var Handler = (function (_super) {
|
|
|
1464
1917
|
Handler.prototype.findHover = function (x, y, exclude) {
|
|
1465
1918
|
var list = this.storage.getDisplayList();
|
|
1466
1919
|
var out = new HoveredResult(x, y);
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1920
|
+
setHoverTarget(list, out, x, y, exclude);
|
|
1921
|
+
if (this._pointerSize && !out.target) {
|
|
1922
|
+
var candidates = [];
|
|
1923
|
+
var pointerSize = this._pointerSize;
|
|
1924
|
+
var targetSizeHalf = pointerSize / 2;
|
|
1925
|
+
var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);
|
|
1926
|
+
for (var i = list.length - 1; i >= 0; i--) {
|
|
1927
|
+
var el = list[i];
|
|
1928
|
+
if (el !== exclude
|
|
1929
|
+
&& !el.ignore
|
|
1930
|
+
&& !el.ignoreCoarsePointer
|
|
1931
|
+
&& (!el.parent || !el.parent.ignoreCoarsePointer)) {
|
|
1932
|
+
tmpRect$1.copy(el.getBoundingRect());
|
|
1933
|
+
if (el.transform) {
|
|
1934
|
+
tmpRect$1.applyTransform(el.transform);
|
|
1935
|
+
}
|
|
1936
|
+
if (tmpRect$1.intersect(pointerRect)) {
|
|
1937
|
+
candidates.push(el);
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
if (candidates.length) {
|
|
1942
|
+
var rStep = 4;
|
|
1943
|
+
var thetaStep = Math.PI / 12;
|
|
1944
|
+
var PI2 = Math.PI * 2;
|
|
1945
|
+
for (var r = 0; r < targetSizeHalf; r += rStep) {
|
|
1946
|
+
for (var theta = 0; theta < PI2; theta += thetaStep) {
|
|
1947
|
+
var x1 = x + r * Math.cos(theta);
|
|
1948
|
+
var y1 = y + r * Math.sin(theta);
|
|
1949
|
+
setHoverTarget(candidates, out, x1, y1, exclude);
|
|
1950
|
+
if (out.target) {
|
|
1951
|
+
return out;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1476
1954
|
}
|
|
1477
1955
|
}
|
|
1478
1956
|
}
|
|
@@ -1551,6 +2029,21 @@ function isHover(displayable, x, y) {
|
|
|
1551
2029
|
}
|
|
1552
2030
|
return false;
|
|
1553
2031
|
}
|
|
2032
|
+
function setHoverTarget(list, out, x, y, exclude) {
|
|
2033
|
+
for (var i = list.length - 1; i >= 0; i--) {
|
|
2034
|
+
var el = list[i];
|
|
2035
|
+
var hoverCheckResult = void 0;
|
|
2036
|
+
if (el !== exclude
|
|
2037
|
+
&& !el.ignore
|
|
2038
|
+
&& (hoverCheckResult = isHover(el, x, y))) {
|
|
2039
|
+
!out.topTarget && (out.topTarget = el);
|
|
2040
|
+
if (hoverCheckResult !== SILENT) {
|
|
2041
|
+
out.target = el;
|
|
2042
|
+
break;
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
1554
2047
|
function isOutsideBoundary(handlerInstance, x, y) {
|
|
1555
2048
|
var painter = handlerInstance.painter;
|
|
1556
2049
|
return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();
|
|
@@ -3171,13 +3664,15 @@ function parse(colorStr, rgbaArr) {
|
|
|
3171
3664
|
}
|
|
3172
3665
|
alpha = parseCssFloat(params.pop());
|
|
3173
3666
|
case 'rgb':
|
|
3174
|
-
if (params.length
|
|
3667
|
+
if (params.length >= 3) {
|
|
3668
|
+
setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));
|
|
3669
|
+
putToCache(colorStr, rgbaArr);
|
|
3670
|
+
return rgbaArr;
|
|
3671
|
+
}
|
|
3672
|
+
else {
|
|
3175
3673
|
setRgba(rgbaArr, 0, 0, 0, 1);
|
|
3176
3674
|
return;
|
|
3177
3675
|
}
|
|
3178
|
-
setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);
|
|
3179
|
-
putToCache(colorStr, rgbaArr);
|
|
3180
|
-
return rgbaArr;
|
|
3181
3676
|
case 'hsla':
|
|
3182
3677
|
if (params.length !== 4) {
|
|
3183
3678
|
setRgba(rgbaArr, 0, 0, 0, 1);
|
|
@@ -4433,100 +4928,6 @@ var DARK_LABEL_COLOR = '#333';
|
|
|
4433
4928
|
var LIGHT_LABEL_COLOR = '#ccc';
|
|
4434
4929
|
var LIGHTER_LABEL_COLOR = '#eee';
|
|
4435
4930
|
|
|
4436
|
-
function create() {
|
|
4437
|
-
return [1, 0, 0, 1, 0, 0];
|
|
4438
|
-
}
|
|
4439
|
-
function identity(out) {
|
|
4440
|
-
out[0] = 1;
|
|
4441
|
-
out[1] = 0;
|
|
4442
|
-
out[2] = 0;
|
|
4443
|
-
out[3] = 1;
|
|
4444
|
-
out[4] = 0;
|
|
4445
|
-
out[5] = 0;
|
|
4446
|
-
return out;
|
|
4447
|
-
}
|
|
4448
|
-
function copy(out, m) {
|
|
4449
|
-
out[0] = m[0];
|
|
4450
|
-
out[1] = m[1];
|
|
4451
|
-
out[2] = m[2];
|
|
4452
|
-
out[3] = m[3];
|
|
4453
|
-
out[4] = m[4];
|
|
4454
|
-
out[5] = m[5];
|
|
4455
|
-
return out;
|
|
4456
|
-
}
|
|
4457
|
-
function mul(out, m1, m2) {
|
|
4458
|
-
var out0 = m1[0] * m2[0] + m1[2] * m2[1];
|
|
4459
|
-
var out1 = m1[1] * m2[0] + m1[3] * m2[1];
|
|
4460
|
-
var out2 = m1[0] * m2[2] + m1[2] * m2[3];
|
|
4461
|
-
var out3 = m1[1] * m2[2] + m1[3] * m2[3];
|
|
4462
|
-
var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
|
|
4463
|
-
var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
|
|
4464
|
-
out[0] = out0;
|
|
4465
|
-
out[1] = out1;
|
|
4466
|
-
out[2] = out2;
|
|
4467
|
-
out[3] = out3;
|
|
4468
|
-
out[4] = out4;
|
|
4469
|
-
out[5] = out5;
|
|
4470
|
-
return out;
|
|
4471
|
-
}
|
|
4472
|
-
function translate(out, a, v) {
|
|
4473
|
-
out[0] = a[0];
|
|
4474
|
-
out[1] = a[1];
|
|
4475
|
-
out[2] = a[2];
|
|
4476
|
-
out[3] = a[3];
|
|
4477
|
-
out[4] = a[4] + v[0];
|
|
4478
|
-
out[5] = a[5] + v[1];
|
|
4479
|
-
return out;
|
|
4480
|
-
}
|
|
4481
|
-
function rotate(out, a, rad) {
|
|
4482
|
-
var aa = a[0];
|
|
4483
|
-
var ac = a[2];
|
|
4484
|
-
var atx = a[4];
|
|
4485
|
-
var ab = a[1];
|
|
4486
|
-
var ad = a[3];
|
|
4487
|
-
var aty = a[5];
|
|
4488
|
-
var st = Math.sin(rad);
|
|
4489
|
-
var ct = Math.cos(rad);
|
|
4490
|
-
out[0] = aa * ct + ab * st;
|
|
4491
|
-
out[1] = -aa * st + ab * ct;
|
|
4492
|
-
out[2] = ac * ct + ad * st;
|
|
4493
|
-
out[3] = -ac * st + ct * ad;
|
|
4494
|
-
out[4] = ct * atx + st * aty;
|
|
4495
|
-
out[5] = ct * aty - st * atx;
|
|
4496
|
-
return out;
|
|
4497
|
-
}
|
|
4498
|
-
function scale(out, a, v) {
|
|
4499
|
-
var vx = v[0];
|
|
4500
|
-
var vy = v[1];
|
|
4501
|
-
out[0] = a[0] * vx;
|
|
4502
|
-
out[1] = a[1] * vy;
|
|
4503
|
-
out[2] = a[2] * vx;
|
|
4504
|
-
out[3] = a[3] * vy;
|
|
4505
|
-
out[4] = a[4] * vx;
|
|
4506
|
-
out[5] = a[5] * vy;
|
|
4507
|
-
return out;
|
|
4508
|
-
}
|
|
4509
|
-
function invert(out, a) {
|
|
4510
|
-
var aa = a[0];
|
|
4511
|
-
var ac = a[2];
|
|
4512
|
-
var atx = a[4];
|
|
4513
|
-
var ab = a[1];
|
|
4514
|
-
var ad = a[3];
|
|
4515
|
-
var aty = a[5];
|
|
4516
|
-
var det = aa * ad - ab * ac;
|
|
4517
|
-
if (!det) {
|
|
4518
|
-
return null;
|
|
4519
|
-
}
|
|
4520
|
-
det = 1.0 / det;
|
|
4521
|
-
out[0] = ad * det;
|
|
4522
|
-
out[1] = -ab * det;
|
|
4523
|
-
out[2] = -ac * det;
|
|
4524
|
-
out[3] = aa * det;
|
|
4525
|
-
out[4] = (ac * aty - ad * atx) * det;
|
|
4526
|
-
out[5] = (ab * atx - aa * aty) * det;
|
|
4527
|
-
return out;
|
|
4528
|
-
}
|
|
4529
|
-
|
|
4530
4931
|
var mIdentity = identity;
|
|
4531
4932
|
var EPSILON$1 = 5e-5;
|
|
4532
4933
|
function isNotAroundZero(val) {
|
|
@@ -4764,348 +5165,6 @@ function copyTransform(target, source) {
|
|
|
4764
5165
|
}
|
|
4765
5166
|
}
|
|
4766
5167
|
|
|
4767
|
-
var Point = (function () {
|
|
4768
|
-
function Point(x, y) {
|
|
4769
|
-
this.x = x || 0;
|
|
4770
|
-
this.y = y || 0;
|
|
4771
|
-
}
|
|
4772
|
-
Point.prototype.copy = function (other) {
|
|
4773
|
-
this.x = other.x;
|
|
4774
|
-
this.y = other.y;
|
|
4775
|
-
return this;
|
|
4776
|
-
};
|
|
4777
|
-
Point.prototype.clone = function () {
|
|
4778
|
-
return new Point(this.x, this.y);
|
|
4779
|
-
};
|
|
4780
|
-
Point.prototype.set = function (x, y) {
|
|
4781
|
-
this.x = x;
|
|
4782
|
-
this.y = y;
|
|
4783
|
-
return this;
|
|
4784
|
-
};
|
|
4785
|
-
Point.prototype.equal = function (other) {
|
|
4786
|
-
return other.x === this.x && other.y === this.y;
|
|
4787
|
-
};
|
|
4788
|
-
Point.prototype.add = function (other) {
|
|
4789
|
-
this.x += other.x;
|
|
4790
|
-
this.y += other.y;
|
|
4791
|
-
return this;
|
|
4792
|
-
};
|
|
4793
|
-
Point.prototype.scale = function (scalar) {
|
|
4794
|
-
this.x *= scalar;
|
|
4795
|
-
this.y *= scalar;
|
|
4796
|
-
};
|
|
4797
|
-
Point.prototype.scaleAndAdd = function (other, scalar) {
|
|
4798
|
-
this.x += other.x * scalar;
|
|
4799
|
-
this.y += other.y * scalar;
|
|
4800
|
-
};
|
|
4801
|
-
Point.prototype.sub = function (other) {
|
|
4802
|
-
this.x -= other.x;
|
|
4803
|
-
this.y -= other.y;
|
|
4804
|
-
return this;
|
|
4805
|
-
};
|
|
4806
|
-
Point.prototype.dot = function (other) {
|
|
4807
|
-
return this.x * other.x + this.y * other.y;
|
|
4808
|
-
};
|
|
4809
|
-
Point.prototype.len = function () {
|
|
4810
|
-
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
4811
|
-
};
|
|
4812
|
-
Point.prototype.lenSquare = function () {
|
|
4813
|
-
return this.x * this.x + this.y * this.y;
|
|
4814
|
-
};
|
|
4815
|
-
Point.prototype.normalize = function () {
|
|
4816
|
-
var len = this.len();
|
|
4817
|
-
this.x /= len;
|
|
4818
|
-
this.y /= len;
|
|
4819
|
-
return this;
|
|
4820
|
-
};
|
|
4821
|
-
Point.prototype.distance = function (other) {
|
|
4822
|
-
var dx = this.x - other.x;
|
|
4823
|
-
var dy = this.y - other.y;
|
|
4824
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
4825
|
-
};
|
|
4826
|
-
Point.prototype.distanceSquare = function (other) {
|
|
4827
|
-
var dx = this.x - other.x;
|
|
4828
|
-
var dy = this.y - other.y;
|
|
4829
|
-
return dx * dx + dy * dy;
|
|
4830
|
-
};
|
|
4831
|
-
Point.prototype.negate = function () {
|
|
4832
|
-
this.x = -this.x;
|
|
4833
|
-
this.y = -this.y;
|
|
4834
|
-
return this;
|
|
4835
|
-
};
|
|
4836
|
-
Point.prototype.transform = function (m) {
|
|
4837
|
-
if (!m) {
|
|
4838
|
-
return;
|
|
4839
|
-
}
|
|
4840
|
-
var x = this.x;
|
|
4841
|
-
var y = this.y;
|
|
4842
|
-
this.x = m[0] * x + m[2] * y + m[4];
|
|
4843
|
-
this.y = m[1] * x + m[3] * y + m[5];
|
|
4844
|
-
return this;
|
|
4845
|
-
};
|
|
4846
|
-
Point.prototype.toArray = function (out) {
|
|
4847
|
-
out[0] = this.x;
|
|
4848
|
-
out[1] = this.y;
|
|
4849
|
-
return out;
|
|
4850
|
-
};
|
|
4851
|
-
Point.prototype.fromArray = function (input) {
|
|
4852
|
-
this.x = input[0];
|
|
4853
|
-
this.y = input[1];
|
|
4854
|
-
};
|
|
4855
|
-
Point.set = function (p, x, y) {
|
|
4856
|
-
p.x = x;
|
|
4857
|
-
p.y = y;
|
|
4858
|
-
};
|
|
4859
|
-
Point.copy = function (p, p2) {
|
|
4860
|
-
p.x = p2.x;
|
|
4861
|
-
p.y = p2.y;
|
|
4862
|
-
};
|
|
4863
|
-
Point.len = function (p) {
|
|
4864
|
-
return Math.sqrt(p.x * p.x + p.y * p.y);
|
|
4865
|
-
};
|
|
4866
|
-
Point.lenSquare = function (p) {
|
|
4867
|
-
return p.x * p.x + p.y * p.y;
|
|
4868
|
-
};
|
|
4869
|
-
Point.dot = function (p0, p1) {
|
|
4870
|
-
return p0.x * p1.x + p0.y * p1.y;
|
|
4871
|
-
};
|
|
4872
|
-
Point.add = function (out, p0, p1) {
|
|
4873
|
-
out.x = p0.x + p1.x;
|
|
4874
|
-
out.y = p0.y + p1.y;
|
|
4875
|
-
};
|
|
4876
|
-
Point.sub = function (out, p0, p1) {
|
|
4877
|
-
out.x = p0.x - p1.x;
|
|
4878
|
-
out.y = p0.y - p1.y;
|
|
4879
|
-
};
|
|
4880
|
-
Point.scale = function (out, p0, scalar) {
|
|
4881
|
-
out.x = p0.x * scalar;
|
|
4882
|
-
out.y = p0.y * scalar;
|
|
4883
|
-
};
|
|
4884
|
-
Point.scaleAndAdd = function (out, p0, p1, scalar) {
|
|
4885
|
-
out.x = p0.x + p1.x * scalar;
|
|
4886
|
-
out.y = p0.y + p1.y * scalar;
|
|
4887
|
-
};
|
|
4888
|
-
Point.lerp = function (out, p0, p1, t) {
|
|
4889
|
-
var onet = 1 - t;
|
|
4890
|
-
out.x = onet * p0.x + t * p1.x;
|
|
4891
|
-
out.y = onet * p0.y + t * p1.y;
|
|
4892
|
-
};
|
|
4893
|
-
return Point;
|
|
4894
|
-
}());
|
|
4895
|
-
|
|
4896
|
-
var mathMin$4 = Math.min;
|
|
4897
|
-
var mathMax$4 = Math.max;
|
|
4898
|
-
var lt = new Point();
|
|
4899
|
-
var rb = new Point();
|
|
4900
|
-
var lb = new Point();
|
|
4901
|
-
var rt = new Point();
|
|
4902
|
-
var minTv$1 = new Point();
|
|
4903
|
-
var maxTv$1 = new Point();
|
|
4904
|
-
var BoundingRect = (function () {
|
|
4905
|
-
function BoundingRect(x, y, width, height) {
|
|
4906
|
-
if (width < 0) {
|
|
4907
|
-
x = x + width;
|
|
4908
|
-
width = -width;
|
|
4909
|
-
}
|
|
4910
|
-
if (height < 0) {
|
|
4911
|
-
y = y + height;
|
|
4912
|
-
height = -height;
|
|
4913
|
-
}
|
|
4914
|
-
this.x = x;
|
|
4915
|
-
this.y = y;
|
|
4916
|
-
this.width = width;
|
|
4917
|
-
this.height = height;
|
|
4918
|
-
}
|
|
4919
|
-
BoundingRect.prototype.union = function (other) {
|
|
4920
|
-
var x = mathMin$4(other.x, this.x);
|
|
4921
|
-
var y = mathMin$4(other.y, this.y);
|
|
4922
|
-
if (isFinite(this.x) && isFinite(this.width)) {
|
|
4923
|
-
this.width = mathMax$4(other.x + other.width, this.x + this.width) - x;
|
|
4924
|
-
}
|
|
4925
|
-
else {
|
|
4926
|
-
this.width = other.width;
|
|
4927
|
-
}
|
|
4928
|
-
if (isFinite(this.y) && isFinite(this.height)) {
|
|
4929
|
-
this.height = mathMax$4(other.y + other.height, this.y + this.height) - y;
|
|
4930
|
-
}
|
|
4931
|
-
else {
|
|
4932
|
-
this.height = other.height;
|
|
4933
|
-
}
|
|
4934
|
-
this.x = x;
|
|
4935
|
-
this.y = y;
|
|
4936
|
-
};
|
|
4937
|
-
BoundingRect.prototype.applyTransform = function (m) {
|
|
4938
|
-
BoundingRect.applyTransform(this, this, m);
|
|
4939
|
-
};
|
|
4940
|
-
BoundingRect.prototype.calculateTransform = function (b) {
|
|
4941
|
-
var a = this;
|
|
4942
|
-
var sx = b.width / a.width;
|
|
4943
|
-
var sy = b.height / a.height;
|
|
4944
|
-
var m = create();
|
|
4945
|
-
translate(m, m, [-a.x, -a.y]);
|
|
4946
|
-
scale(m, m, [sx, sy]);
|
|
4947
|
-
translate(m, m, [b.x, b.y]);
|
|
4948
|
-
return m;
|
|
4949
|
-
};
|
|
4950
|
-
BoundingRect.prototype.intersect = function (b, mtv) {
|
|
4951
|
-
if (!b) {
|
|
4952
|
-
return false;
|
|
4953
|
-
}
|
|
4954
|
-
if (!(b instanceof BoundingRect)) {
|
|
4955
|
-
b = BoundingRect.create(b);
|
|
4956
|
-
}
|
|
4957
|
-
var a = this;
|
|
4958
|
-
var ax0 = a.x;
|
|
4959
|
-
var ax1 = a.x + a.width;
|
|
4960
|
-
var ay0 = a.y;
|
|
4961
|
-
var ay1 = a.y + a.height;
|
|
4962
|
-
var bx0 = b.x;
|
|
4963
|
-
var bx1 = b.x + b.width;
|
|
4964
|
-
var by0 = b.y;
|
|
4965
|
-
var by1 = b.y + b.height;
|
|
4966
|
-
var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
|
|
4967
|
-
if (mtv) {
|
|
4968
|
-
var dMin = Infinity;
|
|
4969
|
-
var dMax = 0;
|
|
4970
|
-
var d0 = Math.abs(ax1 - bx0);
|
|
4971
|
-
var d1 = Math.abs(bx1 - ax0);
|
|
4972
|
-
var d2 = Math.abs(ay1 - by0);
|
|
4973
|
-
var d3 = Math.abs(by1 - ay0);
|
|
4974
|
-
var dx = Math.min(d0, d1);
|
|
4975
|
-
var dy = Math.min(d2, d3);
|
|
4976
|
-
if (ax1 < bx0 || bx1 < ax0) {
|
|
4977
|
-
if (dx > dMax) {
|
|
4978
|
-
dMax = dx;
|
|
4979
|
-
if (d0 < d1) {
|
|
4980
|
-
Point.set(maxTv$1, -d0, 0);
|
|
4981
|
-
}
|
|
4982
|
-
else {
|
|
4983
|
-
Point.set(maxTv$1, d1, 0);
|
|
4984
|
-
}
|
|
4985
|
-
}
|
|
4986
|
-
}
|
|
4987
|
-
else {
|
|
4988
|
-
if (dx < dMin) {
|
|
4989
|
-
dMin = dx;
|
|
4990
|
-
if (d0 < d1) {
|
|
4991
|
-
Point.set(minTv$1, d0, 0);
|
|
4992
|
-
}
|
|
4993
|
-
else {
|
|
4994
|
-
Point.set(minTv$1, -d1, 0);
|
|
4995
|
-
}
|
|
4996
|
-
}
|
|
4997
|
-
}
|
|
4998
|
-
if (ay1 < by0 || by1 < ay0) {
|
|
4999
|
-
if (dy > dMax) {
|
|
5000
|
-
dMax = dy;
|
|
5001
|
-
if (d2 < d3) {
|
|
5002
|
-
Point.set(maxTv$1, 0, -d2);
|
|
5003
|
-
}
|
|
5004
|
-
else {
|
|
5005
|
-
Point.set(maxTv$1, 0, d3);
|
|
5006
|
-
}
|
|
5007
|
-
}
|
|
5008
|
-
}
|
|
5009
|
-
else {
|
|
5010
|
-
if (dx < dMin) {
|
|
5011
|
-
dMin = dx;
|
|
5012
|
-
if (d2 < d3) {
|
|
5013
|
-
Point.set(minTv$1, 0, d2);
|
|
5014
|
-
}
|
|
5015
|
-
else {
|
|
5016
|
-
Point.set(minTv$1, 0, -d3);
|
|
5017
|
-
}
|
|
5018
|
-
}
|
|
5019
|
-
}
|
|
5020
|
-
}
|
|
5021
|
-
if (mtv) {
|
|
5022
|
-
Point.copy(mtv, overlap ? minTv$1 : maxTv$1);
|
|
5023
|
-
}
|
|
5024
|
-
return overlap;
|
|
5025
|
-
};
|
|
5026
|
-
BoundingRect.prototype.contain = function (x, y) {
|
|
5027
|
-
var rect = this;
|
|
5028
|
-
return x >= rect.x
|
|
5029
|
-
&& x <= (rect.x + rect.width)
|
|
5030
|
-
&& y >= rect.y
|
|
5031
|
-
&& y <= (rect.y + rect.height);
|
|
5032
|
-
};
|
|
5033
|
-
BoundingRect.prototype.clone = function () {
|
|
5034
|
-
return new BoundingRect(this.x, this.y, this.width, this.height);
|
|
5035
|
-
};
|
|
5036
|
-
BoundingRect.prototype.copy = function (other) {
|
|
5037
|
-
BoundingRect.copy(this, other);
|
|
5038
|
-
};
|
|
5039
|
-
BoundingRect.prototype.plain = function () {
|
|
5040
|
-
return {
|
|
5041
|
-
x: this.x,
|
|
5042
|
-
y: this.y,
|
|
5043
|
-
width: this.width,
|
|
5044
|
-
height: this.height
|
|
5045
|
-
};
|
|
5046
|
-
};
|
|
5047
|
-
BoundingRect.prototype.isFinite = function () {
|
|
5048
|
-
return isFinite(this.x)
|
|
5049
|
-
&& isFinite(this.y)
|
|
5050
|
-
&& isFinite(this.width)
|
|
5051
|
-
&& isFinite(this.height);
|
|
5052
|
-
};
|
|
5053
|
-
BoundingRect.prototype.isZero = function () {
|
|
5054
|
-
return this.width === 0 || this.height === 0;
|
|
5055
|
-
};
|
|
5056
|
-
BoundingRect.create = function (rect) {
|
|
5057
|
-
return new BoundingRect(rect.x, rect.y, rect.width, rect.height);
|
|
5058
|
-
};
|
|
5059
|
-
BoundingRect.copy = function (target, source) {
|
|
5060
|
-
target.x = source.x;
|
|
5061
|
-
target.y = source.y;
|
|
5062
|
-
target.width = source.width;
|
|
5063
|
-
target.height = source.height;
|
|
5064
|
-
};
|
|
5065
|
-
BoundingRect.applyTransform = function (target, source, m) {
|
|
5066
|
-
if (!m) {
|
|
5067
|
-
if (target !== source) {
|
|
5068
|
-
BoundingRect.copy(target, source);
|
|
5069
|
-
}
|
|
5070
|
-
return;
|
|
5071
|
-
}
|
|
5072
|
-
if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {
|
|
5073
|
-
var sx = m[0];
|
|
5074
|
-
var sy = m[3];
|
|
5075
|
-
var tx = m[4];
|
|
5076
|
-
var ty = m[5];
|
|
5077
|
-
target.x = source.x * sx + tx;
|
|
5078
|
-
target.y = source.y * sy + ty;
|
|
5079
|
-
target.width = source.width * sx;
|
|
5080
|
-
target.height = source.height * sy;
|
|
5081
|
-
if (target.width < 0) {
|
|
5082
|
-
target.x += target.width;
|
|
5083
|
-
target.width = -target.width;
|
|
5084
|
-
}
|
|
5085
|
-
if (target.height < 0) {
|
|
5086
|
-
target.y += target.height;
|
|
5087
|
-
target.height = -target.height;
|
|
5088
|
-
}
|
|
5089
|
-
return;
|
|
5090
|
-
}
|
|
5091
|
-
lt.x = lb.x = source.x;
|
|
5092
|
-
lt.y = rt.y = source.y;
|
|
5093
|
-
rb.x = rt.x = source.x + source.width;
|
|
5094
|
-
rb.y = lb.y = source.y + source.height;
|
|
5095
|
-
lt.transform(m);
|
|
5096
|
-
rt.transform(m);
|
|
5097
|
-
rb.transform(m);
|
|
5098
|
-
lb.transform(m);
|
|
5099
|
-
target.x = mathMin$4(lt.x, rb.x, lb.x, rt.x);
|
|
5100
|
-
target.y = mathMin$4(lt.y, rb.y, lb.y, rt.y);
|
|
5101
|
-
var maxX = mathMax$4(lt.x, rb.x, lb.x, rt.x);
|
|
5102
|
-
var maxY = mathMax$4(lt.y, rb.y, lb.y, rt.y);
|
|
5103
|
-
target.width = maxX - target.x;
|
|
5104
|
-
target.height = maxY - target.y;
|
|
5105
|
-
};
|
|
5106
|
-
return BoundingRect;
|
|
5107
|
-
}());
|
|
5108
|
-
|
|
5109
5168
|
var textWidthCache = {};
|
|
5110
5169
|
function getWidth(text, font) {
|
|
5111
5170
|
font = font || DEFAULT_FONT;
|
|
@@ -6492,7 +6551,16 @@ var ZRender = (function () {
|
|
|
6492
6551
|
var handerProxy = (!env.node && !env.worker && !ssrMode)
|
|
6493
6552
|
? new HandlerDomProxy(painter.getViewportRoot(), painter.root)
|
|
6494
6553
|
: null;
|
|
6495
|
-
|
|
6554
|
+
var useCoarsePointer = opts.useCoarsePointer;
|
|
6555
|
+
var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')
|
|
6556
|
+
? env.touchEventsSupported
|
|
6557
|
+
: !!useCoarsePointer;
|
|
6558
|
+
var defaultPointerSize = 44;
|
|
6559
|
+
var pointerSize;
|
|
6560
|
+
if (usePointerSize) {
|
|
6561
|
+
pointerSize = retrieve2(opts.pointerSize, defaultPointerSize);
|
|
6562
|
+
}
|
|
6563
|
+
this.handler = new Handler(storage, painter, handerProxy, painter.root, pointerSize);
|
|
6496
6564
|
this.animation = new Animation({
|
|
6497
6565
|
stage: {
|
|
6498
6566
|
update: ssrMode ? null : function () { return _this._flush(true); }
|
|
@@ -6816,22 +6884,17 @@ function getPrecisionSafe(val) {
|
|
|
6816
6884
|
* https://en.wikipedia.org/wiki/Largest_remainder_method
|
|
6817
6885
|
*
|
|
6818
6886
|
* @param valueList a list of all data
|
|
6819
|
-
* @param idx index of the data to be processed in valueList
|
|
6820
6887
|
* @param precision integer number showing digits of precision
|
|
6821
|
-
* @return
|
|
6888
|
+
* @return {Array<number>}
|
|
6822
6889
|
*/
|
|
6823
6890
|
|
|
6824
|
-
function
|
|
6825
|
-
if (!valueList[idx]) {
|
|
6826
|
-
return 0;
|
|
6827
|
-
}
|
|
6828
|
-
|
|
6891
|
+
function getPercentSeats(valueList, precision) {
|
|
6829
6892
|
var sum = reduce(valueList, function (acc, val) {
|
|
6830
6893
|
return acc + (isNaN(val) ? 0 : val);
|
|
6831
6894
|
}, 0);
|
|
6832
6895
|
|
|
6833
6896
|
if (sum === 0) {
|
|
6834
|
-
return
|
|
6897
|
+
return [];
|
|
6835
6898
|
}
|
|
6836
6899
|
|
|
6837
6900
|
var digits = Math.pow(10, precision);
|
|
@@ -6868,7 +6931,9 @@ function getPercentWithPrecision(valueList, idx, precision) {
|
|
|
6868
6931
|
++currentSum;
|
|
6869
6932
|
}
|
|
6870
6933
|
|
|
6871
|
-
return seats
|
|
6934
|
+
return map$1(seats, function (seat) {
|
|
6935
|
+
return seat / digits;
|
|
6936
|
+
});
|
|
6872
6937
|
}
|
|
6873
6938
|
/**
|
|
6874
6939
|
* Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004
|
|
@@ -13814,9 +13879,11 @@ function resizePath(path, rect) {
|
|
|
13814
13879
|
* Sub pixel optimize line for canvas
|
|
13815
13880
|
*/
|
|
13816
13881
|
|
|
13817
|
-
function subPixelOptimizeLine(
|
|
13818
|
-
subPixelOptimizeLine$1(
|
|
13819
|
-
|
|
13882
|
+
function subPixelOptimizeLine(shape, lineWidth) {
|
|
13883
|
+
subPixelOptimizeLine$1(shape, shape, {
|
|
13884
|
+
lineWidth: lineWidth
|
|
13885
|
+
});
|
|
13886
|
+
return shape;
|
|
13820
13887
|
}
|
|
13821
13888
|
/**
|
|
13822
13889
|
* Sub pixel optimize rect for canvas
|
|
@@ -15503,19 +15570,6 @@ function toCamelCase(str, upperCaseFirst) {
|
|
|
15503
15570
|
return str;
|
|
15504
15571
|
}
|
|
15505
15572
|
var normalizeCssArray = normalizeCssArray$1;
|
|
15506
|
-
var replaceReg = /([&<>"'])/g;
|
|
15507
|
-
var replaceMap = {
|
|
15508
|
-
'&': '&',
|
|
15509
|
-
'<': '<',
|
|
15510
|
-
'>': '>',
|
|
15511
|
-
'"': '"',
|
|
15512
|
-
'\'': '''
|
|
15513
|
-
};
|
|
15514
|
-
function encodeHTML(source) {
|
|
15515
|
-
return source == null ? '' : (source + '').replace(replaceReg, function (str, c) {
|
|
15516
|
-
return replaceMap[c];
|
|
15517
|
-
});
|
|
15518
|
-
}
|
|
15519
15573
|
/**
|
|
15520
15574
|
* Make value user readable for tooltip and label.
|
|
15521
15575
|
* "User readable":
|
|
@@ -26055,6 +26109,7 @@ function (_super) {
|
|
|
26055
26109
|
|
|
26056
26110
|
_this._dom = dom;
|
|
26057
26111
|
var defaultRenderer = 'canvas';
|
|
26112
|
+
var defaultCoarsePointer = 'auto';
|
|
26058
26113
|
var defaultUseDirtyRect = false;
|
|
26059
26114
|
|
|
26060
26115
|
var zr = _this._zr = init$1(dom, {
|
|
@@ -26063,7 +26118,9 @@ function (_super) {
|
|
|
26063
26118
|
width: opts.width,
|
|
26064
26119
|
height: opts.height,
|
|
26065
26120
|
ssr: opts.ssr,
|
|
26066
|
-
useDirtyRect: opts.useDirtyRect
|
|
26121
|
+
useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),
|
|
26122
|
+
useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),
|
|
26123
|
+
pointerSize: opts.pointerSize
|
|
26067
26124
|
});
|
|
26068
26125
|
_this._ssr = opts.ssr; // Expect 60 fps.
|
|
26069
26126
|
|
|
@@ -31881,6 +31938,7 @@ var builders = {
|
|
|
31881
31938
|
var matrix = transformGroup.transform;
|
|
31882
31939
|
var pt1 = [extent[0], 0];
|
|
31883
31940
|
var pt2 = [extent[1], 0];
|
|
31941
|
+
var inverse = pt1[0] > pt2[0];
|
|
31884
31942
|
|
|
31885
31943
|
if (matrix) {
|
|
31886
31944
|
applyTransform$1(pt1, pt1, matrix);
|
|
@@ -31891,8 +31949,6 @@ var builders = {
|
|
|
31891
31949
|
lineCap: 'round'
|
|
31892
31950
|
}, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());
|
|
31893
31951
|
var line = new Line({
|
|
31894
|
-
// Id for animation
|
|
31895
|
-
subPixelOptimize: true,
|
|
31896
31952
|
shape: {
|
|
31897
31953
|
x1: pt1[0],
|
|
31898
31954
|
y1: pt1[1],
|
|
@@ -31904,6 +31960,7 @@ var builders = {
|
|
|
31904
31960
|
silent: true,
|
|
31905
31961
|
z2: 1
|
|
31906
31962
|
});
|
|
31963
|
+
subPixelOptimizeLine(line.shape, line.style.lineWidth);
|
|
31907
31964
|
line.anid = 'line';
|
|
31908
31965
|
group.add(line);
|
|
31909
31966
|
var arrows = axisModel.get(['axisLine', 'symbol']);
|
|
@@ -31937,10 +31994,11 @@ var builders = {
|
|
|
31937
31994
|
var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset
|
|
31938
31995
|
|
|
31939
31996
|
var r = point.r + point.offset;
|
|
31997
|
+
var pt = inverse ? pt2 : pt1;
|
|
31940
31998
|
symbol.attr({
|
|
31941
31999
|
rotation: point.rotate,
|
|
31942
|
-
x:
|
|
31943
|
-
y:
|
|
32000
|
+
x: pt[0] + r * Math.cos(opt.rotation),
|
|
32001
|
+
y: pt[1] - r * Math.sin(opt.rotation),
|
|
31944
32002
|
silent: true,
|
|
31945
32003
|
z2: 11
|
|
31946
32004
|
});
|
|
@@ -32176,7 +32234,6 @@ function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, an
|
|
|
32176
32234
|
|
|
32177
32235
|
|
|
32178
32236
|
var tickEl = new Line({
|
|
32179
|
-
subPixelOptimize: true,
|
|
32180
32237
|
shape: {
|
|
32181
32238
|
x1: pt1[0],
|
|
32182
32239
|
y1: pt1[1],
|
|
@@ -32188,6 +32245,7 @@ function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, an
|
|
|
32188
32245
|
autoBatch: true,
|
|
32189
32246
|
silent: true
|
|
32190
32247
|
});
|
|
32248
|
+
subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);
|
|
32191
32249
|
tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;
|
|
32192
32250
|
tickEls.push(tickEl);
|
|
32193
32251
|
}
|
|
@@ -37465,10 +37523,22 @@ function getBasicPieLayout(seriesModel, api) {
|
|
|
37465
37523
|
var width = parsePercent(viewRect.width, api.getWidth());
|
|
37466
37524
|
var height = parsePercent(viewRect.height, api.getHeight());
|
|
37467
37525
|
var size = Math.min(width, height);
|
|
37468
|
-
var cx = parsePercent(center[0], width) + viewRect.x;
|
|
37469
|
-
var cy = parsePercent(center[1], height) + viewRect.y;
|
|
37470
37526
|
var r0 = parsePercent(radius[0], size / 2);
|
|
37471
37527
|
var r = parsePercent(radius[1], size / 2);
|
|
37528
|
+
var cx;
|
|
37529
|
+
var cy;
|
|
37530
|
+
var coordSys = seriesModel.coordinateSystem;
|
|
37531
|
+
|
|
37532
|
+
if (coordSys) {
|
|
37533
|
+
// percentage is not allowed when coordinate system is specified
|
|
37534
|
+
var point = coordSys.dataToPoint(center);
|
|
37535
|
+
cx = point[0] || 0;
|
|
37536
|
+
cy = point[1] || 0;
|
|
37537
|
+
} else {
|
|
37538
|
+
cx = parsePercent(center[0], width) + viewRect.x;
|
|
37539
|
+
cy = parsePercent(center[1], height) + viewRect.y;
|
|
37540
|
+
}
|
|
37541
|
+
|
|
37472
37542
|
return {
|
|
37473
37543
|
cx: cx,
|
|
37474
37544
|
cy: cy,
|
|
@@ -37964,7 +38034,8 @@ function pieLabelLayout(seriesModel) {
|
|
|
37964
38034
|
|
|
37965
38035
|
if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {
|
|
37966
38036
|
each$4(label.states, setNotShow);
|
|
37967
|
-
|
|
38037
|
+
each$4(labelLine.states, setNotShow);
|
|
38038
|
+
label.ignore = labelLine.ignore = true;
|
|
37968
38039
|
return;
|
|
37969
38040
|
}
|
|
37970
38041
|
|
|
@@ -38573,10 +38644,16 @@ function (_super) {
|
|
|
38573
38644
|
|
|
38574
38645
|
|
|
38575
38646
|
PieSeriesModel.prototype.getInitialData = function () {
|
|
38576
|
-
|
|
38647
|
+
var data = createSeriesDataSimply(this, {
|
|
38577
38648
|
coordDimensions: ['value'],
|
|
38578
38649
|
encodeDefaulter: curry$1(makeSeriesEncodeForNameBased, this)
|
|
38579
38650
|
});
|
|
38651
|
+
var valueList = [];
|
|
38652
|
+
data.each(data.mapDimension('value'), function (value) {
|
|
38653
|
+
valueList.push(value);
|
|
38654
|
+
});
|
|
38655
|
+
this.seats = getPercentSeats(valueList, data.hostModel.get('percentPrecision'));
|
|
38656
|
+
return data;
|
|
38580
38657
|
};
|
|
38581
38658
|
/**
|
|
38582
38659
|
* @overwrite
|
|
@@ -38584,16 +38661,9 @@ function (_super) {
|
|
|
38584
38661
|
|
|
38585
38662
|
|
|
38586
38663
|
PieSeriesModel.prototype.getDataParams = function (dataIndex) {
|
|
38587
|
-
var
|
|
38664
|
+
var params = _super.prototype.getDataParams.call(this, dataIndex);
|
|
38588
38665
|
|
|
38589
|
-
|
|
38590
|
-
|
|
38591
|
-
|
|
38592
|
-
var valueList = [];
|
|
38593
|
-
data.each(data.mapDimension('value'), function (value) {
|
|
38594
|
-
valueList.push(value);
|
|
38595
|
-
});
|
|
38596
|
-
params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));
|
|
38666
|
+
params.percent = this.seats[dataIndex];
|
|
38597
38667
|
params.$vars.push('percent');
|
|
38598
38668
|
return params;
|
|
38599
38669
|
};
|
|
@@ -38986,6 +39056,8 @@ var Layer = (function (_super) {
|
|
|
38986
39056
|
clearColor.__canvasGradient = clearColorGradientOrPattern;
|
|
38987
39057
|
}
|
|
38988
39058
|
else if (isImagePatternObject(clearColor)) {
|
|
39059
|
+
clearColor.scaleX = clearColor.scaleX || dpr;
|
|
39060
|
+
clearColor.scaleY = clearColor.scaleY || dpr;
|
|
38989
39061
|
clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {
|
|
38990
39062
|
dirty: function () {
|
|
38991
39063
|
self.setUnpainted();
|
|
@@ -39647,7 +39719,7 @@ function install(registers) {
|
|
|
39647
39719
|
registers.registerPainter('canvas', CanvasPainter);
|
|
39648
39720
|
}
|
|
39649
39721
|
|
|
39650
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-
|
|
39722
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block}.container{aspect-ratio:1/1;width:100%;display:flex;justify-content:center;align-items:center}.chart-container{width:100%;height:100%;--comp-color-1:var(--tct-chart-donut-color-1, var(--t-chart-donut-color-1, var(--t-accent-1, #e05252)));--comp-color-2:var(--tct-chart-donut-color-2, var(--t-chart-donut-color-2, var(--t-accent-2, #e09952)));--comp-color-3:var(--tct-chart-donut-color-3, var(--t-chart-donut-color-3, var(--t-accent-3, #e0e052)));--comp-color-4:var(--tct-chart-donut-color-4, var(--t-chart-donut-color-4, var(--t-accent-4, #99e052)));--comp-color-5:var(--tct-chart-donut-color-5, var(--t-chart-donut-color-5, var(--t-accent-5, #52e052)));--comp-color-6:var(--tct-chart-donut-color-6, var(--t-chart-donut-color-6, var(--t-accent-6, #52e099)));--comp-color-7:var(--tct-chart-donut-color-7, var(--t-chart-donut-color-7, var(--t-accent-7, #52e0e0)));--comp-color-8:var(--tct-chart-donut-color-8, var(--t-chart-donut-color-8, var(--t-accent-8, #5299e0)));--comp-color-9:var(--tct-chart-donut-color-9, var(--t-chart-donut-color-9, var(--t-accent-9, #5252e0)));--comp-color-10:var(--tct-chart-donut-color-10, var(--t-chart-donut-color-10, var(--t-accent-10, #9952e0)));--comp-color-11:var(--tct-chart-donut-color-11, var(--t-chart-donut-color-11, var(--t-accent-11, #e052e0)));--comp-color-12:var(--tct-chart-donut-color-12, var(--t-chart-donut-color-12, var(--t-accent-12, #e05299)))}.chart-container,.center-card{--comp-background-color:var(--tct-chart-donut-border-color, var(--t-chart-donut-border-color, var(--t-base, #ffffff)))}button{--comp-button-vertical-padding:var(--tct-chart-donut-button-vertical-padding, var(--t-chart-donut-button-vertical-padding, var(--app-scale-1x, 5px)));transition:box-shadow var(--tct-chart-donut-button-tween, var(--t-chart-donut-button-tween, var(--app-tween-1, 0.2s ease)));padding:var(--comp-button-vertical-padding) 0}button:active{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:hover{box-shadow:var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:focus{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}.center-card-container{position:absolute;top:50%;transform:translateY(-50%);padding:var(--tct-chart-donut-button-container-padding, var(--t-chart-donut-button-container-padding, var(--app-scale-1x, 5px)))}.center-card{width:100%;text-align:center;color:var(--tct-chart-donut-text-color, var(--t-chart-donut-text-color, var(--t-text, #4d4d4d)));margin-inline:auto;display:block}.center-card:is(button){cursor:pointer;background:var(--comp-background-color);border:0;border-radius:var(--tct-chart-donut-button-border-radius, var(--t-chart-donut-button-border-radius, var(--app-border-radius-1, 3px)))}q2-icon{--tct-icon-size:var(--tct-chart-donut-icon-size, var(--t-chart-donut-icon-size, 26px));margin-bottom:var(--tct-chart-donut-icon-margin-bottom, var(--t-chart-donut-icon-margin-bottom, var(--app-scale-1x, 5px)))}.name{font-size:var(--tct-chart-donut-name-font-size, var(--t-chart-donut-name-font-size, 14px))}.value{font-size:var(--tct-chart-donut-value-font-size, var(--t-chart-donut-value-font-size, 21px))}";
|
|
39651
39723
|
|
|
39652
39724
|
use([install$6, install$3, install$1, install, install$2, installLabelLayout]);
|
|
39653
39725
|
const Q2ChartDonut = class {
|
|
@@ -39655,12 +39727,6 @@ const Q2ChartDonut = class {
|
|
|
39655
39727
|
registerInstance(this, hostRef);
|
|
39656
39728
|
this.change = createEvent(this, "change", 7);
|
|
39657
39729
|
this.click = createEvent(this, "click", 7);
|
|
39658
|
-
this.innerRadius = '70%';
|
|
39659
|
-
this.outerRadius = '85%';
|
|
39660
|
-
this.minSliceSize = '2.5%';
|
|
39661
|
-
this.selectedOffset = 10;
|
|
39662
|
-
this.hoverScaleSize = 5;
|
|
39663
|
-
this.data = [];
|
|
39664
39730
|
this.defaultRecord = { id: null, value: null, name: null };
|
|
39665
39731
|
/// Event Handlers ///
|
|
39666
39732
|
this.onClickElsewhere = (event) => {
|
|
@@ -39714,6 +39780,19 @@ const Q2ChartDonut = class {
|
|
|
39714
39780
|
this.clearSelection();
|
|
39715
39781
|
event.stopPropagation();
|
|
39716
39782
|
};
|
|
39783
|
+
this.chartName = undefined;
|
|
39784
|
+
this.summaryIcon = undefined;
|
|
39785
|
+
this.summaryName = undefined;
|
|
39786
|
+
this.innerRadius = '70%';
|
|
39787
|
+
this.outerRadius = '85%';
|
|
39788
|
+
this.minSliceSize = '2.5%';
|
|
39789
|
+
this.selectedOffset = 10;
|
|
39790
|
+
this.hoverScaleSize = 5;
|
|
39791
|
+
this.format = undefined;
|
|
39792
|
+
this.isClickable = undefined;
|
|
39793
|
+
this.data = [];
|
|
39794
|
+
this.selectedId = undefined;
|
|
39795
|
+
this.hoveredId = undefined;
|
|
39717
39796
|
}
|
|
39718
39797
|
/// LifeCycle Hooks ///
|
|
39719
39798
|
componentDidLoad() {
|