@pyreon/charts 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analysis/index.js.html +1 -1
- package/lib/analysis/manual.js.html +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/manual.js +7 -7
- package/lib/manual.js.map +1 -1
- package/lib/types/index.d.ts +2204 -238
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/manual.d.ts +2217 -258
- package/lib/types/manual.d.ts.map +1 -1
- package/package.json +3 -9
- package/src/chart-component.tsx +2 -2
- package/src/use-chart.ts +6 -4
- package/lib/types/charts.d.ts +0 -7968
- package/lib/types/charts.d.ts.map +0 -1
- package/lib/types/components.d.ts +0 -4074
- package/lib/types/components.d.ts.map +0 -1
- package/lib/types/core.d.ts +0 -98
- package/lib/types/core.d.ts.map +0 -1
- package/lib/types/createSeriesData.d.ts +0 -325
- package/lib/types/createSeriesData.d.ts.map +0 -1
- package/lib/types/customGraphicKeyframeAnimation.d.ts +0 -3531
- package/lib/types/customGraphicKeyframeAnimation.d.ts.map +0 -1
- package/lib/types/graphic.d.ts +0 -4043
- package/lib/types/graphic.d.ts.map +0 -1
- package/lib/types/index2.d.ts +0 -2221
- package/lib/types/index2.d.ts.map +0 -1
- package/lib/types/manual2.d.ts +0 -2238
- package/lib/types/manual2.d.ts.map +0 -1
- package/lib/types/parseGeoJson.d.ts +0 -8695
- package/lib/types/parseGeoJson.d.ts.map +0 -1
- package/lib/types/renderers.d.ts +0 -995
- package/lib/types/renderers.d.ts.map +0 -1
|
@@ -1,3531 +0,0 @@
|
|
|
1
|
-
import { A as ZRImage, An as isArray, At as applyTransform, Bt as min, C as ZRText, Cn as eqNaN, Dn as hasOwn, Dt as Transformable, E as Rect, En as find, Et as TRANSFORMABLE_PROPS, Gn as mergeAll, Gt as sub, In as isNumber, Kn as mixin, Ln as isObject$1, Mt as copy$1, N as Path, Nn as isFunction, On as indexOf, Ot as copyTransform, Qn as retrieve3, Qt as BoundingRect, Rn as isString, S as Group, Sn as each$1, Tn as filter, U as Eventful, Un as map, V as Displayable, Vn as keys, Vt as normalize, W as cloneValue, Wn as merge, Xn as retrieve, Yn as reduce, Zn as retrieve2, _ as stop, _t as stringify, an as invert, bn as defaults, cn as rotate, en as Point, gn as clone, gt as parseCssFloat, h as isMiddleOrRightButtonOnMouseUpDown, hn as bind, ht as parse, in as identity, j as TSpan, jn as isArrayLike, ln as scale, lt as fastLerp, mn as assert, mt as modifyHSL, nn as copy, pt as modifyAlpha, qn as noop, rn as create, sn as mul, sr as __extends, tr as trim, un as translate, vn as createHashMap, wn as extend, x as CompoundPath, yn as curry, zt as max } from "./graphic.js";
|
|
2
|
-
import { $i as round, $n as setLabelStyle, Ar as getAnimationConfig, Bi as isRadianAroundZero, Bt as applyPreserveAspect, C as increaseInterval, Ci as makeInner, Cr as retrieveZInfo, Ct as normalizeSymbolSize, D as AxisModelCommonMixin, Dr as transformDirection, E as OrdinalMeta, Ei as normalizeToArray, Er as subPixelOptimizeLine, Fr as updateProps, Gn as Model, Gr as Ring, Hi as mathMax$1, Hr as Line$1, Jr as Circle, Jt as mergeLayoutParam, Ki as parsePercent, Kn as LabelMarginType, Kt as getLayoutParams, Lr as OrientedBoundingRect, Mr as removeElement, Mt as tokens, Nn as retrieveRawValue, Or as traverseElements, Pr as saveOldStyle, Qi as remRadian, Qr as enableComponentHighDownFeatures, Rr as RadialGradient, Rt as ComponentModel, St as normalizeSymbolOffset, T as logTransform, Ur as Polyline, Ut as createBoxLayoutReference, V as registerAction, Vi as linearMap, Vr as BezierCurve, Wn as DataDiffer, Wr as Polygon, Wt as fetchLayoutMode, Yn as createTextStyle, Yr as createFromString, Zn as getLabelStatesModels, Zr as SPECIAL_STATES, _ as shouldShowAllLabels, _i as defaultEmphasis, a as Axis, ai as leaveEmphasis, at as findEventDispatcher, br as mergePath, c as createScaleByModel, cr as ensureCopyTransform, d as getScaleExtent, di as getECData, f as ifAxisCrossZero, g as shouldAxisShow, gr as isBoundingRectAxisAligned, h as retrieveAxisBreaksOption, hr as groupTransition, ir as clipPointsByRect, it as createOrUpdatePatternFromDecal, jr as initProps, lr as expandOrShrinkRect, lt as ComponentView, m as niceScaleExtent, mi as SINGLE_REFERRING, n as GeoJSONRegion, ni as enterEmphasis, nr as XY, o as AxisTickLabelComputingKind, p as isNameLocationCenter, pn as getUID, pr as getTransform$1, qi as parsePositionSizeOption, qr as Ellipse, qt as getLayoutRect, r as GeoSVGRegion, s as createAxisLabelsComputingContext, si as setDefaultStateProxy, sr as ensureCopyRect, t as parseGeoJSON, tr as WH, u as getDataDimensionsOnAxis, ui as toggleHoverEmphasis, un as getScaleBreakHelper, w as isIntervalOrLogScale, wr as setTooltipConfig, x as IntervalScale, xn as injectCoordSysByOption, xt as createSymbol$1, zr as LinearGradient } from "./parseGeoJson.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/chart/helper/labelHelper.js
|
|
5
|
-
/**
|
|
6
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @return label string. Not null/undefined
|
|
10
|
-
*/
|
|
11
|
-
function getDefaultLabel(data, dataIndex) {
|
|
12
|
-
var labelDims = data.mapDimensionsAll("defaultedLabel");
|
|
13
|
-
var len = labelDims.length;
|
|
14
|
-
if (len === 1) {
|
|
15
|
-
var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);
|
|
16
|
-
return rawVal != null ? rawVal + "" : null;
|
|
17
|
-
} else if (len) {
|
|
18
|
-
var vals = [];
|
|
19
|
-
for (var i = 0; i < labelDims.length; i++) vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));
|
|
20
|
-
return vals.join(" ");
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function getDefaultInterpolatedLabel(data, interpolatedValue) {
|
|
24
|
-
var labelDims = data.mapDimensionsAll("defaultedLabel");
|
|
25
|
-
if (!isArray(interpolatedValue)) return interpolatedValue + "";
|
|
26
|
-
var vals = [];
|
|
27
|
-
for (var i = 0; i < labelDims.length; i++) {
|
|
28
|
-
var dimIndex = data.getDimensionIndex(labelDims[i]);
|
|
29
|
-
if (dimIndex >= 0) vals.push(interpolatedValue[dimIndex]);
|
|
30
|
-
}
|
|
31
|
-
return vals.join(" ");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/chart/helper/Symbol.js
|
|
36
|
-
/**
|
|
37
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
function driftSymbol(dx, dy) {
|
|
41
|
-
this.parent.drift(dx, dy);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/chart/helper/SymbolDraw.js
|
|
46
|
-
/**
|
|
47
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
48
|
-
*/
|
|
49
|
-
function symbolNeedsDraw(data, point, idx, opt) {
|
|
50
|
-
return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, "symbol") !== "none";
|
|
51
|
-
}
|
|
52
|
-
function normalizeUpdateOpt(opt) {
|
|
53
|
-
if (opt != null && !isObject$1(opt)) opt = {
|
|
54
|
-
isIgnore: opt
|
|
55
|
-
};
|
|
56
|
-
return opt || {};
|
|
57
|
-
}
|
|
58
|
-
function makeSeriesScope$1(data) {
|
|
59
|
-
var seriesModel = data.hostModel;
|
|
60
|
-
var emphasisModel = seriesModel.getModel("emphasis");
|
|
61
|
-
return {
|
|
62
|
-
emphasisItemStyle: emphasisModel.getModel("itemStyle").getItemStyle(),
|
|
63
|
-
blurItemStyle: seriesModel.getModel(["blur", "itemStyle"]).getItemStyle(),
|
|
64
|
-
selectItemStyle: seriesModel.getModel(["select", "itemStyle"]).getItemStyle(),
|
|
65
|
-
focus: emphasisModel.get("focus"),
|
|
66
|
-
blurScope: emphasisModel.get("blurScope"),
|
|
67
|
-
emphasisDisabled: emphasisModel.get("disabled"),
|
|
68
|
-
hoverScale: emphasisModel.get("scale"),
|
|
69
|
-
labelStatesModels: getLabelStatesModels(seriesModel),
|
|
70
|
-
cursorStyle: seriesModel.get("cursor")
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/CoordinateSystem.js
|
|
75
|
-
/**
|
|
76
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
77
|
-
*/
|
|
78
|
-
function isCoordinateSystemType(coordSys, type) {
|
|
79
|
-
return coordSys.type === type;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/label/labelLayoutHelper.js
|
|
84
|
-
/**
|
|
85
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
function setLabelLayoutDirty(labelGeometry, dirtyOrClear, dirtyBits) {
|
|
89
|
-
dirtyBits = dirtyBits || LABEL_LAYOUT_DIRTY_ALL;
|
|
90
|
-
dirtyOrClear ? labelGeometry.dirty |= dirtyBits : labelGeometry.dirty &= ~dirtyBits;
|
|
91
|
-
}
|
|
92
|
-
function isLabelLayoutDirty(labelGeometry, dirtyBits) {
|
|
93
|
-
dirtyBits = dirtyBits || LABEL_LAYOUT_DIRTY_ALL;
|
|
94
|
-
return labelGeometry.dirty == null || !!(labelGeometry.dirty & dirtyBits);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* [CAUTION]
|
|
98
|
-
* - No auto dirty propagation mechanism yet. If the transform of the raw label or any of its ancestors is
|
|
99
|
-
* changed, must sync the changes to the props of `LabelGeometry` by:
|
|
100
|
-
* either explicitly call:
|
|
101
|
-
* `setLabelLayoutDirty(labelLayout, true); ensureLabelLayoutWithGeometry(labelLayout);`
|
|
102
|
-
* or call (if only translation is performed):
|
|
103
|
-
* `labelLayoutApplyTranslation(labelLayout);`
|
|
104
|
-
* - `label.ignore` is not necessarily falsy, and not considered in computing `LabelGeometry`,
|
|
105
|
-
* since it might be modified by some overlap resolving handling.
|
|
106
|
-
* - To duplicate or make a variation:
|
|
107
|
-
* use `newLabelLayoutWithGeometry`.
|
|
108
|
-
*
|
|
109
|
-
* The result can also be the input of this method.
|
|
110
|
-
* @return `NullUndefined` if and only if `labelLayout` is `NullUndefined`.
|
|
111
|
-
*/
|
|
112
|
-
function ensureLabelLayoutWithGeometry(labelLayout) {
|
|
113
|
-
if (!labelLayout) return;
|
|
114
|
-
if (isLabelLayoutDirty(labelLayout)) computeLabelGeometry(labelLayout, labelLayout.label, labelLayout);
|
|
115
|
-
return labelLayout;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* The props in `out` will be filled if existing, or created.
|
|
119
|
-
*/
|
|
120
|
-
function computeLabelGeometry(out, label, opt) {
|
|
121
|
-
var rawTransform = label.getComputedTransform();
|
|
122
|
-
out.transform = ensureCopyTransform(out.transform, rawTransform);
|
|
123
|
-
var outLocalRect = out.localRect = ensureCopyRect(out.localRect, label.getBoundingRect());
|
|
124
|
-
var labelStyleExt = label.style;
|
|
125
|
-
var margin = labelStyleExt.margin;
|
|
126
|
-
var marginForce = opt && opt.marginForce;
|
|
127
|
-
var minMarginForce = opt && opt.minMarginForce;
|
|
128
|
-
var marginDefault = opt && opt.marginDefault;
|
|
129
|
-
var marginType = labelStyleExt.__marginType;
|
|
130
|
-
if (marginType == null && marginDefault) {
|
|
131
|
-
margin = marginDefault;
|
|
132
|
-
marginType = LabelMarginType.textMargin;
|
|
133
|
-
}
|
|
134
|
-
for (var i = 0; i < 4; i++) _tmpLabelMargin[i] = marginType === LabelMarginType.minMargin && minMarginForce && minMarginForce[i] != null ? minMarginForce[i] : marginForce && marginForce[i] != null ? marginForce[i] : margin ? margin[i] : 0;
|
|
135
|
-
if (marginType === LabelMarginType.textMargin) expandOrShrinkRect(outLocalRect, _tmpLabelMargin, false, false);
|
|
136
|
-
var outGlobalRect = out.rect = ensureCopyRect(out.rect, outLocalRect);
|
|
137
|
-
if (rawTransform) outGlobalRect.applyTransform(rawTransform);
|
|
138
|
-
if (marginType === LabelMarginType.minMargin) expandOrShrinkRect(outGlobalRect, _tmpLabelMargin, false, false);
|
|
139
|
-
out.axisAligned = isBoundingRectAxisAligned(rawTransform);
|
|
140
|
-
(out.label = out.label || {}).ignore = label.ignore;
|
|
141
|
-
setLabelLayoutDirty(out, false);
|
|
142
|
-
setLabelLayoutDirty(out, true, LABEL_LAYOUT_DIRTY_BIT_OBB);
|
|
143
|
-
return out;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* The props in `out` will be filled if existing, or created.
|
|
147
|
-
*/
|
|
148
|
-
function computeLabelGeometry2(out, rawLocalRect, rawTransform) {
|
|
149
|
-
out.transform = ensureCopyTransform(out.transform, rawTransform);
|
|
150
|
-
out.localRect = ensureCopyRect(out.localRect, rawLocalRect);
|
|
151
|
-
out.rect = ensureCopyRect(out.rect, rawLocalRect);
|
|
152
|
-
if (rawTransform) out.rect.applyTransform(rawTransform);
|
|
153
|
-
out.axisAligned = isBoundingRectAxisAligned(rawTransform);
|
|
154
|
-
out.obb = void 0;
|
|
155
|
-
(out.label = out.label || {}).ignore = false;
|
|
156
|
-
return out;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* This is a shortcut of
|
|
160
|
-
* ```js
|
|
161
|
-
* labelLayout.label.x = newX;
|
|
162
|
-
* labelLayout.label.y = newY;
|
|
163
|
-
* setLabelLayoutDirty(labelLayout, true);
|
|
164
|
-
* ensureLabelLayoutWithGeometry(labelLayout);
|
|
165
|
-
* ```
|
|
166
|
-
* and provide better performance in this common case.
|
|
167
|
-
*/
|
|
168
|
-
function labelLayoutApplyTranslation(labelLayout, offset) {
|
|
169
|
-
if (!labelLayout) return;
|
|
170
|
-
labelLayout.label.x += offset.x;
|
|
171
|
-
labelLayout.label.y += offset.y;
|
|
172
|
-
labelLayout.label.markRedraw();
|
|
173
|
-
var transform = labelLayout.transform;
|
|
174
|
-
if (transform) {
|
|
175
|
-
transform[4] += offset.x;
|
|
176
|
-
transform[5] += offset.y;
|
|
177
|
-
}
|
|
178
|
-
var globalRect = labelLayout.rect;
|
|
179
|
-
if (globalRect) {
|
|
180
|
-
globalRect.x += offset.x;
|
|
181
|
-
globalRect.y += offset.y;
|
|
182
|
-
}
|
|
183
|
-
var obb = labelLayout.obb;
|
|
184
|
-
if (obb) obb.fromBoundingRect(labelLayout.localRect, transform);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* To duplicate or make a variation of a label layout.
|
|
188
|
-
* Copy the only relevant properties to avoid the conflict or wrongly reuse of the props of `LabelLayoutWithGeometry`.
|
|
189
|
-
*/
|
|
190
|
-
function newLabelLayoutWithGeometry(newBaseWithDefaults, source) {
|
|
191
|
-
for (var i = 0; i < LABEL_LAYOUT_BASE_PROPS.length; i++) {
|
|
192
|
-
var prop = LABEL_LAYOUT_BASE_PROPS[i];
|
|
193
|
-
if (newBaseWithDefaults[prop] == null) newBaseWithDefaults[prop] = source[prop];
|
|
194
|
-
}
|
|
195
|
-
return ensureLabelLayoutWithGeometry(newBaseWithDefaults);
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Create obb if no one, can cache it.
|
|
199
|
-
*/
|
|
200
|
-
function ensureOBB(labelGeometry) {
|
|
201
|
-
var obb = labelGeometry.obb;
|
|
202
|
-
if (!obb || isLabelLayoutDirty(labelGeometry, LABEL_LAYOUT_DIRTY_BIT_OBB)) {
|
|
203
|
-
labelGeometry.obb = obb = obb || new OrientedBoundingRect();
|
|
204
|
-
obb.fromBoundingRect(labelGeometry.localRect, labelGeometry.transform);
|
|
205
|
-
setLabelLayoutDirty(labelGeometry, false, LABEL_LAYOUT_DIRTY_BIT_OBB);
|
|
206
|
-
}
|
|
207
|
-
return obb;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Adjust labels on x/y direction to avoid overlap.
|
|
211
|
-
*
|
|
212
|
-
* PENDING: the current implementation is based on the global bounding rect rather than the local rect,
|
|
213
|
-
* which may be not preferable in some edge cases when the label has rotation, but works for most cases,
|
|
214
|
-
* since rotation is unnecessary when there is sufficient space, while squeezing is applied regardless
|
|
215
|
-
* of overlapping when there is no enough space.
|
|
216
|
-
*
|
|
217
|
-
* NOTICE:
|
|
218
|
-
* - The input `list` and its content will be modified (sort, label.x/y, rect).
|
|
219
|
-
* - The caller should sync the modifications to the other parts by
|
|
220
|
-
* `setLabelLayoutDirty` and `ensureLabelLayoutWithGeometry` if needed.
|
|
221
|
-
*
|
|
222
|
-
* @return adjusted
|
|
223
|
-
*/
|
|
224
|
-
function shiftLayoutOnXY(list, xyDimIdx, minBound, maxBound, balanceShift) {
|
|
225
|
-
var len = list.length;
|
|
226
|
-
var xyDim = XY[xyDimIdx];
|
|
227
|
-
var sizeDim = WH[xyDimIdx];
|
|
228
|
-
if (len < 2) return false;
|
|
229
|
-
list.sort(function (a, b) {
|
|
230
|
-
return a.rect[xyDim] - b.rect[xyDim];
|
|
231
|
-
});
|
|
232
|
-
var lastPos = 0;
|
|
233
|
-
var delta;
|
|
234
|
-
var adjusted = false;
|
|
235
|
-
var totalShifts = 0;
|
|
236
|
-
for (var i = 0; i < len; i++) {
|
|
237
|
-
var item = list[i];
|
|
238
|
-
var rect = item.rect;
|
|
239
|
-
delta = rect[xyDim] - lastPos;
|
|
240
|
-
if (delta < 0) {
|
|
241
|
-
rect[xyDim] -= delta;
|
|
242
|
-
item.label[xyDim] -= delta;
|
|
243
|
-
adjusted = true;
|
|
244
|
-
}
|
|
245
|
-
var shift = Math.max(-delta, 0);
|
|
246
|
-
totalShifts += shift;
|
|
247
|
-
lastPos = rect[xyDim] + rect[sizeDim];
|
|
248
|
-
}
|
|
249
|
-
if (totalShifts > 0 && balanceShift) shiftList(-totalShifts / len, 0, len);
|
|
250
|
-
var first = list[0];
|
|
251
|
-
var last = list[len - 1];
|
|
252
|
-
var minGap;
|
|
253
|
-
var maxGap;
|
|
254
|
-
updateMinMaxGap();
|
|
255
|
-
minGap < 0 && squeezeGaps(-minGap, .8);
|
|
256
|
-
maxGap < 0 && squeezeGaps(maxGap, .8);
|
|
257
|
-
updateMinMaxGap();
|
|
258
|
-
takeBoundsGap(minGap, maxGap, 1);
|
|
259
|
-
takeBoundsGap(maxGap, minGap, -1);
|
|
260
|
-
updateMinMaxGap();
|
|
261
|
-
if (minGap < 0) squeezeWhenBailout(-minGap);
|
|
262
|
-
if (maxGap < 0) squeezeWhenBailout(maxGap);
|
|
263
|
-
function updateMinMaxGap() {
|
|
264
|
-
minGap = first.rect[xyDim] - minBound;
|
|
265
|
-
maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];
|
|
266
|
-
}
|
|
267
|
-
function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {
|
|
268
|
-
if (gapThisBound < 0) {
|
|
269
|
-
var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);
|
|
270
|
-
if (moveFromMaxGap > 0) {
|
|
271
|
-
shiftList(moveFromMaxGap * moveDir, 0, len);
|
|
272
|
-
var remained = moveFromMaxGap + gapThisBound;
|
|
273
|
-
if (remained < 0) squeezeGaps(-remained * moveDir, 1);
|
|
274
|
-
} else squeezeGaps(-gapThisBound * moveDir, 1);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
function shiftList(delta, start, end) {
|
|
278
|
-
if (delta !== 0) adjusted = true;
|
|
279
|
-
for (var i = start; i < end; i++) {
|
|
280
|
-
var item = list[i];
|
|
281
|
-
var rect = item.rect;
|
|
282
|
-
rect[xyDim] += delta;
|
|
283
|
-
item.label[xyDim] += delta;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
function squeezeGaps(delta, maxSqeezePercent) {
|
|
287
|
-
var gaps = [];
|
|
288
|
-
var totalGaps = 0;
|
|
289
|
-
for (var i = 1; i < len; i++) {
|
|
290
|
-
var prevItemRect = list[i - 1].rect;
|
|
291
|
-
var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);
|
|
292
|
-
gaps.push(gap);
|
|
293
|
-
totalGaps += gap;
|
|
294
|
-
}
|
|
295
|
-
if (!totalGaps) return;
|
|
296
|
-
var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);
|
|
297
|
-
if (delta > 0) for (var i = 0; i < len - 1; i++) {
|
|
298
|
-
var movement = gaps[i] * squeezePercent;
|
|
299
|
-
shiftList(movement, 0, i + 1);
|
|
300
|
-
} else for (var i = len - 1; i > 0; i--) {
|
|
301
|
-
var movement = gaps[i - 1] * squeezePercent;
|
|
302
|
-
shiftList(-movement, i, len);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Squeeze to allow overlap if there is no more space available.
|
|
307
|
-
* Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.
|
|
308
|
-
*/
|
|
309
|
-
function squeezeWhenBailout(delta) {
|
|
310
|
-
var dir = delta < 0 ? -1 : 1;
|
|
311
|
-
delta = Math.abs(delta);
|
|
312
|
-
var moveForEachLabel = Math.ceil(delta / (len - 1));
|
|
313
|
-
for (var i = 0; i < len - 1; i++) {
|
|
314
|
-
if (dir > 0) shiftList(moveForEachLabel, 0, i + 1);else shiftList(-moveForEachLabel, len - i - 1, len);
|
|
315
|
-
delta -= moveForEachLabel;
|
|
316
|
-
if (delta <= 0) return;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return adjusted;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* [NOTICE - restore]:
|
|
323
|
-
* 'series:layoutlabels' may be triggered during some shortcut passes, such as zooming in series.graph/geo
|
|
324
|
-
* (`updateLabelLayout`), where the modified `Element` props should be restorable from `defaultAttr`.
|
|
325
|
-
* @see `SavedLabelAttr` in `LabelManager.ts`
|
|
326
|
-
* `restoreIgnore` can be called to perform the restore, if needed.
|
|
327
|
-
*
|
|
328
|
-
* [NOTICE - state]:
|
|
329
|
-
* Regarding Element's states, this method is only designed for the normal state.
|
|
330
|
-
* PENDING: although currently this method is effectively called in other states in `updateLabelLayout` case,
|
|
331
|
-
* the bad case is not noticeable in the zooming scenario.
|
|
332
|
-
*/
|
|
333
|
-
function hideOverlap(labelList) {
|
|
334
|
-
var displayedLabels = [];
|
|
335
|
-
labelList.sort(function (a, b) {
|
|
336
|
-
return (b.suggestIgnore ? 1 : 0) - (a.suggestIgnore ? 1 : 0) || b.priority - a.priority;
|
|
337
|
-
});
|
|
338
|
-
function hideEl(el) {
|
|
339
|
-
if (!el.ignore) {
|
|
340
|
-
var emphasisState = el.ensureState("emphasis");
|
|
341
|
-
if (emphasisState.ignore == null) emphasisState.ignore = false;
|
|
342
|
-
}
|
|
343
|
-
el.ignore = true;
|
|
344
|
-
}
|
|
345
|
-
for (var i = 0; i < labelList.length; i++) {
|
|
346
|
-
var labelItem = ensureLabelLayoutWithGeometry(labelList[i]);
|
|
347
|
-
if (labelItem.label.ignore) continue;
|
|
348
|
-
var label = labelItem.label;
|
|
349
|
-
var labelLine = labelItem.labelLine;
|
|
350
|
-
var overlapped = false;
|
|
351
|
-
for (var j = 0; j < displayedLabels.length; j++) if (labelIntersect(labelItem, displayedLabels[j], null, {
|
|
352
|
-
touchThreshold: .05
|
|
353
|
-
})) {
|
|
354
|
-
overlapped = true;
|
|
355
|
-
break;
|
|
356
|
-
}
|
|
357
|
-
if (overlapped) {
|
|
358
|
-
hideEl(label);
|
|
359
|
-
labelLine && hideEl(labelLine);
|
|
360
|
-
} else displayedLabels.push(labelItem);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Enable fast check for performance; use obb if inevitable.
|
|
365
|
-
* If `mtv` is used, `targetLayoutInfo` can be moved based on the values filled into `mtv`.
|
|
366
|
-
*
|
|
367
|
-
* This method is based only on the current `Element` states (regardless of other states).
|
|
368
|
-
* Typically this method (and the entire layout process) is performed in normal state.
|
|
369
|
-
*/
|
|
370
|
-
function labelIntersect(baseLayoutInfo, targetLayoutInfo, mtv, intersectOpt) {
|
|
371
|
-
if (!baseLayoutInfo || !targetLayoutInfo) return false;
|
|
372
|
-
if (baseLayoutInfo.label && baseLayoutInfo.label.ignore || targetLayoutInfo.label && targetLayoutInfo.label.ignore) return false;
|
|
373
|
-
if (!baseLayoutInfo.rect.intersect(targetLayoutInfo.rect, mtv, intersectOpt)) return false;
|
|
374
|
-
if (baseLayoutInfo.axisAligned && targetLayoutInfo.axisAligned) return true;
|
|
375
|
-
return ensureOBB(baseLayoutInfo).intersect(ensureOBB(targetLayoutInfo), mtv, intersectOpt);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/cartesian/GridModel.js
|
|
380
|
-
/**
|
|
381
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
|
-
function getAxisBreakHelper() {
|
|
385
|
-
return _impl;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
//#endregion
|
|
389
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/axisModelCreator.js
|
|
390
|
-
/**
|
|
391
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
392
|
-
*/
|
|
393
|
-
/**
|
|
394
|
-
* Generate sub axis model class
|
|
395
|
-
* @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...
|
|
396
|
-
*/
|
|
397
|
-
function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
|
|
398
|
-
each$1(AXIS_TYPES, function (v, axisType) {
|
|
399
|
-
var defaultOption = merge(merge({}, axisDefault_default[axisType], true), extraDefaultOption, true);
|
|
400
|
-
var AxisModel = function (_super) {
|
|
401
|
-
__extends(AxisModel, _super);
|
|
402
|
-
function AxisModel() {
|
|
403
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
404
|
-
_this.type = axisName + "Axis." + axisType;
|
|
405
|
-
return _this;
|
|
406
|
-
}
|
|
407
|
-
AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {
|
|
408
|
-
var layoutMode = fetchLayoutMode(this);
|
|
409
|
-
var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
|
|
410
|
-
merge(option, ecModel.getTheme().get(axisType + "Axis"));
|
|
411
|
-
merge(option, this.getDefaultOption());
|
|
412
|
-
option.type = getAxisType(option);
|
|
413
|
-
if (layoutMode) mergeLayoutParam(option, inputPositionParams, layoutMode);
|
|
414
|
-
};
|
|
415
|
-
AxisModel.prototype.optionUpdated = function () {
|
|
416
|
-
if (this.option.type === "category") this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);
|
|
417
|
-
};
|
|
418
|
-
/**
|
|
419
|
-
* Should not be called before all of 'getInitailData' finished.
|
|
420
|
-
* Because categories are collected during initializing data.
|
|
421
|
-
*/
|
|
422
|
-
AxisModel.prototype.getCategories = function (rawData) {
|
|
423
|
-
var option = this.option;
|
|
424
|
-
if (option.type === "category") {
|
|
425
|
-
if (rawData) return option.data;
|
|
426
|
-
return this.__ordinalMeta.categories;
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
AxisModel.prototype.getOrdinalMeta = function () {
|
|
430
|
-
return this.__ordinalMeta;
|
|
431
|
-
};
|
|
432
|
-
AxisModel.prototype.updateAxisBreaks = function (payload) {
|
|
433
|
-
var axisBreakHelper = getAxisBreakHelper();
|
|
434
|
-
return axisBreakHelper ? axisBreakHelper.updateModelAxisBreak(this, payload) : {
|
|
435
|
-
breaks: []
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
AxisModel.type = axisName + "Axis." + axisType;
|
|
439
|
-
AxisModel.defaultOption = defaultOption;
|
|
440
|
-
return AxisModel;
|
|
441
|
-
}(BaseAxisModelClass);
|
|
442
|
-
registers.registerComponentModel(AxisModel);
|
|
443
|
-
});
|
|
444
|
-
registers.registerSubTypeDefaulter(axisName + "Axis", getAxisType);
|
|
445
|
-
}
|
|
446
|
-
function getAxisType(option) {
|
|
447
|
-
return option.type || (option.data ? "category" : "value");
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
//#endregion
|
|
451
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/cartesian/Cartesian.js
|
|
452
|
-
/**
|
|
453
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
454
|
-
*/
|
|
455
|
-
|
|
456
|
-
function canCalculateAffineTransform(scale) {
|
|
457
|
-
return (scale.type === "interval" || scale.type === "time") && !scale.hasBreaks();
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* [CAUTION]
|
|
461
|
-
* 1. The call of this function must be after axisLabel overlap handlings
|
|
462
|
-
* (such as `hideOverlap`, `fixMinMaxLabelShow`) and after transform calculating.
|
|
463
|
-
* 2. Can be called multiple times and should be idempotent.
|
|
464
|
-
*/
|
|
465
|
-
function resetOverlapRecordToShared(cfg, shared, axisModel, labelLayoutList) {
|
|
466
|
-
var axis = axisModel.axis;
|
|
467
|
-
var record = shared.ensureRecord(axisModel);
|
|
468
|
-
var labelInfoList = [];
|
|
469
|
-
var stOccupiedRect;
|
|
470
|
-
var useStOccupiedRect = hasAxisName(cfg.axisName) && isNameLocationCenter(cfg.nameLocation);
|
|
471
|
-
each$1(labelLayoutList, function (layout) {
|
|
472
|
-
var layoutInfo = ensureLabelLayoutWithGeometry(layout);
|
|
473
|
-
if (!layoutInfo || layoutInfo.label.ignore) return;
|
|
474
|
-
labelInfoList.push(layoutInfo);
|
|
475
|
-
var transGroup = record.transGroup;
|
|
476
|
-
if (useStOccupiedRect) {
|
|
477
|
-
transGroup.transform ? invert(_stTransTmp, transGroup.transform) : identity(_stTransTmp);
|
|
478
|
-
if (layoutInfo.transform) mul(_stTransTmp, _stTransTmp, layoutInfo.transform);
|
|
479
|
-
BoundingRect.copy(_stLabelRectTmp, layoutInfo.localRect);
|
|
480
|
-
_stLabelRectTmp.applyTransform(_stTransTmp);
|
|
481
|
-
stOccupiedRect ? stOccupiedRect.union(_stLabelRectTmp) : BoundingRect.copy(stOccupiedRect = new BoundingRect(0, 0, 0, 0), _stLabelRectTmp);
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
var sortByDim = Math.abs(record.dirVec.x) > .1 ? "x" : "y";
|
|
485
|
-
var sortByValue = record.transGroup[sortByDim];
|
|
486
|
-
labelInfoList.sort(function (info1, info2) {
|
|
487
|
-
return Math.abs(info1.label[sortByDim] - sortByValue) - Math.abs(info2.label[sortByDim] - sortByValue);
|
|
488
|
-
});
|
|
489
|
-
if (useStOccupiedRect && stOccupiedRect) {
|
|
490
|
-
var extent = axis.getExtent();
|
|
491
|
-
var axisLineX = Math.min(extent[0], extent[1]);
|
|
492
|
-
var axisLineWidth = Math.max(extent[0], extent[1]) - axisLineX;
|
|
493
|
-
stOccupiedRect.union(new BoundingRect(axisLineX, 0, axisLineWidth, 1));
|
|
494
|
-
}
|
|
495
|
-
record.stOccupiedRect = stOccupiedRect;
|
|
496
|
-
record.labelInfoList = labelInfoList;
|
|
497
|
-
}
|
|
498
|
-
function moveIfOverlap(basedLayoutInfo, movableLayoutInfo, moveDirVec) {
|
|
499
|
-
var mtv = new Point();
|
|
500
|
-
if (labelIntersect(basedLayoutInfo, movableLayoutInfo, mtv, {
|
|
501
|
-
direction: Math.atan2(moveDirVec.y, moveDirVec.x),
|
|
502
|
-
bidirectional: false,
|
|
503
|
-
touchThreshold: .05
|
|
504
|
-
})) labelLayoutApplyTranslation(movableLayoutInfo, mtv);
|
|
505
|
-
}
|
|
506
|
-
function moveIfOverlapByLinearLabels(baseLayoutInfoList, baseDirVec, movableLayoutInfo, moveDirVec) {
|
|
507
|
-
var sameDir = Point.dot(moveDirVec, baseDirVec) >= 0;
|
|
508
|
-
for (var idx = 0, len = baseLayoutInfoList.length; idx < len; idx++) {
|
|
509
|
-
var labelInfo = baseLayoutInfoList[sameDir ? idx : len - 1 - idx];
|
|
510
|
-
if (!labelInfo.label.ignore) moveIfOverlap(labelInfo, movableLayoutInfo, moveDirVec);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* @caution
|
|
515
|
-
* - Ensure it is called after the data processing stage finished.
|
|
516
|
-
* - It might be called before `CahrtView#render`, sush as called at `CoordinateSystem#update`,
|
|
517
|
-
* thus ensure the result the same whenever it is called.
|
|
518
|
-
*
|
|
519
|
-
* A builder for a straight-line axis.
|
|
520
|
-
*
|
|
521
|
-
* A final axis is translated and rotated from a "standard axis".
|
|
522
|
-
* So opt.position and opt.rotation is required.
|
|
523
|
-
*
|
|
524
|
-
* A "standard axis" is the axis [0,0]-->[abs(axisExtent[1]-axisExtent[0]),0]
|
|
525
|
-
* for example: [0,0]-->[50,0]
|
|
526
|
-
*/
|
|
527
|
-
|
|
528
|
-
function layOutAxisTickLabel(cfg, local, shared, axisModel, group, transformGroup, api, kind) {
|
|
529
|
-
if (!axisLabelBuildResultExists(local)) buildAxisLabel(cfg, local, group, kind, axisModel, api);
|
|
530
|
-
var labelLayoutList = local.labelLayoutList;
|
|
531
|
-
updateAxisLabelChangableProps(cfg, axisModel, labelLayoutList, transformGroup);
|
|
532
|
-
adjustBreakLabels(axisModel, cfg.rotation, labelLayoutList);
|
|
533
|
-
var optionHideOverlap = cfg.optionHideOverlap;
|
|
534
|
-
fixMinMaxLabelShow(axisModel, labelLayoutList, optionHideOverlap);
|
|
535
|
-
if (optionHideOverlap) hideOverlap(filter(labelLayoutList, function (layout) {
|
|
536
|
-
return layout && !layout.label.ignore;
|
|
537
|
-
}));
|
|
538
|
-
resetOverlapRecordToShared(cfg, shared, axisModel, labelLayoutList);
|
|
539
|
-
}
|
|
540
|
-
function endTextLayout(rotation, textPosition, textRotate, extent) {
|
|
541
|
-
var rotationDiff = remRadian(textRotate - rotation);
|
|
542
|
-
var textAlign;
|
|
543
|
-
var textVerticalAlign;
|
|
544
|
-
var inverse = extent[0] > extent[1];
|
|
545
|
-
var onLeft = textPosition === "start" && !inverse || textPosition !== "start" && inverse;
|
|
546
|
-
if (isRadianAroundZero(rotationDiff - PI / 2)) {
|
|
547
|
-
textVerticalAlign = onLeft ? "bottom" : "top";
|
|
548
|
-
textAlign = "center";
|
|
549
|
-
} else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {
|
|
550
|
-
textVerticalAlign = onLeft ? "top" : "bottom";
|
|
551
|
-
textAlign = "center";
|
|
552
|
-
} else {
|
|
553
|
-
textVerticalAlign = "middle";
|
|
554
|
-
if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) textAlign = onLeft ? "left" : "right";else textAlign = onLeft ? "right" : "left";
|
|
555
|
-
}
|
|
556
|
-
return {
|
|
557
|
-
rotation: rotationDiff,
|
|
558
|
-
textAlign,
|
|
559
|
-
textVerticalAlign
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Assume `labelLayoutList` has no `label.ignore: true`.
|
|
564
|
-
* Assume `labelLayoutList` have been sorted by value ascending order.
|
|
565
|
-
*/
|
|
566
|
-
function fixMinMaxLabelShow(axisModel, labelLayoutList, optionHideOverlap) {
|
|
567
|
-
if (shouldShowAllLabels(axisModel.axis)) return;
|
|
568
|
-
function deal(showMinMaxLabel, outmostLabelIdx, innerLabelIdx) {
|
|
569
|
-
var outmostLabelLayout = ensureLabelLayoutWithGeometry(labelLayoutList[outmostLabelIdx]);
|
|
570
|
-
var innerLabelLayout = ensureLabelLayoutWithGeometry(labelLayoutList[innerLabelIdx]);
|
|
571
|
-
if (!outmostLabelLayout || !innerLabelLayout) return;
|
|
572
|
-
if (showMinMaxLabel === false || outmostLabelLayout.suggestIgnore) {
|
|
573
|
-
ignoreEl(outmostLabelLayout.label);
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
if (innerLabelLayout.suggestIgnore) {
|
|
577
|
-
ignoreEl(innerLabelLayout.label);
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
var touchThreshold = .1;
|
|
581
|
-
if (!optionHideOverlap) {
|
|
582
|
-
var marginForce = [0, 0, 0, 0];
|
|
583
|
-
outmostLabelLayout = newLabelLayoutWithGeometry({
|
|
584
|
-
marginForce
|
|
585
|
-
}, outmostLabelLayout);
|
|
586
|
-
innerLabelLayout = newLabelLayoutWithGeometry({
|
|
587
|
-
marginForce
|
|
588
|
-
}, innerLabelLayout);
|
|
589
|
-
}
|
|
590
|
-
if (labelIntersect(outmostLabelLayout, innerLabelLayout, null, {
|
|
591
|
-
touchThreshold
|
|
592
|
-
})) if (showMinMaxLabel) ignoreEl(innerLabelLayout.label);else ignoreEl(outmostLabelLayout.label);
|
|
593
|
-
}
|
|
594
|
-
var showMinLabel = axisModel.get(["axisLabel", "showMinLabel"]);
|
|
595
|
-
var showMaxLabel = axisModel.get(["axisLabel", "showMaxLabel"]);
|
|
596
|
-
var labelsLen = labelLayoutList.length;
|
|
597
|
-
deal(showMinLabel, 0, 1);
|
|
598
|
-
deal(showMaxLabel, labelsLen - 1, labelsLen - 2);
|
|
599
|
-
}
|
|
600
|
-
function syncLabelIgnoreToMajorTicks(cfg, labelLayoutList, tickEls) {
|
|
601
|
-
if (cfg.showMinorTicks) return;
|
|
602
|
-
each$1(labelLayoutList, function (labelLayout) {
|
|
603
|
-
if (labelLayout && labelLayout.label.ignore) for (var idx = 0; idx < tickEls.length; idx++) {
|
|
604
|
-
var tickEl = tickEls[idx];
|
|
605
|
-
var tickInner = getTickInner(tickEl);
|
|
606
|
-
var labelInner = getLabelInner(labelLayout.label);
|
|
607
|
-
if (tickInner.tickValue != null && !tickInner.onBand && tickInner.tickValue === labelInner.tickValue) {
|
|
608
|
-
ignoreEl(tickEl);
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
function ignoreEl(el) {
|
|
615
|
-
el && (el.ignore = true);
|
|
616
|
-
}
|
|
617
|
-
function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {
|
|
618
|
-
var tickEls = [];
|
|
619
|
-
var pt1 = [];
|
|
620
|
-
var pt2 = [];
|
|
621
|
-
for (var i = 0; i < ticksCoords.length; i++) {
|
|
622
|
-
var tickCoord = ticksCoords[i].coord;
|
|
623
|
-
pt1[0] = tickCoord;
|
|
624
|
-
pt1[1] = 0;
|
|
625
|
-
pt2[0] = tickCoord;
|
|
626
|
-
pt2[1] = tickEndCoord;
|
|
627
|
-
if (tickTransform) {
|
|
628
|
-
applyTransform(pt1, pt1, tickTransform);
|
|
629
|
-
applyTransform(pt2, pt2, tickTransform);
|
|
630
|
-
}
|
|
631
|
-
var tickEl = new Line$1({
|
|
632
|
-
shape: {
|
|
633
|
-
x1: pt1[0],
|
|
634
|
-
y1: pt1[1],
|
|
635
|
-
x2: pt2[0],
|
|
636
|
-
y2: pt2[1]
|
|
637
|
-
},
|
|
638
|
-
style: tickLineStyle,
|
|
639
|
-
z2: 2,
|
|
640
|
-
autoBatch: true,
|
|
641
|
-
silent: true
|
|
642
|
-
});
|
|
643
|
-
subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);
|
|
644
|
-
tickEl.anid = anidPrefix + "_" + ticksCoords[i].tickValue;
|
|
645
|
-
tickEls.push(tickEl);
|
|
646
|
-
var inner = getTickInner(tickEl);
|
|
647
|
-
inner.onBand = !!ticksCoords[i].onBand;
|
|
648
|
-
inner.tickValue = ticksCoords[i].tickValue;
|
|
649
|
-
}
|
|
650
|
-
return tickEls;
|
|
651
|
-
}
|
|
652
|
-
function buildAxisMajorTicks(cfg, group, transformGroup, axisModel) {
|
|
653
|
-
var axis = axisModel.axis;
|
|
654
|
-
var tickModel = axisModel.getModel("axisTick");
|
|
655
|
-
var shown = tickModel.get("show");
|
|
656
|
-
if (shown === "auto") {
|
|
657
|
-
shown = true;
|
|
658
|
-
if (cfg.raw.axisTickAutoShow != null) shown = !!cfg.raw.axisTickAutoShow;
|
|
659
|
-
}
|
|
660
|
-
if (!shown || axis.scale.isBlank()) return [];
|
|
661
|
-
var lineStyleModel = tickModel.getModel("lineStyle");
|
|
662
|
-
var tickEndCoord = cfg.tickDirection * tickModel.get("length");
|
|
663
|
-
var ticksEls = createTicks(axis.getTicksCoords(), transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {
|
|
664
|
-
stroke: axisModel.get(["axisLine", "lineStyle", "color"])
|
|
665
|
-
}), "ticks");
|
|
666
|
-
for (var i = 0; i < ticksEls.length; i++) group.add(ticksEls[i]);
|
|
667
|
-
return ticksEls;
|
|
668
|
-
}
|
|
669
|
-
function buildAxisMinorTicks(cfg, group, transformGroup, axisModel, tickDirection) {
|
|
670
|
-
var axis = axisModel.axis;
|
|
671
|
-
var minorTickModel = axisModel.getModel("minorTick");
|
|
672
|
-
if (!cfg.showMinorTicks || axis.scale.isBlank()) return;
|
|
673
|
-
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
674
|
-
if (!minorTicksCoords.length) return;
|
|
675
|
-
var lineStyleModel = minorTickModel.getModel("lineStyle");
|
|
676
|
-
var tickEndCoord = tickDirection * minorTickModel.get("length");
|
|
677
|
-
var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel("axisTick").getLineStyle(), {
|
|
678
|
-
stroke: axisModel.get(["axisLine", "lineStyle", "color"])
|
|
679
|
-
}));
|
|
680
|
-
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
681
|
-
var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, "minorticks_" + i);
|
|
682
|
-
for (var k = 0; k < minorTicksEls.length; k++) group.add(minorTicksEls[k]);
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
function dealLastTickLabelResultReusable(local, group, extraParams) {
|
|
686
|
-
if (axisLabelBuildResultExists(local)) {
|
|
687
|
-
var noPxChangeTryDetermine = local.axisLabelsCreationContext.out.noPxChangeTryDetermine;
|
|
688
|
-
if (extraParams.noPxChange) {
|
|
689
|
-
var canDetermine = true;
|
|
690
|
-
for (var idx = 0; idx < noPxChangeTryDetermine.length; idx++) canDetermine = canDetermine && noPxChangeTryDetermine[idx]();
|
|
691
|
-
if (canDetermine) return false;
|
|
692
|
-
}
|
|
693
|
-
if (noPxChangeTryDetermine.length) {
|
|
694
|
-
group.remove(local.labelGroup);
|
|
695
|
-
axisLabelBuildResultSet(local, null, null, null);
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
return true;
|
|
699
|
-
}
|
|
700
|
-
function buildAxisLabel(cfg, local, group, kind, axisModel, api) {
|
|
701
|
-
var axis = axisModel.axis;
|
|
702
|
-
var show = retrieve(cfg.raw.axisLabelShow, axisModel.get(["axisLabel", "show"]));
|
|
703
|
-
var labelGroup = new Group();
|
|
704
|
-
group.add(labelGroup);
|
|
705
|
-
var axisLabelCreationCtx = createAxisLabelsComputingContext(kind);
|
|
706
|
-
if (!show || axis.scale.isBlank()) {
|
|
707
|
-
axisLabelBuildResultSet(local, [], labelGroup, axisLabelCreationCtx);
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
var labelModel = axisModel.getModel("axisLabel");
|
|
711
|
-
var labels = axis.getViewLabels(axisLabelCreationCtx);
|
|
712
|
-
var labelRotation = (retrieve(cfg.raw.labelRotate, labelModel.get("rotate")) || 0) * PI / 180;
|
|
713
|
-
var labelLayout = AxisBuilder.innerTextLayout(cfg.rotation, labelRotation, cfg.labelDirection);
|
|
714
|
-
var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);
|
|
715
|
-
var labelEls = [];
|
|
716
|
-
var triggerEvent = axisModel.get("triggerEvent");
|
|
717
|
-
var z2Min = Infinity;
|
|
718
|
-
var z2Max = -Infinity;
|
|
719
|
-
each$1(labels, function (labelItem, index) {
|
|
720
|
-
var _a;
|
|
721
|
-
var tickValue = axis.scale.type === "ordinal" ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
|
|
722
|
-
var formattedLabel = labelItem.formattedLabel;
|
|
723
|
-
var rawLabel = labelItem.rawLabel;
|
|
724
|
-
var itemLabelModel = labelModel;
|
|
725
|
-
if (rawCategoryData && rawCategoryData[tickValue]) {
|
|
726
|
-
var rawCategoryItem = rawCategoryData[tickValue];
|
|
727
|
-
if (isObject$1(rawCategoryItem) && rawCategoryItem.textStyle) itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);
|
|
728
|
-
}
|
|
729
|
-
var textColor = itemLabelModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]);
|
|
730
|
-
var align = itemLabelModel.getShallow("align", true) || labelLayout.textAlign;
|
|
731
|
-
var alignMin = retrieve2(itemLabelModel.getShallow("alignMinLabel", true), align);
|
|
732
|
-
var alignMax = retrieve2(itemLabelModel.getShallow("alignMaxLabel", true), align);
|
|
733
|
-
var verticalAlign = itemLabelModel.getShallow("verticalAlign", true) || itemLabelModel.getShallow("baseline", true) || labelLayout.textVerticalAlign;
|
|
734
|
-
var verticalAlignMin = retrieve2(itemLabelModel.getShallow("verticalAlignMinLabel", true), verticalAlign);
|
|
735
|
-
var verticalAlignMax = retrieve2(itemLabelModel.getShallow("verticalAlignMaxLabel", true), verticalAlign);
|
|
736
|
-
var z2 = 10 + (((_a = labelItem.time) === null || _a === void 0 ? void 0 : _a.level) || 0);
|
|
737
|
-
z2Min = Math.min(z2Min, z2);
|
|
738
|
-
z2Max = Math.max(z2Max, z2);
|
|
739
|
-
var textEl = new ZRText({
|
|
740
|
-
x: 0,
|
|
741
|
-
y: 0,
|
|
742
|
-
rotation: 0,
|
|
743
|
-
silent: AxisBuilder.isLabelSilent(axisModel),
|
|
744
|
-
z2,
|
|
745
|
-
style: createTextStyle(itemLabelModel, {
|
|
746
|
-
text: formattedLabel,
|
|
747
|
-
align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align,
|
|
748
|
-
verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign,
|
|
749
|
-
fill: isFunction(textColor) ? textColor(axis.type === "category" ? rawLabel : axis.type === "value" ? tickValue + "" : tickValue, index) : textColor
|
|
750
|
-
})
|
|
751
|
-
});
|
|
752
|
-
textEl.anid = "label_" + tickValue;
|
|
753
|
-
var inner = getLabelInner(textEl);
|
|
754
|
-
inner["break"] = labelItem["break"];
|
|
755
|
-
inner.tickValue = tickValue;
|
|
756
|
-
inner.layoutRotation = labelLayout.rotation;
|
|
757
|
-
setTooltipConfig({
|
|
758
|
-
el: textEl,
|
|
759
|
-
componentModel: axisModel,
|
|
760
|
-
itemName: formattedLabel,
|
|
761
|
-
formatterParamsExtra: {
|
|
762
|
-
isTruncated: function () {
|
|
763
|
-
return textEl.isTruncated;
|
|
764
|
-
},
|
|
765
|
-
value: rawLabel,
|
|
766
|
-
tickIndex: index
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
if (triggerEvent) {
|
|
770
|
-
var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);
|
|
771
|
-
eventData.targetType = "axisLabel";
|
|
772
|
-
eventData.value = rawLabel;
|
|
773
|
-
eventData.tickIndex = index;
|
|
774
|
-
if (labelItem["break"]) eventData["break"] = {
|
|
775
|
-
start: labelItem["break"].parsedBreak.vmin,
|
|
776
|
-
end: labelItem["break"].parsedBreak.vmax
|
|
777
|
-
};
|
|
778
|
-
if (axis.type === "category") eventData.dataIndex = tickValue;
|
|
779
|
-
getECData(textEl).eventData = eventData;
|
|
780
|
-
if (labelItem["break"]) addBreakEventHandler(axisModel, api, textEl, labelItem["break"]);
|
|
781
|
-
}
|
|
782
|
-
labelEls.push(textEl);
|
|
783
|
-
labelGroup.add(textEl);
|
|
784
|
-
});
|
|
785
|
-
axisLabelBuildResultSet(local, map(labelEls, function (label) {
|
|
786
|
-
return {
|
|
787
|
-
label,
|
|
788
|
-
priority: getLabelInner(label)["break"] ? label.z2 + (z2Max - z2Min + 1) : label.z2,
|
|
789
|
-
defaultAttr: {
|
|
790
|
-
ignore: label.ignore
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
}), labelGroup, axisLabelCreationCtx);
|
|
794
|
-
}
|
|
795
|
-
function axisLabelBuildResultExists(local) {
|
|
796
|
-
return !!local.labelLayoutList;
|
|
797
|
-
}
|
|
798
|
-
function axisLabelBuildResultSet(local, labelLayoutList, labelGroup, axisLabelsCreationContext) {
|
|
799
|
-
local.labelLayoutList = labelLayoutList;
|
|
800
|
-
local.labelGroup = labelGroup;
|
|
801
|
-
local.axisLabelsCreationContext = axisLabelsCreationContext;
|
|
802
|
-
}
|
|
803
|
-
function updateAxisLabelChangableProps(cfg, axisModel, labelLayoutList, transformGroup) {
|
|
804
|
-
var labelMargin = axisModel.get(["axisLabel", "margin"]);
|
|
805
|
-
each$1(labelLayoutList, function (layout, idx) {
|
|
806
|
-
var geometry = ensureLabelLayoutWithGeometry(layout);
|
|
807
|
-
if (!geometry) return;
|
|
808
|
-
var labelEl = geometry.label;
|
|
809
|
-
var inner = getLabelInner(labelEl);
|
|
810
|
-
geometry.suggestIgnore = labelEl.ignore;
|
|
811
|
-
labelEl.ignore = false;
|
|
812
|
-
copyTransform(_tmpLayoutEl, _tmpLayoutElReset);
|
|
813
|
-
_tmpLayoutEl.x = axisModel.axis.dataToCoord(inner.tickValue);
|
|
814
|
-
_tmpLayoutEl.y = cfg.labelOffset + cfg.labelDirection * labelMargin;
|
|
815
|
-
_tmpLayoutEl.rotation = inner.layoutRotation;
|
|
816
|
-
transformGroup.add(_tmpLayoutEl);
|
|
817
|
-
_tmpLayoutEl.updateTransform();
|
|
818
|
-
transformGroup.remove(_tmpLayoutEl);
|
|
819
|
-
_tmpLayoutEl.decomposeTransform();
|
|
820
|
-
copyTransform(labelEl, _tmpLayoutEl);
|
|
821
|
-
labelEl.markRedraw();
|
|
822
|
-
setLabelLayoutDirty(geometry, true);
|
|
823
|
-
ensureLabelLayoutWithGeometry(geometry);
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
function hasAxisName(axisName) {
|
|
827
|
-
return !!axisName;
|
|
828
|
-
}
|
|
829
|
-
function addBreakEventHandler(axisModel, api, textEl, visualBreak) {
|
|
830
|
-
textEl.on("click", function (params) {
|
|
831
|
-
var payload = {
|
|
832
|
-
type: AXIS_BREAK_EXPAND_ACTION_TYPE,
|
|
833
|
-
breaks: [{
|
|
834
|
-
start: visualBreak.parsedBreak.breakOption.start,
|
|
835
|
-
end: visualBreak.parsedBreak.breakOption.end
|
|
836
|
-
}]
|
|
837
|
-
};
|
|
838
|
-
payload[axisModel.axis.dim + "AxisIndex"] = axisModel.componentIndex;
|
|
839
|
-
api.dispatchAction(payload);
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
function adjustBreakLabels(axisModel, axisRotation, labelLayoutList) {
|
|
843
|
-
var scaleBreakHelper = getScaleBreakHelper();
|
|
844
|
-
if (!scaleBreakHelper) return;
|
|
845
|
-
var breakLabelIndexPairs = scaleBreakHelper.retrieveAxisBreakPairs(labelLayoutList, function (layoutInfo) {
|
|
846
|
-
return layoutInfo && getLabelInner(layoutInfo.label)["break"];
|
|
847
|
-
}, true);
|
|
848
|
-
var moveOverlap = axisModel.get(["breakLabelLayout", "moveOverlap"], true);
|
|
849
|
-
if (moveOverlap === true || moveOverlap === "auto") each$1(breakLabelIndexPairs, function (idxPair) {
|
|
850
|
-
getAxisBreakHelper().adjustBreakLabelPair(axisModel.axis.inverse, axisRotation, [ensureLabelLayoutWithGeometry(labelLayoutList[idxPair[0]]), ensureLabelLayoutWithGeometry(labelLayoutList[idxPair[1]])]);
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
//#endregion
|
|
855
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js
|
|
856
|
-
/**
|
|
857
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
858
|
-
*/
|
|
859
|
-
/**
|
|
860
|
-
* [__CAUTION__]
|
|
861
|
-
* MUST guarantee: if only the input `rect` and `axis.extent` changed,
|
|
862
|
-
* only `layout.position` changes.
|
|
863
|
-
* This character is replied on `grid.contain` calculation in `AxisBuilder`.
|
|
864
|
-
* @see updateCartesianAxisViewCommonPartBuilder
|
|
865
|
-
*
|
|
866
|
-
* Can only be called after coordinate system creation stage.
|
|
867
|
-
* (Can be called before coordinate system update stage).
|
|
868
|
-
*/
|
|
869
|
-
function layout(rect, axisModel, opt) {
|
|
870
|
-
opt = opt || {};
|
|
871
|
-
var axis = axisModel.axis;
|
|
872
|
-
var layout = {};
|
|
873
|
-
var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];
|
|
874
|
-
var rawAxisPosition = axis.position;
|
|
875
|
-
var axisPosition = otherAxisOnZeroOf ? "onZero" : rawAxisPosition;
|
|
876
|
-
var axisDim = axis.dim;
|
|
877
|
-
var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
|
|
878
|
-
var idx = {
|
|
879
|
-
left: 0,
|
|
880
|
-
right: 1,
|
|
881
|
-
top: 0,
|
|
882
|
-
bottom: 1,
|
|
883
|
-
onZero: 2
|
|
884
|
-
};
|
|
885
|
-
var axisOffset = axisModel.get("offset") || 0;
|
|
886
|
-
var posBound = axisDim === "x" ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
|
|
887
|
-
if (otherAxisOnZeroOf) {
|
|
888
|
-
var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));
|
|
889
|
-
posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
|
|
890
|
-
}
|
|
891
|
-
layout.position = [axisDim === "y" ? posBound[idx[axisPosition]] : rectBound[0], axisDim === "x" ? posBound[idx[axisPosition]] : rectBound[3]];
|
|
892
|
-
layout.rotation = Math.PI / 2 * (axisDim === "x" ? 0 : 1);
|
|
893
|
-
layout.labelDirection = layout.tickDirection = layout.nameDirection = {
|
|
894
|
-
top: -1,
|
|
895
|
-
bottom: 1,
|
|
896
|
-
left: -1,
|
|
897
|
-
right: 1
|
|
898
|
-
}[rawAxisPosition];
|
|
899
|
-
layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;
|
|
900
|
-
if (axisModel.get(["axisTick", "inside"])) layout.tickDirection = -layout.tickDirection;
|
|
901
|
-
if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) layout.labelDirection = -layout.labelDirection;
|
|
902
|
-
var labelRotate = axisModel.get(["axisLabel", "rotate"]);
|
|
903
|
-
layout.labelRotate = axisPosition === "top" ? -labelRotate : labelRotate;
|
|
904
|
-
layout.z2 = 1;
|
|
905
|
-
return layout;
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* Note: If pie (or other similar series) use cartesian2d, here
|
|
909
|
-
* option `seriesModel.get('coordinateSystem') === 'cartesian2d'`
|
|
910
|
-
* and `seriesModel.coordinateSystem !== cartesian2dCoordSysInstance`
|
|
911
|
-
* and `seriesModel.boxCoordinateSystem === cartesian2dCoordSysInstance`,
|
|
912
|
-
* the logic below is probably wrong, therefore skip it temporarily.
|
|
913
|
-
*/
|
|
914
|
-
function isCartesian2DInjectedAsDataCoordSys(seriesModel) {
|
|
915
|
-
return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "cartesian2d";
|
|
916
|
-
}
|
|
917
|
-
function findAxisModels(seriesModel) {
|
|
918
|
-
var axisModelMap = {
|
|
919
|
-
xAxisModel: null,
|
|
920
|
-
yAxisModel: null
|
|
921
|
-
};
|
|
922
|
-
each$1(axisModelMap, function (v, key) {
|
|
923
|
-
var axisType = key.replace(/Model$/, "");
|
|
924
|
-
axisModelMap[key] = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
|
|
925
|
-
});
|
|
926
|
-
return axisModelMap;
|
|
927
|
-
}
|
|
928
|
-
function createCartesianAxisViewCommonPartBuilder(gridRect, cartesians, axisModel, api, ctx, defaultNameMoveOverlap) {
|
|
929
|
-
var layoutResult = layout(gridRect, axisModel);
|
|
930
|
-
var axisLineAutoShow = false;
|
|
931
|
-
var axisTickAutoShow = false;
|
|
932
|
-
for (var i = 0; i < cartesians.length; i++) if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {
|
|
933
|
-
axisLineAutoShow = axisTickAutoShow = true;
|
|
934
|
-
if (axisModel.axis.type === "category" && axisModel.axis.onBand) axisTickAutoShow = false;
|
|
935
|
-
}
|
|
936
|
-
layoutResult.axisLineAutoShow = axisLineAutoShow;
|
|
937
|
-
layoutResult.axisTickAutoShow = axisTickAutoShow;
|
|
938
|
-
layoutResult.defaultNameMoveOverlap = defaultNameMoveOverlap;
|
|
939
|
-
return new AxisBuilder(axisModel, api, layoutResult, ctx);
|
|
940
|
-
}
|
|
941
|
-
function updateCartesianAxisViewCommonPartBuilder(axisBuilder, gridRect, axisModel) {
|
|
942
|
-
var newRaw = layout(gridRect, axisModel);
|
|
943
|
-
axisBuilder.updateCfg(newRaw);
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
//#endregion
|
|
947
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/axisAlignTicks.js
|
|
948
|
-
/**
|
|
949
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
950
|
-
*/
|
|
951
|
-
function alignScaleTicks(scale, axisModel, alignToScale) {
|
|
952
|
-
var intervalScaleProto = IntervalScale.prototype;
|
|
953
|
-
var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);
|
|
954
|
-
var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, {
|
|
955
|
-
expandToNicedExtent: true
|
|
956
|
-
});
|
|
957
|
-
var alignToSplitNumber = alignToTicks.length - 1;
|
|
958
|
-
var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);
|
|
959
|
-
var scaleExtent = getScaleExtent(scale, axisModel);
|
|
960
|
-
var rawExtent = scaleExtent.extent;
|
|
961
|
-
var isMinFixed = scaleExtent.fixMin;
|
|
962
|
-
var isMaxFixed = scaleExtent.fixMax;
|
|
963
|
-
if (scale.type === "log") rawExtent = logTransform(scale.base, rawExtent, true);
|
|
964
|
-
scale.setBreaksFromOption(retrieveAxisBreaksOption(axisModel));
|
|
965
|
-
scale.setExtent(rawExtent[0], rawExtent[1]);
|
|
966
|
-
scale.calcNiceExtent({
|
|
967
|
-
splitNumber: alignToSplitNumber,
|
|
968
|
-
fixMin: isMinFixed,
|
|
969
|
-
fixMax: isMaxFixed
|
|
970
|
-
});
|
|
971
|
-
var extent = intervalScaleProto.getExtent.call(scale);
|
|
972
|
-
if (isMinFixed) rawExtent[0] = extent[0];
|
|
973
|
-
if (isMaxFixed) rawExtent[1] = extent[1];
|
|
974
|
-
var interval = intervalScaleProto.getInterval.call(scale);
|
|
975
|
-
var min = rawExtent[0];
|
|
976
|
-
var max = rawExtent[1];
|
|
977
|
-
if (isMinFixed && isMaxFixed) interval = (max - min) / alignToSplitNumber;else if (isMinFixed) {
|
|
978
|
-
max = rawExtent[0] + interval * alignToSplitNumber;
|
|
979
|
-
while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {
|
|
980
|
-
interval = increaseInterval(interval);
|
|
981
|
-
max = rawExtent[0] + interval * alignToSplitNumber;
|
|
982
|
-
}
|
|
983
|
-
} else if (isMaxFixed) {
|
|
984
|
-
min = rawExtent[1] - interval * alignToSplitNumber;
|
|
985
|
-
while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {
|
|
986
|
-
interval = increaseInterval(interval);
|
|
987
|
-
min = rawExtent[1] - interval * alignToSplitNumber;
|
|
988
|
-
}
|
|
989
|
-
} else {
|
|
990
|
-
if (scale.getTicks().length - 1 > alignToSplitNumber) interval = increaseInterval(interval);
|
|
991
|
-
var range = interval * alignToSplitNumber;
|
|
992
|
-
max = Math.ceil(rawExtent[1] / interval) * interval;
|
|
993
|
-
min = round(max - range);
|
|
994
|
-
if (min < 0 && rawExtent[0] >= 0) {
|
|
995
|
-
min = 0;
|
|
996
|
-
max = round(range);
|
|
997
|
-
} else if (max > 0 && rawExtent[1] <= 0) {
|
|
998
|
-
max = 0;
|
|
999
|
-
min = -round(range);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;
|
|
1003
|
-
var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;
|
|
1004
|
-
intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);
|
|
1005
|
-
intervalScaleProto.setInterval.call(scale, interval);
|
|
1006
|
-
if (t0 || t1) intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
//#endregion
|
|
1010
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/cartesian/Grid.js
|
|
1011
|
-
/**
|
|
1012
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1013
|
-
*/
|
|
1014
|
-
/**
|
|
1015
|
-
* Grid is a region which contains at most 4 cartesian systems
|
|
1016
|
-
*
|
|
1017
|
-
* TODO Default cartesian
|
|
1018
|
-
*/
|
|
1019
|
-
|
|
1020
|
-
/**
|
|
1021
|
-
* Check if the axis is used in the specified grid.
|
|
1022
|
-
*/
|
|
1023
|
-
function isAxisUsedInTheGrid(axisModel, gridModel) {
|
|
1024
|
-
return axisModel.getCoordSysModel() === gridModel;
|
|
1025
|
-
}
|
|
1026
|
-
function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {
|
|
1027
|
-
axis.getAxesOnZeroOf = function () {
|
|
1028
|
-
return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];
|
|
1029
|
-
};
|
|
1030
|
-
var otherAxes = axesMap[otherAxisDim];
|
|
1031
|
-
var otherAxisOnZeroOf;
|
|
1032
|
-
var axisModel = axis.model;
|
|
1033
|
-
var onZero = axisModel.get(["axisLine", "onZero"]);
|
|
1034
|
-
var onZeroAxisIndex = axisModel.get(["axisLine", "onZeroAxisIndex"]);
|
|
1035
|
-
if (!onZero) return;
|
|
1036
|
-
if (onZeroAxisIndex != null) {
|
|
1037
|
-
if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];
|
|
1038
|
-
} else for (var idx in otherAxes) if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {
|
|
1039
|
-
otherAxisOnZeroOf = otherAxes[idx];
|
|
1040
|
-
break;
|
|
1041
|
-
}
|
|
1042
|
-
if (otherAxisOnZeroOf) onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;
|
|
1043
|
-
function getOnZeroRecordKey(axis) {
|
|
1044
|
-
return axis.dim + "_" + axis.index;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
function canOnZeroToAxis(axis) {
|
|
1048
|
-
return axis && axis.type !== "category" && axis.type !== "time" && ifAxisCrossZero(axis);
|
|
1049
|
-
}
|
|
1050
|
-
function updateAxisTransform(axis, coordBase) {
|
|
1051
|
-
var axisExtent = axis.getExtent();
|
|
1052
|
-
var axisExtentSum = axisExtent[0] + axisExtent[1];
|
|
1053
|
-
axis.toGlobalCoord = axis.dim === "x" ? function (coord) {
|
|
1054
|
-
return coord + coordBase;
|
|
1055
|
-
} : function (coord) {
|
|
1056
|
-
return axisExtentSum - coord + coordBase;
|
|
1057
|
-
};
|
|
1058
|
-
axis.toLocalCoord = axis.dim === "x" ? function (coord) {
|
|
1059
|
-
return coord - coordBase;
|
|
1060
|
-
} : function (coord) {
|
|
1061
|
-
return axisExtentSum - coord + coordBase;
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
function updateAllAxisExtentTransByGridRect(axesMap, gridRect) {
|
|
1065
|
-
each$1(axesMap.x, function (axis) {
|
|
1066
|
-
return updateAxisExtentTransByGridRect(axis, gridRect.x, gridRect.width);
|
|
1067
|
-
});
|
|
1068
|
-
each$1(axesMap.y, function (axis) {
|
|
1069
|
-
return updateAxisExtentTransByGridRect(axis, gridRect.y, gridRect.height);
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
function updateAxisExtentTransByGridRect(axis, gridXY, gridWH) {
|
|
1073
|
-
var extent = [0, gridWH];
|
|
1074
|
-
var idx = axis.inverse ? 1 : 0;
|
|
1075
|
-
axis.setExtent(extent[idx], extent[1 - idx]);
|
|
1076
|
-
updateAxisTransform(axis, gridXY);
|
|
1077
|
-
}
|
|
1078
|
-
function layOutGridByOuterBounds(outerBoundsRect, outerBoundsContain, outerBoundsClamp, gridRect, axesMap, axisBuilderSharedCtx, layoutRef) {
|
|
1079
|
-
createOrUpdateAxesView(gridRect, axesMap, AxisTickLabelComputingKind.estimate, outerBoundsContain, false, layoutRef);
|
|
1080
|
-
var margin = [0, 0, 0, 0];
|
|
1081
|
-
fillLabelNameOverflowOnOneDimension(0);
|
|
1082
|
-
fillLabelNameOverflowOnOneDimension(1);
|
|
1083
|
-
fillMarginOnOneDimension(gridRect, 0, NaN);
|
|
1084
|
-
fillMarginOnOneDimension(gridRect, 1, NaN);
|
|
1085
|
-
var noPxChange = find(margin, function (item) {
|
|
1086
|
-
return item > 0;
|
|
1087
|
-
}) == null;
|
|
1088
|
-
expandOrShrinkRect(gridRect, margin, true, true, outerBoundsClamp);
|
|
1089
|
-
updateAllAxisExtentTransByGridRect(axesMap, gridRect);
|
|
1090
|
-
return noPxChange;
|
|
1091
|
-
function fillLabelNameOverflowOnOneDimension(xyIdx) {
|
|
1092
|
-
each$1(axesMap[XY[xyIdx]], function (axis) {
|
|
1093
|
-
if (!shouldAxisShow(axis.model)) return;
|
|
1094
|
-
var sharedRecord = axisBuilderSharedCtx.ensureRecord(axis.model);
|
|
1095
|
-
var labelInfoList = sharedRecord.labelInfoList;
|
|
1096
|
-
if (labelInfoList) for (var idx = 0; idx < labelInfoList.length; idx++) {
|
|
1097
|
-
var labelInfo = labelInfoList[idx];
|
|
1098
|
-
var proportion = axis.scale.normalize(getLabelInner(labelInfo.label).tickValue);
|
|
1099
|
-
proportion = xyIdx === 1 ? 1 - proportion : proportion;
|
|
1100
|
-
fillMarginOnOneDimension(labelInfo.rect, xyIdx, proportion);
|
|
1101
|
-
fillMarginOnOneDimension(labelInfo.rect, 1 - xyIdx, NaN);
|
|
1102
|
-
}
|
|
1103
|
-
var nameLayout = sharedRecord.nameLayout;
|
|
1104
|
-
if (nameLayout) {
|
|
1105
|
-
var proportion = isNameLocationCenter(sharedRecord.nameLocation) ? .5 : NaN;
|
|
1106
|
-
fillMarginOnOneDimension(nameLayout.rect, xyIdx, proportion);
|
|
1107
|
-
fillMarginOnOneDimension(nameLayout.rect, 1 - xyIdx, NaN);
|
|
1108
|
-
}
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
function fillMarginOnOneDimension(itemRect, xyIdx, proportion) {
|
|
1112
|
-
var overflow1 = outerBoundsRect[XY[xyIdx]] - itemRect[XY[xyIdx]];
|
|
1113
|
-
var overflow2 = itemRect[WH[xyIdx]] + itemRect[XY[xyIdx]] - (outerBoundsRect[WH[xyIdx]] + outerBoundsRect[XY[xyIdx]]);
|
|
1114
|
-
overflow1 = applyProportion(overflow1, 1 - proportion);
|
|
1115
|
-
overflow2 = applyProportion(overflow2, proportion);
|
|
1116
|
-
var minIdx = XY_TO_MARGIN_IDX[xyIdx][0];
|
|
1117
|
-
var maxIdx = XY_TO_MARGIN_IDX[xyIdx][1];
|
|
1118
|
-
margin[minIdx] = mathMax$1(margin[minIdx], overflow1);
|
|
1119
|
-
margin[maxIdx] = mathMax$1(margin[maxIdx], overflow2);
|
|
1120
|
-
}
|
|
1121
|
-
function applyProportion(overflow, proportion) {
|
|
1122
|
-
if (overflow > 0 && !eqNaN(proportion) && proportion > 1e-4) overflow /= proportion;
|
|
1123
|
-
return overflow;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
function createAxisBiulders(gridRect, cartesians, axesMap, optionContainLabel, api) {
|
|
1127
|
-
var axisBuilderSharedCtx = new AxisBuilderSharedContext(resolveAxisNameOverlapForGrid);
|
|
1128
|
-
each$1(axesMap, function (axisList) {
|
|
1129
|
-
return each$1(axisList, function (axis) {
|
|
1130
|
-
if (shouldAxisShow(axis.model)) {
|
|
1131
|
-
var defaultNameMoveOverlap = !optionContainLabel;
|
|
1132
|
-
axis.axisBuilder = createCartesianAxisViewCommonPartBuilder(gridRect, cartesians, axis.model, api, axisBuilderSharedCtx, defaultNameMoveOverlap);
|
|
1133
|
-
}
|
|
1134
|
-
});
|
|
1135
|
-
});
|
|
1136
|
-
return axisBuilderSharedCtx;
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Promote the axis-elements-building from "view render" stage to "coordinate system resize" stage.
|
|
1140
|
-
* This is aimed to resovle overlap across multiple axes, since currently it's hard to reconcile
|
|
1141
|
-
* multiple axes in "view render" stage.
|
|
1142
|
-
*
|
|
1143
|
-
* [CAUTION] But this promotion assumes that the subsequent "visual mapping" stage does not affect
|
|
1144
|
-
* this axis-elements-building; otherwise we have to refactor it again.
|
|
1145
|
-
*/
|
|
1146
|
-
function createOrUpdateAxesView(gridRect, axesMap, kind, outerBoundsContain, noPxChange, layoutRef) {
|
|
1147
|
-
var isDetermine = kind === AxisTickLabelComputingKind.determine;
|
|
1148
|
-
each$1(axesMap, function (axisList) {
|
|
1149
|
-
return each$1(axisList, function (axis) {
|
|
1150
|
-
if (shouldAxisShow(axis.model)) {
|
|
1151
|
-
updateCartesianAxisViewCommonPartBuilder(axis.axisBuilder, gridRect, axis.model);
|
|
1152
|
-
axis.axisBuilder.build(isDetermine ? {
|
|
1153
|
-
axisTickLabelDetermine: true
|
|
1154
|
-
} : {
|
|
1155
|
-
axisTickLabelEstimate: true
|
|
1156
|
-
}, {
|
|
1157
|
-
noPxChange
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
});
|
|
1162
|
-
var nameMarginLevelMap = {
|
|
1163
|
-
x: 0,
|
|
1164
|
-
y: 0
|
|
1165
|
-
};
|
|
1166
|
-
calcNameMarginLevel(0);
|
|
1167
|
-
calcNameMarginLevel(1);
|
|
1168
|
-
function calcNameMarginLevel(xyIdx) {
|
|
1169
|
-
nameMarginLevelMap[XY[1 - xyIdx]] = gridRect[WH[xyIdx]] <= layoutRef.refContainer[WH[xyIdx]] * .5 ? 0 : 1 - xyIdx === 1 ? 2 : 1;
|
|
1170
|
-
}
|
|
1171
|
-
each$1(axesMap, function (axisList, xy) {
|
|
1172
|
-
return each$1(axisList, function (axis) {
|
|
1173
|
-
if (shouldAxisShow(axis.model)) {
|
|
1174
|
-
if (outerBoundsContain === "all" || isDetermine) axis.axisBuilder.build({
|
|
1175
|
-
axisName: true
|
|
1176
|
-
}, {
|
|
1177
|
-
nameMarginLevel: nameMarginLevelMap[xy]
|
|
1178
|
-
});
|
|
1179
|
-
if (isDetermine) axis.axisBuilder.build({
|
|
1180
|
-
axisLine: true
|
|
1181
|
-
});
|
|
1182
|
-
}
|
|
1183
|
-
});
|
|
1184
|
-
});
|
|
1185
|
-
}
|
|
1186
|
-
function prepareOuterBounds(gridModel, rawRridRect, layoutRef) {
|
|
1187
|
-
var outerBoundsRect;
|
|
1188
|
-
var optionOuterBoundsMode = gridModel.get("outerBoundsMode", true);
|
|
1189
|
-
if (optionOuterBoundsMode === "same") outerBoundsRect = rawRridRect.clone();else if (optionOuterBoundsMode == null || optionOuterBoundsMode === "auto") outerBoundsRect = getLayoutRect(gridModel.get("outerBounds", true) || OUTER_BOUNDS_DEFAULT, layoutRef.refContainer);else if (optionOuterBoundsMode !== "none") {}
|
|
1190
|
-
var optionOuterBoundsContain = gridModel.get("outerBoundsContain", true);
|
|
1191
|
-
var parsedOuterBoundsContain;
|
|
1192
|
-
if (optionOuterBoundsContain == null || optionOuterBoundsContain === "auto") parsedOuterBoundsContain = "all";else if (indexOf(["all", "axisLabel"], optionOuterBoundsContain) < 0) parsedOuterBoundsContain = "all";else parsedOuterBoundsContain = optionOuterBoundsContain;
|
|
1193
|
-
var outerBoundsClamp = [parsePositionSizeOption(retrieve2(gridModel.get("outerBoundsClampWidth", true), OUTER_BOUNDS_CLAMP_DEFAULT[0]), rawRridRect.width), parsePositionSizeOption(retrieve2(gridModel.get("outerBoundsClampHeight", true), OUTER_BOUNDS_CLAMP_DEFAULT[1]), rawRridRect.height)];
|
|
1194
|
-
return {
|
|
1195
|
-
outerBoundsRect,
|
|
1196
|
-
parsedOuterBoundsContain,
|
|
1197
|
-
outerBoundsClamp
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
//#endregion
|
|
1201
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/axisPointer/modelHelper.js
|
|
1202
|
-
/**
|
|
1203
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1204
|
-
*/
|
|
1205
|
-
function collect(ecModel, api) {
|
|
1206
|
-
var result = {
|
|
1207
|
-
axesInfo: {},
|
|
1208
|
-
seriesInvolved: false,
|
|
1209
|
-
coordSysAxesInfo: {},
|
|
1210
|
-
coordSysMap: {}
|
|
1211
|
-
};
|
|
1212
|
-
collectAxesInfo(result, ecModel, api);
|
|
1213
|
-
result.seriesInvolved && collectSeriesInfo(result, ecModel);
|
|
1214
|
-
return result;
|
|
1215
|
-
}
|
|
1216
|
-
function collectAxesInfo(result, ecModel, api) {
|
|
1217
|
-
var globalTooltipModel = ecModel.getComponent("tooltip");
|
|
1218
|
-
var globalAxisPointerModel = ecModel.getComponent("axisPointer");
|
|
1219
|
-
var linksOption = globalAxisPointerModel.get("link", true) || [];
|
|
1220
|
-
var linkGroups = [];
|
|
1221
|
-
each$1(api.getCoordinateSystems(), function (coordSys) {
|
|
1222
|
-
if (!coordSys.axisPointerEnabled) return;
|
|
1223
|
-
var coordSysKey = makeKey(coordSys.model);
|
|
1224
|
-
var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};
|
|
1225
|
-
result.coordSysMap[coordSysKey] = coordSys;
|
|
1226
|
-
var baseTooltipModel = coordSys.model.getModel("tooltip", globalTooltipModel);
|
|
1227
|
-
each$1(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));
|
|
1228
|
-
if (coordSys.getTooltipAxes && globalTooltipModel && baseTooltipModel.get("show")) {
|
|
1229
|
-
var triggerAxis = baseTooltipModel.get("trigger") === "axis";
|
|
1230
|
-
var cross = baseTooltipModel.get(["axisPointer", "type"]) === "cross";
|
|
1231
|
-
var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(["axisPointer", "axis"]));
|
|
1232
|
-
if (triggerAxis || cross) each$1(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? "cross" : true, triggerAxis));
|
|
1233
|
-
if (cross) each$1(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, "cross", false));
|
|
1234
|
-
}
|
|
1235
|
-
function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {
|
|
1236
|
-
var axisPointerModel = axis.model.getModel("axisPointer", globalAxisPointerModel);
|
|
1237
|
-
var axisPointerShow = axisPointerModel.get("show");
|
|
1238
|
-
if (!axisPointerShow || axisPointerShow === "auto" && !fromTooltip && !isHandleTrigger(axisPointerModel)) return;
|
|
1239
|
-
if (triggerTooltip == null) triggerTooltip = axisPointerModel.get("triggerTooltip");
|
|
1240
|
-
axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;
|
|
1241
|
-
var snap = axisPointerModel.get("snap");
|
|
1242
|
-
var triggerEmphasis = axisPointerModel.get("triggerEmphasis");
|
|
1243
|
-
var axisKey = makeKey(axis.model);
|
|
1244
|
-
var involveSeries = triggerTooltip || snap || axis.type === "category";
|
|
1245
|
-
var axisInfo = result.axesInfo[axisKey] = {
|
|
1246
|
-
key: axisKey,
|
|
1247
|
-
axis,
|
|
1248
|
-
coordSys,
|
|
1249
|
-
axisPointerModel,
|
|
1250
|
-
triggerTooltip,
|
|
1251
|
-
triggerEmphasis,
|
|
1252
|
-
involveSeries,
|
|
1253
|
-
snap,
|
|
1254
|
-
useHandle: isHandleTrigger(axisPointerModel),
|
|
1255
|
-
seriesModels: [],
|
|
1256
|
-
linkGroup: null
|
|
1257
|
-
};
|
|
1258
|
-
axesInfoInCoordSys[axisKey] = axisInfo;
|
|
1259
|
-
result.seriesInvolved = result.seriesInvolved || involveSeries;
|
|
1260
|
-
var groupIndex = getLinkGroupIndex(linksOption, axis);
|
|
1261
|
-
if (groupIndex != null) {
|
|
1262
|
-
var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {
|
|
1263
|
-
axesInfo: {}
|
|
1264
|
-
});
|
|
1265
|
-
linkGroup.axesInfo[axisKey] = axisInfo;
|
|
1266
|
-
linkGroup.mapper = linksOption[groupIndex].mapper;
|
|
1267
|
-
axisInfo.linkGroup = linkGroup;
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
});
|
|
1271
|
-
}
|
|
1272
|
-
function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {
|
|
1273
|
-
var tooltipAxisPointerModel = baseTooltipModel.getModel("axisPointer");
|
|
1274
|
-
var fields = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"];
|
|
1275
|
-
var volatileOption = {};
|
|
1276
|
-
each$1(fields, function (field) {
|
|
1277
|
-
volatileOption[field] = clone(tooltipAxisPointerModel.get(field));
|
|
1278
|
-
});
|
|
1279
|
-
volatileOption.snap = axis.type !== "category" && !!triggerTooltip;
|
|
1280
|
-
if (tooltipAxisPointerModel.get("type") === "cross") volatileOption.type = "line";
|
|
1281
|
-
var labelOption = volatileOption.label || (volatileOption.label = {});
|
|
1282
|
-
labelOption.show ??= false;
|
|
1283
|
-
if (fromTooltip === "cross") {
|
|
1284
|
-
var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(["label", "show"]);
|
|
1285
|
-
labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;
|
|
1286
|
-
if (!triggerTooltip) {
|
|
1287
|
-
var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get("crossStyle");
|
|
1288
|
-
crossStyle && defaults(labelOption, crossStyle.textStyle);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
return axis.model.getModel("axisPointer", new Model(volatileOption, globalAxisPointerModel, ecModel));
|
|
1292
|
-
}
|
|
1293
|
-
function collectSeriesInfo(result, ecModel) {
|
|
1294
|
-
ecModel.eachSeries(function (seriesModel) {
|
|
1295
|
-
var coordSys = seriesModel.coordinateSystem;
|
|
1296
|
-
var seriesTooltipTrigger = seriesModel.get(["tooltip", "trigger"], true);
|
|
1297
|
-
var seriesTooltipShow = seriesModel.get(["tooltip", "show"], true);
|
|
1298
|
-
if (!coordSys || !coordSys.model || seriesTooltipTrigger === "none" || seriesTooltipTrigger === false || seriesTooltipTrigger === "item" || seriesTooltipShow === false || seriesModel.get(["axisPointer", "show"], true) === false) return;
|
|
1299
|
-
each$1(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {
|
|
1300
|
-
var axis = axisInfo.axis;
|
|
1301
|
-
if (coordSys.getAxis(axis.dim) === axis) {
|
|
1302
|
-
axisInfo.seriesModels.push(seriesModel);
|
|
1303
|
-
axisInfo.seriesDataCount ??= 0;
|
|
1304
|
-
axisInfo.seriesDataCount += seriesModel.getData().count();
|
|
1305
|
-
}
|
|
1306
|
-
});
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
|
-
/**
|
|
1310
|
-
* For example:
|
|
1311
|
-
* {
|
|
1312
|
-
* axisPointer: {
|
|
1313
|
-
* links: [{
|
|
1314
|
-
* xAxisIndex: [2, 4],
|
|
1315
|
-
* yAxisIndex: 'all'
|
|
1316
|
-
* }, {
|
|
1317
|
-
* xAxisId: ['a5', 'a7'],
|
|
1318
|
-
* xAxisName: 'xxx'
|
|
1319
|
-
* }]
|
|
1320
|
-
* }
|
|
1321
|
-
* }
|
|
1322
|
-
*/
|
|
1323
|
-
function getLinkGroupIndex(linksOption, axis) {
|
|
1324
|
-
var axisModel = axis.model;
|
|
1325
|
-
var dim = axis.dim;
|
|
1326
|
-
for (var i = 0; i < linksOption.length; i++) {
|
|
1327
|
-
var linkOption = linksOption[i] || {};
|
|
1328
|
-
if (checkPropInLink(linkOption[dim + "AxisId"], axisModel.id) || checkPropInLink(linkOption[dim + "AxisIndex"], axisModel.componentIndex) || checkPropInLink(linkOption[dim + "AxisName"], axisModel.name)) return i;
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
function checkPropInLink(linkPropValue, axisPropValue) {
|
|
1332
|
-
return linkPropValue === "all" || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;
|
|
1333
|
-
}
|
|
1334
|
-
function fixValue(axisModel) {
|
|
1335
|
-
var axisInfo = getAxisInfo(axisModel);
|
|
1336
|
-
if (!axisInfo) return;
|
|
1337
|
-
var axisPointerModel = axisInfo.axisPointerModel;
|
|
1338
|
-
var scale = axisInfo.axis.scale;
|
|
1339
|
-
var option = axisPointerModel.option;
|
|
1340
|
-
var status = axisPointerModel.get("status");
|
|
1341
|
-
var value = axisPointerModel.get("value");
|
|
1342
|
-
if (value != null) value = scale.parse(value);
|
|
1343
|
-
var useHandle = isHandleTrigger(axisPointerModel);
|
|
1344
|
-
if (status == null) option.status = useHandle ? "show" : "hide";
|
|
1345
|
-
var extent = scale.getExtent().slice();
|
|
1346
|
-
extent[0] > extent[1] && extent.reverse();
|
|
1347
|
-
if (value == null || value > extent[1]) value = extent[1];
|
|
1348
|
-
if (value < extent[0]) value = extent[0];
|
|
1349
|
-
option.value = value;
|
|
1350
|
-
if (useHandle) option.status = axisInfo.axis.scale.isBlank() ? "hide" : "show";
|
|
1351
|
-
}
|
|
1352
|
-
function getAxisInfo(axisModel) {
|
|
1353
|
-
var coordSysAxesInfo = (axisModel.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
|
|
1354
|
-
return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];
|
|
1355
|
-
}
|
|
1356
|
-
function getAxisPointerModel(axisModel) {
|
|
1357
|
-
var axisInfo = getAxisInfo(axisModel);
|
|
1358
|
-
return axisInfo && axisInfo.axisPointerModel;
|
|
1359
|
-
}
|
|
1360
|
-
function isHandleTrigger(axisPointerModel) {
|
|
1361
|
-
return !!axisPointerModel.get(["handle", "show"]);
|
|
1362
|
-
}
|
|
1363
|
-
/**
|
|
1364
|
-
* @param {module:echarts/model/Model} model
|
|
1365
|
-
* @return {string} unique key
|
|
1366
|
-
*/
|
|
1367
|
-
function makeKey(model) {
|
|
1368
|
-
return model.type + "||" + model.id;
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
//#endregion
|
|
1372
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/axis/AxisView.js
|
|
1373
|
-
/**
|
|
1374
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1375
|
-
*/
|
|
1376
|
-
|
|
1377
|
-
function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {
|
|
1378
|
-
var axis = axisModel.axis;
|
|
1379
|
-
if (axis.scale.isBlank()) return;
|
|
1380
|
-
var splitAreaModel = axisModel.getModel("splitArea");
|
|
1381
|
-
var areaStyleModel = splitAreaModel.getModel("areaStyle");
|
|
1382
|
-
var areaColors = areaStyleModel.get("color");
|
|
1383
|
-
var gridRect = gridModel.coordinateSystem.getRect();
|
|
1384
|
-
var ticksCoords = axis.getTicksCoords({
|
|
1385
|
-
tickModel: splitAreaModel,
|
|
1386
|
-
clamp: true,
|
|
1387
|
-
breakTicks: "none",
|
|
1388
|
-
pruneByBreak: "preserve_extent_bound"
|
|
1389
|
-
});
|
|
1390
|
-
if (!ticksCoords.length) return;
|
|
1391
|
-
var areaColorsLen = areaColors.length;
|
|
1392
|
-
var lastSplitAreaColors = inner$1(axisView).splitAreaColors;
|
|
1393
|
-
var newSplitAreaColors = createHashMap();
|
|
1394
|
-
var colorIndex = 0;
|
|
1395
|
-
if (lastSplitAreaColors) for (var i = 0; i < ticksCoords.length; i++) {
|
|
1396
|
-
var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);
|
|
1397
|
-
if (cIndex != null) {
|
|
1398
|
-
colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;
|
|
1399
|
-
break;
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
var prev = axis.toGlobalCoord(ticksCoords[0].coord);
|
|
1403
|
-
var areaStyle = areaStyleModel.getAreaStyle();
|
|
1404
|
-
areaColors = isArray(areaColors) ? areaColors : [areaColors];
|
|
1405
|
-
for (var i = 1; i < ticksCoords.length; i++) {
|
|
1406
|
-
var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
|
|
1407
|
-
var x = void 0;
|
|
1408
|
-
var y = void 0;
|
|
1409
|
-
var width = void 0;
|
|
1410
|
-
var height = void 0;
|
|
1411
|
-
if (axis.isHorizontal()) {
|
|
1412
|
-
x = prev;
|
|
1413
|
-
y = gridRect.y;
|
|
1414
|
-
width = tickCoord - x;
|
|
1415
|
-
height = gridRect.height;
|
|
1416
|
-
prev = x + width;
|
|
1417
|
-
} else {
|
|
1418
|
-
x = gridRect.x;
|
|
1419
|
-
y = prev;
|
|
1420
|
-
width = gridRect.width;
|
|
1421
|
-
height = tickCoord - y;
|
|
1422
|
-
prev = y + height;
|
|
1423
|
-
}
|
|
1424
|
-
var tickValue = ticksCoords[i - 1].tickValue;
|
|
1425
|
-
tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
|
|
1426
|
-
axisGroup.add(new Rect({
|
|
1427
|
-
anid: tickValue != null ? "area_" + tickValue : null,
|
|
1428
|
-
shape: {
|
|
1429
|
-
x,
|
|
1430
|
-
y,
|
|
1431
|
-
width,
|
|
1432
|
-
height
|
|
1433
|
-
},
|
|
1434
|
-
style: defaults({
|
|
1435
|
-
fill: areaColors[colorIndex]
|
|
1436
|
-
}, areaStyle),
|
|
1437
|
-
autoBatch: true,
|
|
1438
|
-
silent: true
|
|
1439
|
-
}));
|
|
1440
|
-
colorIndex = (colorIndex + 1) % areaColorsLen;
|
|
1441
|
-
}
|
|
1442
|
-
inner$1(axisView).splitAreaColors = newSplitAreaColors;
|
|
1443
|
-
}
|
|
1444
|
-
function rectCoordAxisHandleRemove(axisView) {
|
|
1445
|
-
inner$1(axisView).splitAreaColors = null;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
//#endregion
|
|
1449
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/axis/CartesianAxisView.js
|
|
1450
|
-
/**
|
|
1451
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1452
|
-
*/
|
|
1453
|
-
|
|
1454
|
-
function install$2(registers) {
|
|
1455
|
-
registers.registerComponentView(GridView);
|
|
1456
|
-
registers.registerComponentModel(GridModel);
|
|
1457
|
-
registers.registerCoordinateSystem("cartesian2d", Grid);
|
|
1458
|
-
axisModelCreator(registers, "x", CartesianAxisModel, extraOption);
|
|
1459
|
-
axisModelCreator(registers, "y", CartesianAxisModel, extraOption);
|
|
1460
|
-
registers.registerComponentView(CartesianXAxisView);
|
|
1461
|
-
registers.registerComponentView(CartesianYAxisView);
|
|
1462
|
-
registers.registerPreprocessor(function (option) {
|
|
1463
|
-
if (option.xAxis && option.yAxis && !option.grid) option.grid = {};
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
//#endregion
|
|
1468
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/radar/RadarModel.js
|
|
1469
|
-
/**
|
|
1470
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1471
|
-
*/
|
|
1472
|
-
|
|
1473
|
-
function defaultsShow(opt, show) {
|
|
1474
|
-
return defaults({
|
|
1475
|
-
show
|
|
1476
|
-
}, opt);
|
|
1477
|
-
}
|
|
1478
|
-
//#endregion
|
|
1479
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/radar/install.js
|
|
1480
|
-
/**
|
|
1481
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1482
|
-
*/
|
|
1483
|
-
function install$1(registers) {
|
|
1484
|
-
registers.registerCoordinateSystem("radar", Radar);
|
|
1485
|
-
registers.registerComponentModel(RadarModel);
|
|
1486
|
-
registers.registerComponentView(RadarView);
|
|
1487
|
-
registers.registerVisual({
|
|
1488
|
-
seriesType: "radar",
|
|
1489
|
-
reset: function (seriesModel) {
|
|
1490
|
-
var data = seriesModel.getData();
|
|
1491
|
-
data.each(function (idx) {
|
|
1492
|
-
data.setItemVisual(idx, "legendIcon", "roundRect");
|
|
1493
|
-
});
|
|
1494
|
-
data.setVisual("legendIcon", "roundRect");
|
|
1495
|
-
}
|
|
1496
|
-
});
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
//#endregion
|
|
1500
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/interactionMutex.js
|
|
1501
|
-
/**
|
|
1502
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1503
|
-
*/
|
|
1504
|
-
|
|
1505
|
-
function take(zr, resourceKey, userKey) {
|
|
1506
|
-
inner(zr)[resourceKey] = userKey;
|
|
1507
|
-
}
|
|
1508
|
-
function release(zr, resourceKey, userKey) {
|
|
1509
|
-
var store = inner(zr);
|
|
1510
|
-
if (store[resourceKey] === userKey) store[resourceKey] = null;
|
|
1511
|
-
}
|
|
1512
|
-
function isTaken(zr, resourceKey) {
|
|
1513
|
-
return !!inner(zr)[resourceKey];
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* payload: {
|
|
1517
|
-
* type: 'takeGlobalCursor',
|
|
1518
|
-
* key: 'dataZoomSelect', or 'brush', or ...,
|
|
1519
|
-
* If no userKey, release global cursor.
|
|
1520
|
-
* }
|
|
1521
|
-
*/
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* Used on roam/brush triggering determination.
|
|
1525
|
-
* This is to avoid that: mouse clicking on an elements that is over geo or graph,
|
|
1526
|
-
* but roam is triggered unexpectedly.
|
|
1527
|
-
*/
|
|
1528
|
-
function onIrrelevantElement(e, api, targetComponent) {
|
|
1529
|
-
var eventElComponent = api.getComponentByElement(e.topTarget);
|
|
1530
|
-
if (!eventElComponent || eventElComponent === targetComponent || IRRELEVANT_EXCLUDES.hasOwnProperty(eventElComponent.mainType)) return false;
|
|
1531
|
-
var eventElCoordSys = eventElComponent.coordinateSystem;
|
|
1532
|
-
if (!eventElCoordSys || eventElCoordSys.model === targetComponent) return false;
|
|
1533
|
-
var eventElCmptZInfo = retrieveZInfo(eventElComponent);
|
|
1534
|
-
var targetCmptZInfo = retrieveZInfo(targetComponent);
|
|
1535
|
-
if ((eventElCmptZInfo.zlevel - targetCmptZInfo.zlevel || eventElCmptZInfo.z - targetCmptZInfo.z) <= 0) return false;
|
|
1536
|
-
return true;
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
//#endregion
|
|
1540
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/RoamController.js
|
|
1541
|
-
/**
|
|
1542
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1543
|
-
*/
|
|
1544
|
-
/**
|
|
1545
|
-
* An manager of zoom and pan(darg) hehavior.
|
|
1546
|
-
* But it is not responsible for updating the view, since view updates vary and can
|
|
1547
|
-
* not be handled in a uniform way.
|
|
1548
|
-
*
|
|
1549
|
-
* Note: regarding view updates:
|
|
1550
|
-
* - Transformabe views typically use `coord/View` (e.g., geo and series.graph roaming).
|
|
1551
|
-
* Some commonly used view update logic has been organized into `roamHelper.ts`.
|
|
1552
|
-
* - Non-transformable views handle updates themselves, possibly involving re-layout,
|
|
1553
|
-
* (e.g., treemap).
|
|
1554
|
-
* - Some scenarios do not require transformation (e.g., dataZoom roaming for cartesian,
|
|
1555
|
-
* brush component).
|
|
1556
|
-
*/
|
|
1557
|
-
|
|
1558
|
-
function eventConsumed(e) {
|
|
1559
|
-
return e.__ecRoamConsumed;
|
|
1560
|
-
}
|
|
1561
|
-
function ensureZrStore(zr) {
|
|
1562
|
-
var store = innerZrStore(zr);
|
|
1563
|
-
store.roam = store.roam || {};
|
|
1564
|
-
store.uniform = store.uniform || {};
|
|
1565
|
-
return store;
|
|
1566
|
-
}
|
|
1567
|
-
/**
|
|
1568
|
-
* Listeners are sorted by z2/z/zlevel in descending order.
|
|
1569
|
-
* This decides the precedence between different roam controllers if they are overlapped.
|
|
1570
|
-
*
|
|
1571
|
-
* [MEMO]: It's not easy to perfectly reconcile the conflicts caused by overlap.
|
|
1572
|
-
* - Consider cases:
|
|
1573
|
-
* - Multiple roam controllers overlapped.
|
|
1574
|
-
* - Usually only the topmost can trigger roam.
|
|
1575
|
-
* - Roam controllers overlap with other zr elements:
|
|
1576
|
-
* - zr elements are relevant or irrelevent to the host of the roam controller. e.g., axis split line
|
|
1577
|
-
* or series elements is relevant to a cartesian and should trigger roam.
|
|
1578
|
-
* - zr elements is above or below the roam controller host, which affects the precedence of interaction.
|
|
1579
|
-
* - zr elements may not silent only for triggering tooltip by hovering, which is available to roam;
|
|
1580
|
-
* or may not silent for click, where roam is not preferable.
|
|
1581
|
-
* - Approach - `addRoamZrListener+pointerChecker+onIrrelevantElement` (currently used):
|
|
1582
|
-
* - Resolve the precedence between different roam controllers
|
|
1583
|
-
* - But cannot prevent the handling on other zr elements that under the roam controller in z-order.
|
|
1584
|
-
* - Approach - "use an invisible zr elements to receive the zr events to trigger roam":
|
|
1585
|
-
* - More complicated in impl.
|
|
1586
|
-
* - May cause bad cases where zr event cannot be receive due to other non-silient zr elements covering it.
|
|
1587
|
-
*/
|
|
1588
|
-
function addRoamZrListener(zr, eventType, listener, zInfoParsed) {
|
|
1589
|
-
var roam = ensureZrStore(zr).roam;
|
|
1590
|
-
var listenerList = roam[eventType] = roam[eventType] || [];
|
|
1591
|
-
var idx = 0;
|
|
1592
|
-
for (; idx < listenerList.length; idx++) {
|
|
1593
|
-
var currZInfo = listenerList[idx].zInfoParsed;
|
|
1594
|
-
if ((currZInfo.zlevel - zInfoParsed.zlevel || currZInfo.z - zInfoParsed.z || currZInfo.z2 - zInfoParsed.z2) <= 0) break;
|
|
1595
|
-
}
|
|
1596
|
-
listenerList.splice(idx, 0, {
|
|
1597
|
-
listener,
|
|
1598
|
-
zInfoParsed
|
|
1599
|
-
});
|
|
1600
|
-
ensureUniformListener(zr, eventType);
|
|
1601
|
-
}
|
|
1602
|
-
function removeRoamZrListener(zr, eventType, listener) {
|
|
1603
|
-
var listenerList = ensureZrStore(zr).roam[eventType] || [];
|
|
1604
|
-
for (var idx = 0; idx < listenerList.length; idx++) if (listenerList[idx].listener === listener) {
|
|
1605
|
-
listenerList.splice(idx, 1);
|
|
1606
|
-
if (!listenerList.length) removeUniformListener(zr, eventType);
|
|
1607
|
-
return;
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
function ensureUniformListener(zr, eventType) {
|
|
1611
|
-
var store = ensureZrStore(zr);
|
|
1612
|
-
if (!store.uniform[eventType]) zr.on(eventType, store.uniform[eventType] = function (event) {
|
|
1613
|
-
var listenerList = store.roam[eventType];
|
|
1614
|
-
if (listenerList) for (var i = 0; i < listenerList.length; i++) listenerList[i].listener(event);
|
|
1615
|
-
});
|
|
1616
|
-
}
|
|
1617
|
-
function removeUniformListener(zr, eventType) {
|
|
1618
|
-
var uniform = ensureZrStore(zr).uniform;
|
|
1619
|
-
if (uniform[eventType]) {
|
|
1620
|
-
zr.off(eventType, uniform[eventType]);
|
|
1621
|
-
uniform[eventType] = null;
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
function trigger$1(controller, eventName, behaviorToCheck, e, contollerEvent) {
|
|
1625
|
-
contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);
|
|
1626
|
-
controller.trigger(eventName, contollerEvent);
|
|
1627
|
-
}
|
|
1628
|
-
function isAvailableBehavior(behaviorToCheck, e, settings) {
|
|
1629
|
-
var setting = settings[behaviorToCheck];
|
|
1630
|
-
return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + "Key"]);
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
//#endregion
|
|
1634
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/roamHelper.js
|
|
1635
|
-
/**
|
|
1636
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1637
|
-
*/
|
|
1638
|
-
/**
|
|
1639
|
-
* [CAVEAT] `updateViewOnPan` and `updateViewOnZoom` modifies the group transform directly,
|
|
1640
|
-
* but the 'center' and 'zoom' in echarts option and 'View' coordinate system are not updated yet,
|
|
1641
|
-
* which must be performed later in 'xxxRoam' action by calling `updateCenterAndZoom`.
|
|
1642
|
-
* @see {updateCenterAndZoomInAction}
|
|
1643
|
-
*/
|
|
1644
|
-
function updateViewOnPan(controllerHost, dx, dy) {
|
|
1645
|
-
var target = controllerHost.target;
|
|
1646
|
-
target.x += dx;
|
|
1647
|
-
target.y += dy;
|
|
1648
|
-
target.dirty();
|
|
1649
|
-
}
|
|
1650
|
-
function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {
|
|
1651
|
-
var target = controllerHost.target;
|
|
1652
|
-
var zoomLimit = controllerHost.zoomLimit;
|
|
1653
|
-
var newZoom = controllerHost.zoom = controllerHost.zoom || 1;
|
|
1654
|
-
newZoom *= zoomDelta;
|
|
1655
|
-
newZoom = clampByZoomLimit(newZoom, zoomLimit);
|
|
1656
|
-
var zoomScale = newZoom / controllerHost.zoom;
|
|
1657
|
-
controllerHost.zoom = newZoom;
|
|
1658
|
-
zoomTransformableByOrigin(target, zoomX, zoomY, zoomScale);
|
|
1659
|
-
target.dirty();
|
|
1660
|
-
}
|
|
1661
|
-
/**
|
|
1662
|
-
* A abstraction for some similar impl in roaming.
|
|
1663
|
-
*/
|
|
1664
|
-
function updateController(seriesModel, api, pointerCheckerEl, controller, controllerHost, clipRect) {
|
|
1665
|
-
var tmpRect = new BoundingRect(0, 0, 0, 0);
|
|
1666
|
-
controller.enable(seriesModel.get("roam"), {
|
|
1667
|
-
api,
|
|
1668
|
-
zInfo: {
|
|
1669
|
-
component: seriesModel
|
|
1670
|
-
},
|
|
1671
|
-
triggerInfo: {
|
|
1672
|
-
roamTrigger: seriesModel.get("roamTrigger"),
|
|
1673
|
-
isInSelf: function (e, x, y) {
|
|
1674
|
-
tmpRect.copy(pointerCheckerEl.getBoundingRect());
|
|
1675
|
-
tmpRect.applyTransform(pointerCheckerEl.getComputedTransform());
|
|
1676
|
-
return tmpRect.contain(x, y);
|
|
1677
|
-
},
|
|
1678
|
-
isInClip: function (e, x, y) {
|
|
1679
|
-
return !clipRect || clipRect.contain(x, y);
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
});
|
|
1683
|
-
controllerHost.zoomLimit = seriesModel.get("scaleLimit");
|
|
1684
|
-
var coordinate = seriesModel.coordinateSystem;
|
|
1685
|
-
controllerHost.zoom = coordinate ? coordinate.getZoom() : 1;
|
|
1686
|
-
var type = seriesModel.subType + "Roam";
|
|
1687
|
-
controller.off("pan").off("zoom").on("pan", function (e) {
|
|
1688
|
-
updateViewOnPan(controllerHost, e.dx, e.dy);
|
|
1689
|
-
api.dispatchAction({
|
|
1690
|
-
seriesId: seriesModel.id,
|
|
1691
|
-
type,
|
|
1692
|
-
dx: e.dx,
|
|
1693
|
-
dy: e.dy
|
|
1694
|
-
});
|
|
1695
|
-
}).on("zoom", function (e) {
|
|
1696
|
-
/**
|
|
1697
|
-
* FIXME: should do nothing except `api.dispatchAction` here, the other logic
|
|
1698
|
-
* should be performed in the action handler and `updateTransform`; otherwise,
|
|
1699
|
-
* they are inconsistent if user triggers this action explicitly.
|
|
1700
|
-
*/
|
|
1701
|
-
updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);
|
|
1702
|
-
api.dispatchAction({
|
|
1703
|
-
seriesId: seriesModel.id,
|
|
1704
|
-
type,
|
|
1705
|
-
zoom: e.scale,
|
|
1706
|
-
originX: e.originX,
|
|
1707
|
-
originY: e.originY
|
|
1708
|
-
});
|
|
1709
|
-
api.updateLabelLayout();
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
function getCenterCoord(view, point) {
|
|
1713
|
-
return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);
|
|
1714
|
-
}
|
|
1715
|
-
/**
|
|
1716
|
-
* Should be called only in action handler.
|
|
1717
|
-
* @see {updateViewOnPan|updateViewOnZoom}
|
|
1718
|
-
*/
|
|
1719
|
-
function updateCenterAndZoomInAction(view, payload, zoomLimit) {
|
|
1720
|
-
var previousZoom = view.getZoom();
|
|
1721
|
-
var center = view.getCenter();
|
|
1722
|
-
var deltaZoom = payload.zoom;
|
|
1723
|
-
var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);
|
|
1724
|
-
if (payload.dx != null && payload.dy != null) {
|
|
1725
|
-
point[0] -= payload.dx;
|
|
1726
|
-
point[1] -= payload.dy;
|
|
1727
|
-
view.setCenter(getCenterCoord(view, point));
|
|
1728
|
-
}
|
|
1729
|
-
if (deltaZoom != null) {
|
|
1730
|
-
deltaZoom = clampByZoomLimit(previousZoom * deltaZoom, zoomLimit) / previousZoom;
|
|
1731
|
-
zoomTransformableByOrigin(view, payload.originX, payload.originY, deltaZoom);
|
|
1732
|
-
view.updateTransform();
|
|
1733
|
-
view.setCenter(getCenterCoord(view, point));
|
|
1734
|
-
view.setZoom(deltaZoom * previousZoom);
|
|
1735
|
-
}
|
|
1736
|
-
return {
|
|
1737
|
-
center: view.getCenter(),
|
|
1738
|
-
zoom: view.getZoom()
|
|
1739
|
-
};
|
|
1740
|
-
}
|
|
1741
|
-
function zoomTransformableByOrigin(target, originX, originY, deltaZoom) {
|
|
1742
|
-
target.x -= (originX - target.x) * (deltaZoom - 1);
|
|
1743
|
-
target.y -= (originY - target.y) * (deltaZoom - 1);
|
|
1744
|
-
target.scaleX *= deltaZoom;
|
|
1745
|
-
target.scaleY *= deltaZoom;
|
|
1746
|
-
}
|
|
1747
|
-
function clampByZoomLimit(zoom, zoomLimit) {
|
|
1748
|
-
if (zoomLimit) {
|
|
1749
|
-
var zoomMin = zoomLimit.min || 0;
|
|
1750
|
-
var zoomMax = zoomLimit.max || Infinity;
|
|
1751
|
-
zoom = Math.max(Math.min(zoomMax, zoom), zoomMin);
|
|
1752
|
-
}
|
|
1753
|
-
return zoom;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
//#endregion
|
|
1757
|
-
//#region ../../node_modules/.bun/zrender@6.0.0/node_modules/zrender/lib/tool/parseXML.js
|
|
1758
|
-
function parseXML(svg) {
|
|
1759
|
-
if (isString(svg)) svg = new DOMParser().parseFromString(svg, "text/xml");
|
|
1760
|
-
var svgNode = svg;
|
|
1761
|
-
if (svgNode.nodeType === 9) svgNode = svgNode.firstChild;
|
|
1762
|
-
while (svgNode.nodeName.toLowerCase() !== "svg" || svgNode.nodeType !== 1) svgNode = svgNode.nextSibling;
|
|
1763
|
-
return svgNode;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
//#endregion
|
|
1767
|
-
//#region ../../node_modules/.bun/zrender@6.0.0/node_modules/zrender/lib/tool/parseSVG.js
|
|
1768
|
-
|
|
1769
|
-
function parsePaintServerUnit(xmlNode, gradient) {
|
|
1770
|
-
if (xmlNode.getAttribute("gradientUnits") === "userSpaceOnUse") gradient.global = true;
|
|
1771
|
-
}
|
|
1772
|
-
function parseGradientColorStops(xmlNode, gradient) {
|
|
1773
|
-
var stop = xmlNode.firstChild;
|
|
1774
|
-
while (stop) {
|
|
1775
|
-
if (stop.nodeType === 1 && stop.nodeName.toLocaleLowerCase() === "stop") {
|
|
1776
|
-
var offsetStr = stop.getAttribute("offset");
|
|
1777
|
-
var offset = void 0;
|
|
1778
|
-
if (offsetStr && offsetStr.indexOf("%") > 0) offset = parseInt(offsetStr, 10) / 100;else if (offsetStr) offset = parseFloat(offsetStr);else offset = 0;
|
|
1779
|
-
var styleVals = {};
|
|
1780
|
-
parseInlineStyle(stop, styleVals, styleVals);
|
|
1781
|
-
var stopColor = styleVals.stopColor || stop.getAttribute("stop-color") || "#000000";
|
|
1782
|
-
var stopOpacity = styleVals.stopOpacity || stop.getAttribute("stop-opacity");
|
|
1783
|
-
if (stopOpacity) {
|
|
1784
|
-
var rgba = parse(stopColor);
|
|
1785
|
-
if (rgba && rgba[3]) {
|
|
1786
|
-
rgba[3] *= parseCssFloat(stopOpacity);
|
|
1787
|
-
stopColor = stringify(rgba, "rgba");
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
gradient.colorStops.push({
|
|
1791
|
-
offset,
|
|
1792
|
-
color: stopColor
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
stop = stop.nextSibling;
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
function inheritStyle(parent, child) {
|
|
1799
|
-
if (parent && parent.__inheritedStyle) {
|
|
1800
|
-
if (!child.__inheritedStyle) child.__inheritedStyle = {};
|
|
1801
|
-
defaults(child.__inheritedStyle, parent.__inheritedStyle);
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
function parsePoints(pointsString) {
|
|
1805
|
-
var list = splitNumberSequence(pointsString);
|
|
1806
|
-
var points = [];
|
|
1807
|
-
for (var i = 0; i < list.length; i += 2) {
|
|
1808
|
-
var x = parseFloat(list[i]);
|
|
1809
|
-
var y = parseFloat(list[i + 1]);
|
|
1810
|
-
points.push([x, y]);
|
|
1811
|
-
}
|
|
1812
|
-
return points;
|
|
1813
|
-
}
|
|
1814
|
-
function parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {
|
|
1815
|
-
var disp = el;
|
|
1816
|
-
var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};
|
|
1817
|
-
var selfStyle = {};
|
|
1818
|
-
if (xmlNode.nodeType === 1) {
|
|
1819
|
-
parseTransformAttribute(xmlNode, el);
|
|
1820
|
-
parseInlineStyle(xmlNode, inheritedStyle, selfStyle);
|
|
1821
|
-
if (!onlyInlineStyle) parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);
|
|
1822
|
-
}
|
|
1823
|
-
disp.style = disp.style || {};
|
|
1824
|
-
if (inheritedStyle.fill != null) disp.style.fill = getFillStrokeStyle(disp, "fill", inheritedStyle.fill, defsUsePending);
|
|
1825
|
-
if (inheritedStyle.stroke != null) disp.style.stroke = getFillStrokeStyle(disp, "stroke", inheritedStyle.stroke, defsUsePending);
|
|
1826
|
-
each$1(["lineWidth", "opacity", "fillOpacity", "strokeOpacity", "miterLimit", "fontSize"], function (propName) {
|
|
1827
|
-
if (inheritedStyle[propName] != null) disp.style[propName] = parseFloat(inheritedStyle[propName]);
|
|
1828
|
-
});
|
|
1829
|
-
each$1(["lineDashOffset", "lineCap", "lineJoin", "fontWeight", "fontFamily", "fontStyle", "textAlign"], function (propName) {
|
|
1830
|
-
if (inheritedStyle[propName] != null) disp.style[propName] = inheritedStyle[propName];
|
|
1831
|
-
});
|
|
1832
|
-
if (isTextGroup) disp.__selfStyle = selfStyle;
|
|
1833
|
-
if (inheritedStyle.lineDash) disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {
|
|
1834
|
-
return parseFloat(str);
|
|
1835
|
-
});
|
|
1836
|
-
if (inheritedStyle.visibility === "hidden" || inheritedStyle.visibility === "collapse") disp.invisible = true;
|
|
1837
|
-
if (inheritedStyle.display === "none") disp.ignore = true;
|
|
1838
|
-
}
|
|
1839
|
-
function applyTextAlignment(text, parentGroup) {
|
|
1840
|
-
var parentSelfStyle = parentGroup.__selfStyle;
|
|
1841
|
-
if (parentSelfStyle) {
|
|
1842
|
-
var textBaseline = parentSelfStyle.textBaseline;
|
|
1843
|
-
var zrTextBaseline = textBaseline;
|
|
1844
|
-
if (!textBaseline || textBaseline === "auto") zrTextBaseline = "alphabetic";else if (textBaseline === "baseline") zrTextBaseline = "alphabetic";else if (textBaseline === "before-edge" || textBaseline === "text-before-edge") zrTextBaseline = "top";else if (textBaseline === "after-edge" || textBaseline === "text-after-edge") zrTextBaseline = "bottom";else if (textBaseline === "central" || textBaseline === "mathematical") zrTextBaseline = "middle";
|
|
1845
|
-
text.style.textBaseline = zrTextBaseline;
|
|
1846
|
-
}
|
|
1847
|
-
var parentInheritedStyle = parentGroup.__inheritedStyle;
|
|
1848
|
-
if (parentInheritedStyle) {
|
|
1849
|
-
var textAlign = parentInheritedStyle.textAlign;
|
|
1850
|
-
var zrTextAlign = textAlign;
|
|
1851
|
-
if (textAlign) {
|
|
1852
|
-
if (textAlign === "middle") zrTextAlign = "center";
|
|
1853
|
-
text.style.textAlign = zrTextAlign;
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
function getFillStrokeStyle(el, method, str, defsUsePending) {
|
|
1858
|
-
var urlMatch = str && str.match(urlRegex);
|
|
1859
|
-
if (urlMatch) {
|
|
1860
|
-
var url = trim(urlMatch[1]);
|
|
1861
|
-
defsUsePending.push([el, method, url]);
|
|
1862
|
-
return;
|
|
1863
|
-
}
|
|
1864
|
-
if (str === "none") str = null;
|
|
1865
|
-
return str;
|
|
1866
|
-
}
|
|
1867
|
-
function applyDefs(defs, defsUsePending) {
|
|
1868
|
-
for (var i = 0; i < defsUsePending.length; i++) {
|
|
1869
|
-
var item = defsUsePending[i];
|
|
1870
|
-
item[0].style[item[1]] = defs[item[2]];
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
function splitNumberSequence(rawStr) {
|
|
1874
|
-
return rawStr.match(numberReg) || [];
|
|
1875
|
-
}
|
|
1876
|
-
function parseTransformAttribute(xmlNode, node) {
|
|
1877
|
-
var transform = xmlNode.getAttribute("transform");
|
|
1878
|
-
if (transform) {
|
|
1879
|
-
transform = transform.replace(/,/g, " ");
|
|
1880
|
-
var transformOps_1 = [];
|
|
1881
|
-
var mt = null;
|
|
1882
|
-
transform.replace(transformRegex, function (str, type, value) {
|
|
1883
|
-
transformOps_1.push(type, value);
|
|
1884
|
-
return "";
|
|
1885
|
-
});
|
|
1886
|
-
for (var i = transformOps_1.length - 1; i > 0; i -= 2) {
|
|
1887
|
-
var value = transformOps_1[i];
|
|
1888
|
-
var type = transformOps_1[i - 1];
|
|
1889
|
-
var valueArr = splitNumberSequence(value);
|
|
1890
|
-
mt = mt || create();
|
|
1891
|
-
switch (type) {
|
|
1892
|
-
case "translate":
|
|
1893
|
-
translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || "0")]);
|
|
1894
|
-
break;
|
|
1895
|
-
case "scale":
|
|
1896
|
-
scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);
|
|
1897
|
-
break;
|
|
1898
|
-
case "rotate":
|
|
1899
|
-
rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [parseFloat(valueArr[1] || "0"), parseFloat(valueArr[2] || "0")]);
|
|
1900
|
-
break;
|
|
1901
|
-
case "skewX":
|
|
1902
|
-
var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
|
|
1903
|
-
mul(mt, [1, 0, sx, 1, 0, 0], mt);
|
|
1904
|
-
break;
|
|
1905
|
-
case "skewY":
|
|
1906
|
-
var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
|
|
1907
|
-
mul(mt, [1, sy, 0, 1, 0, 0], mt);
|
|
1908
|
-
break;
|
|
1909
|
-
case "matrix":
|
|
1910
|
-
mt[0] = parseFloat(valueArr[0]);
|
|
1911
|
-
mt[1] = parseFloat(valueArr[1]);
|
|
1912
|
-
mt[2] = parseFloat(valueArr[2]);
|
|
1913
|
-
mt[3] = parseFloat(valueArr[3]);
|
|
1914
|
-
mt[4] = parseFloat(valueArr[4]);
|
|
1915
|
-
mt[5] = parseFloat(valueArr[5]);
|
|
1916
|
-
break;
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
node.setLocalTransform(mt);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
function parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
|
|
1923
|
-
var style = xmlNode.getAttribute("style");
|
|
1924
|
-
if (!style) return;
|
|
1925
|
-
styleRegex.lastIndex = 0;
|
|
1926
|
-
var styleRegResult;
|
|
1927
|
-
while ((styleRegResult = styleRegex.exec(style)) != null) {
|
|
1928
|
-
var svgStlAttr = styleRegResult[1];
|
|
1929
|
-
var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
|
|
1930
|
-
if (zrInheritableStlAttr) inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];
|
|
1931
|
-
var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
|
|
1932
|
-
if (zrSelfStlAttr) selfStyleResult[zrSelfStlAttr] = styleRegResult[2];
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
function parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
|
|
1936
|
-
for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {
|
|
1937
|
-
var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];
|
|
1938
|
-
var attrValue = xmlNode.getAttribute(svgAttrName);
|
|
1939
|
-
if (attrValue != null) inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
|
|
1940
|
-
}
|
|
1941
|
-
for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {
|
|
1942
|
-
var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];
|
|
1943
|
-
var attrValue = xmlNode.getAttribute(svgAttrName);
|
|
1944
|
-
if (attrValue != null) selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
function makeViewBoxTransform(viewBoxRect, boundingRect) {
|
|
1948
|
-
var scaleX = boundingRect.width / viewBoxRect.width;
|
|
1949
|
-
var scaleY = boundingRect.height / viewBoxRect.height;
|
|
1950
|
-
var scale = Math.min(scaleX, scaleY);
|
|
1951
|
-
return {
|
|
1952
|
-
scale,
|
|
1953
|
-
x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),
|
|
1954
|
-
y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)
|
|
1955
|
-
};
|
|
1956
|
-
}
|
|
1957
|
-
function parseSVG(xml, opt) {
|
|
1958
|
-
return new SVGParser().parse(xml, opt);
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
//#endregion
|
|
1962
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/GeoSVGResource.js
|
|
1963
|
-
/**
|
|
1964
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
1965
|
-
*/
|
|
1966
|
-
/**
|
|
1967
|
-
* "region available" means that: enable users to set attribute `name="xxx"` on those tags
|
|
1968
|
-
* to make it be a region.
|
|
1969
|
-
* 1. region styles and its label styles can be defined in echarts opton:
|
|
1970
|
-
* ```js
|
|
1971
|
-
* geo: {
|
|
1972
|
-
* regions: [{
|
|
1973
|
-
* name: 'xxx',
|
|
1974
|
-
* itemStyle: { ... },
|
|
1975
|
-
* label: { ... }
|
|
1976
|
-
* }, {
|
|
1977
|
-
* ...
|
|
1978
|
-
* },
|
|
1979
|
-
* ...]
|
|
1980
|
-
* };
|
|
1981
|
-
* ```
|
|
1982
|
-
* 2. name can be duplicated in different SVG tag. All of the tags with the same name share
|
|
1983
|
-
* a region option. For exampel if there are two <path> representing two lung lobes. They have
|
|
1984
|
-
* no common parents but both of them need to display label "lung" inside.
|
|
1985
|
-
*/
|
|
1986
|
-
|
|
1987
|
-
function setSilent(el) {
|
|
1988
|
-
el.silent = false;
|
|
1989
|
-
if (el.isGroup) el.traverse(function (child) {
|
|
1990
|
-
child.silent = false;
|
|
1991
|
-
});
|
|
1992
|
-
}
|
|
1993
|
-
function createRegions(named) {
|
|
1994
|
-
var regions = [];
|
|
1995
|
-
var regionsMap = createHashMap();
|
|
1996
|
-
each$1(named, function (namedItem) {
|
|
1997
|
-
if (namedItem.namedFrom != null) return;
|
|
1998
|
-
var region = new GeoSVGRegion(namedItem.name, namedItem.el);
|
|
1999
|
-
regions.push(region);
|
|
2000
|
-
regionsMap.set(namedItem.name, region);
|
|
2001
|
-
});
|
|
2002
|
-
return {
|
|
2003
|
-
regions,
|
|
2004
|
-
regionsMap
|
|
2005
|
-
};
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
//#endregion
|
|
2009
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/fix/nanhai.js
|
|
2010
|
-
/**
|
|
2011
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2012
|
-
*/
|
|
2013
|
-
|
|
2014
|
-
for (var i = 0; i < points$1.length; i++) for (var k = 0; k < points$1[i].length; k++) {
|
|
2015
|
-
points$1[i][k][0] /= 10.5;
|
|
2016
|
-
points$1[i][k][1] /= -10.5 / .75;
|
|
2017
|
-
points$1[i][k][0] += geoCoord[0];
|
|
2018
|
-
points$1[i][k][1] += geoCoord[1];
|
|
2019
|
-
}
|
|
2020
|
-
function fixNanhai(mapType, regions) {
|
|
2021
|
-
if (mapType === "china") {
|
|
2022
|
-
for (var i = 0; i < regions.length; i++) if (regions[i].name === nanhaiName) return;
|
|
2023
|
-
regions.push(new GeoJSONRegion(nanhaiName, map(points$1, function (exterior) {
|
|
2024
|
-
return {
|
|
2025
|
-
type: "polygon",
|
|
2026
|
-
exterior
|
|
2027
|
-
};
|
|
2028
|
-
}), geoCoord));
|
|
2029
|
-
}
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
//#endregion
|
|
2033
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/fix/textCoord.js
|
|
2034
|
-
/**
|
|
2035
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2036
|
-
*/
|
|
2037
|
-
|
|
2038
|
-
function fixTextCoords(mapType, region) {
|
|
2039
|
-
if (mapType === "china") {
|
|
2040
|
-
var coordFix = coordsOffsetMap[region.name];
|
|
2041
|
-
if (coordFix) {
|
|
2042
|
-
var cp = region.getCenter();
|
|
2043
|
-
cp[0] += coordFix[0] / 10.5;
|
|
2044
|
-
cp[1] += -coordFix[1] / (10.5 / .75);
|
|
2045
|
-
region.setCenter(cp);
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
//#endregion
|
|
2051
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js
|
|
2052
|
-
/**
|
|
2053
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2054
|
-
*/
|
|
2055
|
-
|
|
2056
|
-
function fixDiaoyuIsland(mapType, region) {
|
|
2057
|
-
if (mapType === "china" && region.name === "台湾") region.geometries.push({
|
|
2058
|
-
type: "polygon",
|
|
2059
|
-
exterior: points[0]
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
|
-
//#endregion
|
|
2064
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/GeoJSONResource.js
|
|
2065
|
-
/**
|
|
2066
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2067
|
-
*/
|
|
2068
|
-
|
|
2069
|
-
function calculateBoundingRect(regions) {
|
|
2070
|
-
var rect;
|
|
2071
|
-
for (var i = 0; i < regions.length; i++) {
|
|
2072
|
-
var regionRect = regions[i].getBoundingRect();
|
|
2073
|
-
rect = rect || regionRect.clone();
|
|
2074
|
-
rect.union(regionRect);
|
|
2075
|
-
}
|
|
2076
|
-
return rect;
|
|
2077
|
-
}
|
|
2078
|
-
function parseInput(source) {
|
|
2079
|
-
return !isString(source) ? source : typeof JSON !== "undefined" && JSON.parse ? JSON.parse(source) : new Function("return (" + source + ");")();
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
//#endregion
|
|
2083
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/geoSourceManager.js
|
|
2084
|
-
/**
|
|
2085
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2086
|
-
*/
|
|
2087
|
-
|
|
2088
|
-
function getFixedItemStyle(model) {
|
|
2089
|
-
var itemStyle = model.getItemStyle();
|
|
2090
|
-
var areaColor = model.get("areaColor");
|
|
2091
|
-
if (areaColor != null) itemStyle.fill = areaColor;
|
|
2092
|
-
return itemStyle;
|
|
2093
|
-
}
|
|
2094
|
-
function fixLineStyle(styleHost) {
|
|
2095
|
-
var style = styleHost.style;
|
|
2096
|
-
if (style) {
|
|
2097
|
-
style.stroke = style.stroke || style.fill;
|
|
2098
|
-
style.fill = null;
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
|
-
function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {
|
|
2102
|
-
var normalStyleModel = regionModel.getModel("itemStyle");
|
|
2103
|
-
var emphasisStyleModel = regionModel.getModel(["emphasis", "itemStyle"]);
|
|
2104
|
-
var blurStyleModel = regionModel.getModel(["blur", "itemStyle"]);
|
|
2105
|
-
var selectStyleModel = regionModel.getModel(["select", "itemStyle"]);
|
|
2106
|
-
var normalStyle = getFixedItemStyle(normalStyleModel);
|
|
2107
|
-
var emphasisStyle = getFixedItemStyle(emphasisStyleModel);
|
|
2108
|
-
var selectStyle = getFixedItemStyle(selectStyleModel);
|
|
2109
|
-
var blurStyle = getFixedItemStyle(blurStyleModel);
|
|
2110
|
-
var data = viewBuildCtx.data;
|
|
2111
|
-
if (data) {
|
|
2112
|
-
var style = data.getItemVisual(dataIndex, "style");
|
|
2113
|
-
var decal = data.getItemVisual(dataIndex, "decal");
|
|
2114
|
-
if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) normalStyle.fill = style.fill;
|
|
2115
|
-
if (decal) normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);
|
|
2116
|
-
}
|
|
2117
|
-
el.setStyle(normalStyle);
|
|
2118
|
-
el.style.strokeNoScale = true;
|
|
2119
|
-
el.ensureState("emphasis").style = emphasisStyle;
|
|
2120
|
-
el.ensureState("select").style = selectStyle;
|
|
2121
|
-
el.ensureState("blur").style = blurStyle;
|
|
2122
|
-
setDefaultStateProxy(el);
|
|
2123
|
-
}
|
|
2124
|
-
function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, labelXY) {
|
|
2125
|
-
var data = viewBuildCtx.data;
|
|
2126
|
-
var isGeo = viewBuildCtx.isGeo;
|
|
2127
|
-
var isDataNaN = data && isNaN(data.get(data.mapDimension("value"), dataIdx));
|
|
2128
|
-
var itemLayout = data && data.getItemLayout(dataIdx);
|
|
2129
|
-
if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {
|
|
2130
|
-
var query = !isGeo ? dataIdx : regionName;
|
|
2131
|
-
var labelFetcher = void 0;
|
|
2132
|
-
if (!data || dataIdx >= 0) labelFetcher = mapOrGeoModel;
|
|
2133
|
-
var specifiedTextOpt = labelXY ? {
|
|
2134
|
-
normal: {
|
|
2135
|
-
align: "center",
|
|
2136
|
-
verticalAlign: "middle"
|
|
2137
|
-
}
|
|
2138
|
-
} : null;
|
|
2139
|
-
setLabelStyle(el, getLabelStatesModels(regionModel), {
|
|
2140
|
-
labelFetcher,
|
|
2141
|
-
labelDataIndex: query,
|
|
2142
|
-
defaultText: regionName
|
|
2143
|
-
}, specifiedTextOpt);
|
|
2144
|
-
var textEl = el.getTextContent();
|
|
2145
|
-
if (textEl) {
|
|
2146
|
-
mapLabelRaw(textEl).ignore = textEl.ignore;
|
|
2147
|
-
if (el.textConfig && labelXY) {
|
|
2148
|
-
var rect = el.getBoundingRect().clone();
|
|
2149
|
-
el.textConfig.layoutRect = rect;
|
|
2150
|
-
el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + "%", (labelXY[1] - rect.y) / rect.height * 100 + "%"];
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
el.disableLabelAnimation = true;
|
|
2154
|
-
} else {
|
|
2155
|
-
el.removeTextContent();
|
|
2156
|
-
el.removeTextConfig();
|
|
2157
|
-
el.disableLabelAnimation = null;
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, dataIdx) {
|
|
2161
|
-
if (viewBuildCtx.data) viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);else getECData(eventTrigger).eventData = {
|
|
2162
|
-
componentType: "geo",
|
|
2163
|
-
componentIndex: mapOrGeoModel.componentIndex,
|
|
2164
|
-
geoIndex: mapOrGeoModel.componentIndex,
|
|
2165
|
-
name: regionName,
|
|
2166
|
-
region: regionModel && regionModel.option || {}
|
|
2167
|
-
};
|
|
2168
|
-
}
|
|
2169
|
-
function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
|
|
2170
|
-
if (!viewBuildCtx.data) setTooltipConfig({
|
|
2171
|
-
el,
|
|
2172
|
-
componentModel: mapOrGeoModel,
|
|
2173
|
-
itemName: regionName,
|
|
2174
|
-
itemTooltipOption: regionModel.get("tooltip")
|
|
2175
|
-
});
|
|
2176
|
-
}
|
|
2177
|
-
function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
|
|
2178
|
-
el.highDownSilentOnTouch = !!mapOrGeoModel.get("selectedMode");
|
|
2179
|
-
var emphasisModel = regionModel.getModel("emphasis");
|
|
2180
|
-
var focus = emphasisModel.get("focus");
|
|
2181
|
-
toggleHoverEmphasis(el, focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
|
|
2182
|
-
if (viewBuildCtx.isGeo) enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);
|
|
2183
|
-
return focus;
|
|
2184
|
-
}
|
|
2185
|
-
function projectPolys(rings, createStream, isLine) {
|
|
2186
|
-
var polygons = [];
|
|
2187
|
-
var curPoly;
|
|
2188
|
-
function startPolygon() {
|
|
2189
|
-
curPoly = [];
|
|
2190
|
-
}
|
|
2191
|
-
function endPolygon() {
|
|
2192
|
-
if (curPoly.length) {
|
|
2193
|
-
polygons.push(curPoly);
|
|
2194
|
-
curPoly = [];
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
var stream = createStream({
|
|
2198
|
-
polygonStart: startPolygon,
|
|
2199
|
-
polygonEnd: endPolygon,
|
|
2200
|
-
lineStart: startPolygon,
|
|
2201
|
-
lineEnd: endPolygon,
|
|
2202
|
-
point: function (x, y) {
|
|
2203
|
-
if (isFinite(x) && isFinite(y)) curPoly.push([x, y]);
|
|
2204
|
-
},
|
|
2205
|
-
sphere: function () {}
|
|
2206
|
-
});
|
|
2207
|
-
!isLine && stream.polygonStart();
|
|
2208
|
-
each$1(rings, function (ring) {
|
|
2209
|
-
stream.lineStart();
|
|
2210
|
-
for (var i = 0; i < ring.length; i++) stream.point(ring[i][0], ring[i][1]);
|
|
2211
|
-
stream.lineEnd();
|
|
2212
|
-
});
|
|
2213
|
-
!isLine && stream.polygonEnd();
|
|
2214
|
-
return polygons;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
//#endregion
|
|
2218
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/View.js
|
|
2219
|
-
/**
|
|
2220
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2221
|
-
*/
|
|
2222
|
-
/**
|
|
2223
|
-
* Simple view coordinate system
|
|
2224
|
-
* Mapping given x, y to transformd view x, y
|
|
2225
|
-
*/
|
|
2226
|
-
|
|
2227
|
-
function getCoordSys$1(finder) {
|
|
2228
|
-
var seriesModel = finder.seriesModel;
|
|
2229
|
-
return seriesModel ? seriesModel.coordinateSystem : null;
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
//#endregion
|
|
2233
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/Geo.js
|
|
2234
|
-
/**
|
|
2235
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2236
|
-
*/
|
|
2237
|
-
|
|
2238
|
-
function getCoordSys(finder) {
|
|
2239
|
-
var geoModel = finder.geoModel;
|
|
2240
|
-
var seriesModel = finder.seriesModel;
|
|
2241
|
-
return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem || (seriesModel.getReferringComponents("geo", SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
//#endregion
|
|
2245
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/coord/geo/geoCreator.js
|
|
2246
|
-
/**
|
|
2247
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2248
|
-
*/
|
|
2249
|
-
/**
|
|
2250
|
-
* Resize method bound to the geo
|
|
2251
|
-
*/
|
|
2252
|
-
function resizeGeo(geoModel, api) {
|
|
2253
|
-
var boundingCoords = geoModel.get("boundingCoords");
|
|
2254
|
-
if (boundingCoords != null) {
|
|
2255
|
-
var leftTop_1 = boundingCoords[0];
|
|
2256
|
-
var rightBottom_1 = boundingCoords[1];
|
|
2257
|
-
if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {} else {
|
|
2258
|
-
var projection_1 = this.projection;
|
|
2259
|
-
if (projection_1) {
|
|
2260
|
-
var xMin = leftTop_1[0];
|
|
2261
|
-
var yMin = leftTop_1[1];
|
|
2262
|
-
var xMax = rightBottom_1[0];
|
|
2263
|
-
var yMax = rightBottom_1[1];
|
|
2264
|
-
leftTop_1 = [Infinity, Infinity];
|
|
2265
|
-
rightBottom_1 = [-Infinity, -Infinity];
|
|
2266
|
-
var sampleLine = function (x0, y0, x1, y1) {
|
|
2267
|
-
var dx = x1 - x0;
|
|
2268
|
-
var dy = y1 - y0;
|
|
2269
|
-
for (var i = 0; i <= 100; i++) {
|
|
2270
|
-
var p = i / 100;
|
|
2271
|
-
var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);
|
|
2272
|
-
min(leftTop_1, leftTop_1, pt);
|
|
2273
|
-
max(rightBottom_1, rightBottom_1, pt);
|
|
2274
|
-
}
|
|
2275
|
-
};
|
|
2276
|
-
sampleLine(xMin, yMin, xMax, yMin);
|
|
2277
|
-
sampleLine(xMax, yMin, xMax, yMax);
|
|
2278
|
-
sampleLine(xMax, yMax, xMin, yMax);
|
|
2279
|
-
sampleLine(xMin, yMax, xMax, yMin);
|
|
2280
|
-
}
|
|
2281
|
-
this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
var rect = this.getBoundingRect();
|
|
2285
|
-
var centerOption = geoModel.get("layoutCenter");
|
|
2286
|
-
var sizeOption = geoModel.get("layoutSize");
|
|
2287
|
-
var refContainer = createBoxLayoutReference(geoModel, api).refContainer;
|
|
2288
|
-
var aspect = rect.width / rect.height * this.aspectScale;
|
|
2289
|
-
var useCenterAndSize = false;
|
|
2290
|
-
var center;
|
|
2291
|
-
var size;
|
|
2292
|
-
if (centerOption && sizeOption) {
|
|
2293
|
-
center = [parsePercent(centerOption[0], refContainer.width) + refContainer.x, parsePercent(centerOption[1], refContainer.height) + refContainer.y];
|
|
2294
|
-
size = parsePercent(sizeOption, Math.min(refContainer.width, refContainer.height));
|
|
2295
|
-
if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) useCenterAndSize = true;
|
|
2296
|
-
}
|
|
2297
|
-
var viewRect;
|
|
2298
|
-
if (useCenterAndSize) {
|
|
2299
|
-
viewRect = {};
|
|
2300
|
-
if (aspect > 1) {
|
|
2301
|
-
viewRect.width = size;
|
|
2302
|
-
viewRect.height = size / aspect;
|
|
2303
|
-
} else {
|
|
2304
|
-
viewRect.height = size;
|
|
2305
|
-
viewRect.width = size * aspect;
|
|
2306
|
-
}
|
|
2307
|
-
viewRect.y = center[1] - viewRect.height / 2;
|
|
2308
|
-
viewRect.x = center[0] - viewRect.width / 2;
|
|
2309
|
-
} else {
|
|
2310
|
-
var boxLayoutOption = geoModel.getBoxLayoutParams();
|
|
2311
|
-
boxLayoutOption.aspect = aspect;
|
|
2312
|
-
viewRect = getLayoutRect(boxLayoutOption, refContainer);
|
|
2313
|
-
viewRect = applyPreserveAspect(geoModel, viewRect, aspect);
|
|
2314
|
-
}
|
|
2315
|
-
this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
|
|
2316
|
-
this.setCenter(geoModel.get("center"));
|
|
2317
|
-
this.setZoom(geoModel.get("zoom"));
|
|
2318
|
-
}
|
|
2319
|
-
function setGeoCoords(geo, model) {
|
|
2320
|
-
each$1(model.get("geoCoord"), function (geoCoord, name) {
|
|
2321
|
-
geo.addGeoCoord(name, geoCoord);
|
|
2322
|
-
});
|
|
2323
|
-
}
|
|
2324
|
-
//#endregion
|
|
2325
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/geo/install.js
|
|
2326
|
-
/**
|
|
2327
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2328
|
-
*/
|
|
2329
|
-
function registerMap(mapName, geoJson, specialAreas) {
|
|
2330
|
-
geoSourceManager_default.registerMap(mapName, geoJson, specialAreas);
|
|
2331
|
-
}
|
|
2332
|
-
function install(registers) {
|
|
2333
|
-
registers.registerCoordinateSystem("geo", geoCreator);
|
|
2334
|
-
registers.registerComponentModel(GeoModel);
|
|
2335
|
-
registers.registerComponentView(GeoView);
|
|
2336
|
-
registers.registerImpl("registerMap", registerMap);
|
|
2337
|
-
registers.registerImpl("getMap", function (mapName) {
|
|
2338
|
-
return geoSourceManager_default.getMapForUser(mapName);
|
|
2339
|
-
});
|
|
2340
|
-
function makeAction(method, actionInfo) {
|
|
2341
|
-
actionInfo.update = "geo:updateSelectStatus";
|
|
2342
|
-
registers.registerAction(actionInfo, function (payload, ecModel) {
|
|
2343
|
-
var selected = {};
|
|
2344
|
-
var allSelected = [];
|
|
2345
|
-
ecModel.eachComponent({
|
|
2346
|
-
mainType: "geo",
|
|
2347
|
-
query: payload
|
|
2348
|
-
}, function (geoModel) {
|
|
2349
|
-
geoModel[method](payload.name);
|
|
2350
|
-
var geo = geoModel.coordinateSystem;
|
|
2351
|
-
each$1(geo.regions, function (region) {
|
|
2352
|
-
selected[region.name] = geoModel.isSelected(region.name) || false;
|
|
2353
|
-
});
|
|
2354
|
-
var names = [];
|
|
2355
|
-
each$1(selected, function (v, name) {
|
|
2356
|
-
selected[name] && names.push(name);
|
|
2357
|
-
});
|
|
2358
|
-
allSelected.push({
|
|
2359
|
-
geoIndex: geoModel.componentIndex,
|
|
2360
|
-
name: names
|
|
2361
|
-
});
|
|
2362
|
-
});
|
|
2363
|
-
return {
|
|
2364
|
-
selected,
|
|
2365
|
-
allSelected,
|
|
2366
|
-
name: payload.name
|
|
2367
|
-
};
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
makeAction("toggleSelected", {
|
|
2371
|
-
type: "geoToggleSelect",
|
|
2372
|
-
event: "geoselectchanged"
|
|
2373
|
-
});
|
|
2374
|
-
makeAction("select", {
|
|
2375
|
-
type: "geoSelect",
|
|
2376
|
-
event: "geoselected"
|
|
2377
|
-
});
|
|
2378
|
-
makeAction("unSelect", {
|
|
2379
|
-
type: "geoUnSelect",
|
|
2380
|
-
event: "geounselected"
|
|
2381
|
-
});
|
|
2382
|
-
/**
|
|
2383
|
-
* @payload
|
|
2384
|
-
* @property {string} [componentType=series]
|
|
2385
|
-
* @property {number} [dx]
|
|
2386
|
-
* @property {number} [dy]
|
|
2387
|
-
* @property {number} [zoom]
|
|
2388
|
-
* @property {number} [originX]
|
|
2389
|
-
* @property {number} [originY]
|
|
2390
|
-
*/
|
|
2391
|
-
registers.registerAction({
|
|
2392
|
-
type: "geoRoam",
|
|
2393
|
-
event: "geoRoam",
|
|
2394
|
-
update: "updateTransform"
|
|
2395
|
-
}, function (payload, ecModel, api) {
|
|
2396
|
-
var componentType = payload.componentType;
|
|
2397
|
-
if (!componentType) {
|
|
2398
|
-
if (payload.geoId != null) componentType = "geo";else if (payload.seriesId != null) componentType = "series";
|
|
2399
|
-
}
|
|
2400
|
-
if (!componentType) componentType = "series";
|
|
2401
|
-
ecModel.eachComponent({
|
|
2402
|
-
mainType: componentType,
|
|
2403
|
-
query: payload
|
|
2404
|
-
}, function (componentModel) {
|
|
2405
|
-
var geo = componentModel.coordinateSystem;
|
|
2406
|
-
if (geo.type !== "geo") return;
|
|
2407
|
-
var res = updateCenterAndZoomInAction(geo, payload, componentModel.get("scaleLimit"));
|
|
2408
|
-
componentModel.setCenter && componentModel.setCenter(res.center);
|
|
2409
|
-
componentModel.setZoom && componentModel.setZoom(res.zoom);
|
|
2410
|
-
if (componentType === "series") each$1(componentModel.seriesGroup, function (seriesModel) {
|
|
2411
|
-
seriesModel.setCenter(res.center);
|
|
2412
|
-
seriesModel.setZoom(res.zoom);
|
|
2413
|
-
});
|
|
2414
|
-
});
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
//#endregion
|
|
2419
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/visual/VisualMapping.js
|
|
2420
|
-
/**
|
|
2421
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2422
|
-
*/
|
|
2423
|
-
|
|
2424
|
-
function preprocessForPiecewise(thisOption) {
|
|
2425
|
-
var pieceList = thisOption.pieceList;
|
|
2426
|
-
thisOption.hasSpecialVisual = false;
|
|
2427
|
-
each$1(pieceList, function (piece, index) {
|
|
2428
|
-
piece.originIndex = index;
|
|
2429
|
-
if (piece.visual != null) thisOption.hasSpecialVisual = true;
|
|
2430
|
-
});
|
|
2431
|
-
}
|
|
2432
|
-
function preprocessForSpecifiedCategory(thisOption) {
|
|
2433
|
-
var categories = thisOption.categories;
|
|
2434
|
-
var categoryMap = thisOption.categoryMap = {};
|
|
2435
|
-
var visual = thisOption.visual;
|
|
2436
|
-
each(categories, function (cate, index) {
|
|
2437
|
-
categoryMap[cate] = index;
|
|
2438
|
-
});
|
|
2439
|
-
if (!isArray(visual)) {
|
|
2440
|
-
var visualArr_1 = [];
|
|
2441
|
-
if (isObject$1(visual)) each(visual, function (v, cate) {
|
|
2442
|
-
var index = categoryMap[cate];
|
|
2443
|
-
visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;
|
|
2444
|
-
});else visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;
|
|
2445
|
-
visual = setVisualToOption(thisOption, visualArr_1);
|
|
2446
|
-
}
|
|
2447
|
-
for (var i = categories.length - 1; i >= 0; i--) if (visual[i] == null) {
|
|
2448
|
-
delete categoryMap[categories[i]];
|
|
2449
|
-
categories.pop();
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
function normalizeVisualRange(thisOption, isCategory) {
|
|
2453
|
-
var visual = thisOption.visual;
|
|
2454
|
-
var visualArr = [];
|
|
2455
|
-
if (isObject$1(visual)) each(visual, function (v) {
|
|
2456
|
-
visualArr.push(v);
|
|
2457
|
-
});else if (visual != null) visualArr.push(visual);
|
|
2458
|
-
if (!isCategory && visualArr.length === 1 && !{
|
|
2459
|
-
color: 1,
|
|
2460
|
-
symbol: 1
|
|
2461
|
-
}.hasOwnProperty(thisOption.type)) visualArr[1] = visualArr[0];
|
|
2462
|
-
setVisualToOption(thisOption, visualArr);
|
|
2463
|
-
}
|
|
2464
|
-
function makePartialColorVisualHandler(applyValue) {
|
|
2465
|
-
return {
|
|
2466
|
-
applyVisual: function (value, getter, setter) {
|
|
2467
|
-
var colorChannel = this.mapValueToVisual(value);
|
|
2468
|
-
setter("color", applyValue(getter("color"), colorChannel));
|
|
2469
|
-
},
|
|
2470
|
-
_normalizedToVisual: createNormalizedToNumericVisual([0, 1])
|
|
2471
|
-
};
|
|
2472
|
-
}
|
|
2473
|
-
function doMapToArray(normalized) {
|
|
2474
|
-
var visual = this.option.visual;
|
|
2475
|
-
return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};
|
|
2476
|
-
}
|
|
2477
|
-
function makeApplyVisual(visualType) {
|
|
2478
|
-
return function (value, getter, setter) {
|
|
2479
|
-
setter(visualType, this.mapValueToVisual(value));
|
|
2480
|
-
};
|
|
2481
|
-
}
|
|
2482
|
-
function doMapCategory(normalized) {
|
|
2483
|
-
var visual = this.option.visual;
|
|
2484
|
-
return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];
|
|
2485
|
-
}
|
|
2486
|
-
function doMapFixed() {
|
|
2487
|
-
return this.option.visual[0];
|
|
2488
|
-
}
|
|
2489
|
-
/**
|
|
2490
|
-
* Create mapped to numeric visual
|
|
2491
|
-
*/
|
|
2492
|
-
function createNormalizedToNumericVisual(sourceExtent) {
|
|
2493
|
-
return {
|
|
2494
|
-
linear: function (normalized) {
|
|
2495
|
-
return linearMap(normalized, sourceExtent, this.option.visual, true);
|
|
2496
|
-
},
|
|
2497
|
-
category: doMapCategory,
|
|
2498
|
-
piecewise: function (normalized, value) {
|
|
2499
|
-
var result = getSpecifiedVisual.call(this, value);
|
|
2500
|
-
if (result == null) result = linearMap(normalized, sourceExtent, this.option.visual, true);
|
|
2501
|
-
return result;
|
|
2502
|
-
},
|
|
2503
|
-
fixed: doMapFixed
|
|
2504
|
-
};
|
|
2505
|
-
}
|
|
2506
|
-
function getSpecifiedVisual(value) {
|
|
2507
|
-
var thisOption = this.option;
|
|
2508
|
-
var pieceList = thisOption.pieceList;
|
|
2509
|
-
if (thisOption.hasSpecialVisual) {
|
|
2510
|
-
var piece = pieceList[VisualMapping.findPieceIndex(value, pieceList)];
|
|
2511
|
-
if (piece && piece.visual) return piece.visual[this.type];
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
function setVisualToOption(thisOption, visualArr) {
|
|
2515
|
-
thisOption.visual = visualArr;
|
|
2516
|
-
if (thisOption.type === "color") thisOption.parsedVisual = map(visualArr, function (item) {
|
|
2517
|
-
return parse(item) || [0, 0, 0, 1];
|
|
2518
|
-
});
|
|
2519
|
-
return visualArr;
|
|
2520
|
-
}
|
|
2521
|
-
/**
|
|
2522
|
-
* Normalizers by mapping methods.
|
|
2523
|
-
*/
|
|
2524
|
-
|
|
2525
|
-
function littleThan(close, a, b) {
|
|
2526
|
-
return close ? a <= b : a < b;
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
//#endregion
|
|
2530
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/chart/helper/LinePath.js
|
|
2531
|
-
/**
|
|
2532
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2533
|
-
*/
|
|
2534
|
-
/**
|
|
2535
|
-
* Line path for bezier and straight line draw
|
|
2536
|
-
*/
|
|
2537
|
-
|
|
2538
|
-
function isStraightLine(shape) {
|
|
2539
|
-
return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);
|
|
2540
|
-
}
|
|
2541
|
-
function makeSymbolTypeKey(symbolCategory) {
|
|
2542
|
-
return "_" + symbolCategory + "Type";
|
|
2543
|
-
}
|
|
2544
|
-
function makeSymbolTypeValue(name, lineData, idx) {
|
|
2545
|
-
var symbolType = lineData.getItemVisual(idx, name);
|
|
2546
|
-
if (!symbolType || symbolType === "none") return symbolType;
|
|
2547
|
-
var symbolSize = lineData.getItemVisual(idx, name + "Size");
|
|
2548
|
-
var symbolRotate = lineData.getItemVisual(idx, name + "Rotate");
|
|
2549
|
-
var symbolOffset = lineData.getItemVisual(idx, name + "Offset");
|
|
2550
|
-
var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect");
|
|
2551
|
-
var symbolSizeArr = normalizeSymbolSize(symbolSize);
|
|
2552
|
-
var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);
|
|
2553
|
-
return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || "") + (symbolKeepAspect || "");
|
|
2554
|
-
}
|
|
2555
|
-
/**
|
|
2556
|
-
* @inner
|
|
2557
|
-
*/
|
|
2558
|
-
function createSymbol(name, lineData, idx) {
|
|
2559
|
-
var symbolType = lineData.getItemVisual(idx, name);
|
|
2560
|
-
if (!symbolType || symbolType === "none") return;
|
|
2561
|
-
var symbolSize = lineData.getItemVisual(idx, name + "Size");
|
|
2562
|
-
var symbolRotate = lineData.getItemVisual(idx, name + "Rotate");
|
|
2563
|
-
var symbolOffset = lineData.getItemVisual(idx, name + "Offset");
|
|
2564
|
-
var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect");
|
|
2565
|
-
var symbolSizeArr = normalizeSymbolSize(symbolSize);
|
|
2566
|
-
var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);
|
|
2567
|
-
var symbolPath = createSymbol$1(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);
|
|
2568
|
-
symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;
|
|
2569
|
-
symbolPath.name = name;
|
|
2570
|
-
return symbolPath;
|
|
2571
|
-
}
|
|
2572
|
-
function createLine(points) {
|
|
2573
|
-
var line = new ECLinePath({
|
|
2574
|
-
name: "line",
|
|
2575
|
-
subPixelOptimize: true
|
|
2576
|
-
});
|
|
2577
|
-
setLinePoints(line.shape, points);
|
|
2578
|
-
return line;
|
|
2579
|
-
}
|
|
2580
|
-
function setLinePoints(targetShape, points) {
|
|
2581
|
-
targetShape.x1 = points[0][0];
|
|
2582
|
-
targetShape.y1 = points[0][1];
|
|
2583
|
-
targetShape.x2 = points[1][0];
|
|
2584
|
-
targetShape.y2 = points[1][1];
|
|
2585
|
-
targetShape.percent = 1;
|
|
2586
|
-
var cp1 = points[2];
|
|
2587
|
-
if (cp1) {
|
|
2588
|
-
targetShape.cpx1 = cp1[0];
|
|
2589
|
-
targetShape.cpy1 = cp1[1];
|
|
2590
|
-
} else {
|
|
2591
|
-
targetShape.cpx1 = NaN;
|
|
2592
|
-
targetShape.cpy1 = NaN;
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
function isEffectObject(el) {
|
|
2596
|
-
return el.animators && el.animators.length > 0;
|
|
2597
|
-
}
|
|
2598
|
-
function makeSeriesScope(lineData) {
|
|
2599
|
-
var hostModel = lineData.hostModel;
|
|
2600
|
-
var emphasisModel = hostModel.getModel("emphasis");
|
|
2601
|
-
return {
|
|
2602
|
-
lineStyle: hostModel.getModel("lineStyle").getLineStyle(),
|
|
2603
|
-
emphasisLineStyle: emphasisModel.getModel(["lineStyle"]).getLineStyle(),
|
|
2604
|
-
blurLineStyle: hostModel.getModel(["blur", "lineStyle"]).getLineStyle(),
|
|
2605
|
-
selectLineStyle: hostModel.getModel(["select", "lineStyle"]).getLineStyle(),
|
|
2606
|
-
emphasisDisabled: emphasisModel.get("disabled"),
|
|
2607
|
-
blurScope: emphasisModel.get("blurScope"),
|
|
2608
|
-
focus: emphasisModel.get("focus"),
|
|
2609
|
-
labelStatesModels: getLabelStatesModels(hostModel)
|
|
2610
|
-
};
|
|
2611
|
-
}
|
|
2612
|
-
function isPointNaN(pt) {
|
|
2613
|
-
return isNaN(pt[0]) || isNaN(pt[1]);
|
|
2614
|
-
}
|
|
2615
|
-
function lineNeedsDraw(pts) {
|
|
2616
|
-
return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
//#endregion
|
|
2620
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/sliderMove.js
|
|
2621
|
-
/**
|
|
2622
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2623
|
-
*/
|
|
2624
|
-
/**
|
|
2625
|
-
* Calculate slider move result.
|
|
2626
|
-
* Usage:
|
|
2627
|
-
* (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as
|
|
2628
|
-
* maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.
|
|
2629
|
-
* (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.
|
|
2630
|
-
*
|
|
2631
|
-
* @param delta Move length.
|
|
2632
|
-
* @param handleEnds handleEnds[0] can be bigger then handleEnds[1].
|
|
2633
|
-
* handleEnds will be modified in this method.
|
|
2634
|
-
* @param extent handleEnds is restricted by extent.
|
|
2635
|
-
* extent[0] should less or equals than extent[1].
|
|
2636
|
-
* @param handleIndex Can be 'all', means that both move the two handleEnds.
|
|
2637
|
-
* @param minSpan The range of dataZoom can not be smaller than that.
|
|
2638
|
-
* If not set, handle0 and cross handle1. If set as a non-negative
|
|
2639
|
-
* number (including `0`), handles will push each other when reaching
|
|
2640
|
-
* the minSpan.
|
|
2641
|
-
* @param maxSpan The range of dataZoom can not be larger than that.
|
|
2642
|
-
* @return The input handleEnds.
|
|
2643
|
-
*/
|
|
2644
|
-
function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {
|
|
2645
|
-
delta = delta || 0;
|
|
2646
|
-
var extentSpan = extent[1] - extent[0];
|
|
2647
|
-
if (minSpan != null) minSpan = restrict(minSpan, [0, extentSpan]);
|
|
2648
|
-
if (maxSpan != null) maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);
|
|
2649
|
-
if (handleIndex === "all") {
|
|
2650
|
-
var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);
|
|
2651
|
-
handleSpan = restrict(handleSpan, [0, extentSpan]);
|
|
2652
|
-
minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);
|
|
2653
|
-
handleIndex = 0;
|
|
2654
|
-
}
|
|
2655
|
-
handleEnds[0] = restrict(handleEnds[0], extent);
|
|
2656
|
-
handleEnds[1] = restrict(handleEnds[1], extent);
|
|
2657
|
-
var originalDistSign = getSpanSign(handleEnds, handleIndex);
|
|
2658
|
-
handleEnds[handleIndex] += delta;
|
|
2659
|
-
var extentMinSpan = minSpan || 0;
|
|
2660
|
-
var realExtent = extent.slice();
|
|
2661
|
-
originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;
|
|
2662
|
-
handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);
|
|
2663
|
-
var currDistSign = getSpanSign(handleEnds, handleIndex);
|
|
2664
|
-
if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;
|
|
2665
|
-
currDistSign = getSpanSign(handleEnds, handleIndex);
|
|
2666
|
-
if (maxSpan != null && currDistSign.span > maxSpan) handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;
|
|
2667
|
-
return handleEnds;
|
|
2668
|
-
}
|
|
2669
|
-
function getSpanSign(handleEnds, handleIndex) {
|
|
2670
|
-
var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];
|
|
2671
|
-
return {
|
|
2672
|
-
span: Math.abs(dist),
|
|
2673
|
-
sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1
|
|
2674
|
-
};
|
|
2675
|
-
}
|
|
2676
|
-
function restrict(value, extend) {
|
|
2677
|
-
return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
//#endregion
|
|
2681
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/BrushController.js
|
|
2682
|
-
/**
|
|
2683
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
2684
|
-
*/
|
|
2685
|
-
|
|
2686
|
-
function createCover(controller, brushOption) {
|
|
2687
|
-
var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);
|
|
2688
|
-
cover.__brushOption = brushOption;
|
|
2689
|
-
updateZ(cover, brushOption);
|
|
2690
|
-
controller.group.add(cover);
|
|
2691
|
-
return cover;
|
|
2692
|
-
}
|
|
2693
|
-
function endCreating(controller, creatingCover) {
|
|
2694
|
-
var coverRenderer = getCoverRenderer(creatingCover);
|
|
2695
|
-
if (coverRenderer.endCreating) {
|
|
2696
|
-
coverRenderer.endCreating(controller, creatingCover);
|
|
2697
|
-
updateZ(creatingCover, creatingCover.__brushOption);
|
|
2698
|
-
}
|
|
2699
|
-
return creatingCover;
|
|
2700
|
-
}
|
|
2701
|
-
function updateCoverShape(controller, cover) {
|
|
2702
|
-
var brushOption = cover.__brushOption;
|
|
2703
|
-
getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);
|
|
2704
|
-
}
|
|
2705
|
-
function updateZ(cover, brushOption) {
|
|
2706
|
-
var z = brushOption.z;
|
|
2707
|
-
z ??= COVER_Z;
|
|
2708
|
-
cover.traverse(function (el) {
|
|
2709
|
-
el.z = z;
|
|
2710
|
-
el.z2 = z;
|
|
2711
|
-
});
|
|
2712
|
-
}
|
|
2713
|
-
function updateCoverAfterCreation(controller, cover) {
|
|
2714
|
-
getCoverRenderer(cover).updateCommon(controller, cover);
|
|
2715
|
-
updateCoverShape(controller, cover);
|
|
2716
|
-
}
|
|
2717
|
-
function getCoverRenderer(cover) {
|
|
2718
|
-
return coverRenderers[cover.__brushOption.brushType];
|
|
2719
|
-
}
|
|
2720
|
-
function getPanelByPoint(controller, e, localCursorPoint) {
|
|
2721
|
-
var panels = controller._panels;
|
|
2722
|
-
if (!panels) return BRUSH_PANEL_GLOBAL;
|
|
2723
|
-
var panel;
|
|
2724
|
-
var transform = controller._transform;
|
|
2725
|
-
each$1(panels, function (pn) {
|
|
2726
|
-
pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);
|
|
2727
|
-
});
|
|
2728
|
-
return panel;
|
|
2729
|
-
}
|
|
2730
|
-
function getPanelByCover(controller, cover) {
|
|
2731
|
-
var panels = controller._panels;
|
|
2732
|
-
if (!panels) return BRUSH_PANEL_GLOBAL;
|
|
2733
|
-
var panelId = cover.__brushOption.panelId;
|
|
2734
|
-
return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;
|
|
2735
|
-
}
|
|
2736
|
-
function clearCovers(controller) {
|
|
2737
|
-
var covers = controller._covers;
|
|
2738
|
-
var originalLength = covers.length;
|
|
2739
|
-
each$1(covers, function (cover) {
|
|
2740
|
-
controller.group.remove(cover);
|
|
2741
|
-
}, controller);
|
|
2742
|
-
covers.length = 0;
|
|
2743
|
-
return !!originalLength;
|
|
2744
|
-
}
|
|
2745
|
-
function trigger(controller, opt) {
|
|
2746
|
-
var areas = map(controller._covers, function (cover) {
|
|
2747
|
-
var brushOption = cover.__brushOption;
|
|
2748
|
-
var range = clone(brushOption.range);
|
|
2749
|
-
return {
|
|
2750
|
-
brushType: brushOption.brushType,
|
|
2751
|
-
panelId: brushOption.panelId,
|
|
2752
|
-
range
|
|
2753
|
-
};
|
|
2754
|
-
});
|
|
2755
|
-
controller.trigger("brush", {
|
|
2756
|
-
areas,
|
|
2757
|
-
isEnd: !!opt.isEnd,
|
|
2758
|
-
removeOnClick: !!opt.removeOnClick
|
|
2759
|
-
});
|
|
2760
|
-
}
|
|
2761
|
-
function shouldShowCover(controller) {
|
|
2762
|
-
var track = controller._track;
|
|
2763
|
-
if (!track.length) return false;
|
|
2764
|
-
var p2 = track[track.length - 1];
|
|
2765
|
-
var p1 = track[0];
|
|
2766
|
-
var dx = p2[0] - p1[0];
|
|
2767
|
-
var dy = p2[1] - p1[1];
|
|
2768
|
-
return mathPow(dx * dx + dy * dy, .5) > UNSELECT_THRESHOLD;
|
|
2769
|
-
}
|
|
2770
|
-
function getTrackEnds(track) {
|
|
2771
|
-
var tail = track.length - 1;
|
|
2772
|
-
tail < 0 && (tail = 0);
|
|
2773
|
-
return [track[0], track[tail]];
|
|
2774
|
-
}
|
|
2775
|
-
function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {
|
|
2776
|
-
var cover = new Group();
|
|
2777
|
-
cover.add(new Rect({
|
|
2778
|
-
name: "main",
|
|
2779
|
-
style: makeStyle(brushOption),
|
|
2780
|
-
silent: true,
|
|
2781
|
-
draggable: true,
|
|
2782
|
-
cursor: "move",
|
|
2783
|
-
drift: curry(driftRect, rectRangeConverter, controller, cover, ["n", "s", "w", "e"]),
|
|
2784
|
-
ondragend: curry(trigger, controller, {
|
|
2785
|
-
isEnd: true
|
|
2786
|
-
})
|
|
2787
|
-
}));
|
|
2788
|
-
each$1(edgeNameSequences, function (nameSequence) {
|
|
2789
|
-
cover.add(new Rect({
|
|
2790
|
-
name: nameSequence.join(""),
|
|
2791
|
-
style: {
|
|
2792
|
-
opacity: 0
|
|
2793
|
-
},
|
|
2794
|
-
draggable: true,
|
|
2795
|
-
silent: true,
|
|
2796
|
-
invisible: true,
|
|
2797
|
-
drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),
|
|
2798
|
-
ondragend: curry(trigger, controller, {
|
|
2799
|
-
isEnd: true
|
|
2800
|
-
})
|
|
2801
|
-
}));
|
|
2802
|
-
});
|
|
2803
|
-
return cover;
|
|
2804
|
-
}
|
|
2805
|
-
function updateBaseRect(controller, cover, localRange, brushOption) {
|
|
2806
|
-
var lineWidth = brushOption.brushStyle.lineWidth || 0;
|
|
2807
|
-
var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);
|
|
2808
|
-
var x = localRange[0][0];
|
|
2809
|
-
var y = localRange[1][0];
|
|
2810
|
-
var xa = x - lineWidth / 2;
|
|
2811
|
-
var ya = y - lineWidth / 2;
|
|
2812
|
-
var x2 = localRange[0][1];
|
|
2813
|
-
var y2 = localRange[1][1];
|
|
2814
|
-
var x2a = x2 - handleSize + lineWidth / 2;
|
|
2815
|
-
var y2a = y2 - handleSize + lineWidth / 2;
|
|
2816
|
-
var width = x2 - x;
|
|
2817
|
-
var height = y2 - y;
|
|
2818
|
-
var widtha = width + lineWidth;
|
|
2819
|
-
var heighta = height + lineWidth;
|
|
2820
|
-
updateRectShape(controller, cover, "main", x, y, width, height);
|
|
2821
|
-
if (brushOption.transformable) {
|
|
2822
|
-
updateRectShape(controller, cover, "w", xa, ya, handleSize, heighta);
|
|
2823
|
-
updateRectShape(controller, cover, "e", x2a, ya, handleSize, heighta);
|
|
2824
|
-
updateRectShape(controller, cover, "n", xa, ya, widtha, handleSize);
|
|
2825
|
-
updateRectShape(controller, cover, "s", xa, y2a, widtha, handleSize);
|
|
2826
|
-
updateRectShape(controller, cover, "nw", xa, ya, handleSize, handleSize);
|
|
2827
|
-
updateRectShape(controller, cover, "ne", x2a, ya, handleSize, handleSize);
|
|
2828
|
-
updateRectShape(controller, cover, "sw", xa, y2a, handleSize, handleSize);
|
|
2829
|
-
updateRectShape(controller, cover, "se", x2a, y2a, handleSize, handleSize);
|
|
2830
|
-
}
|
|
2831
|
-
}
|
|
2832
|
-
function updateCommon(controller, cover) {
|
|
2833
|
-
var brushOption = cover.__brushOption;
|
|
2834
|
-
var transformable = brushOption.transformable;
|
|
2835
|
-
var mainEl = cover.childAt(0);
|
|
2836
|
-
mainEl.useStyle(makeStyle(brushOption));
|
|
2837
|
-
mainEl.attr({
|
|
2838
|
-
silent: !transformable,
|
|
2839
|
-
cursor: transformable ? "move" : "default"
|
|
2840
|
-
});
|
|
2841
|
-
each$1([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function (nameSequence) {
|
|
2842
|
-
var el = cover.childOfName(nameSequence.join(""));
|
|
2843
|
-
var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);
|
|
2844
|
-
el && el.attr({
|
|
2845
|
-
silent: !transformable,
|
|
2846
|
-
invisible: !transformable,
|
|
2847
|
-
cursor: transformable ? CURSOR_MAP[globalDir] + "-resize" : null
|
|
2848
|
-
});
|
|
2849
|
-
});
|
|
2850
|
-
}
|
|
2851
|
-
function updateRectShape(controller, cover, name, x, y, w, h) {
|
|
2852
|
-
var el = cover.childOfName(name);
|
|
2853
|
-
el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));
|
|
2854
|
-
}
|
|
2855
|
-
function makeStyle(brushOption) {
|
|
2856
|
-
return defaults({
|
|
2857
|
-
strokeNoScale: true
|
|
2858
|
-
}, brushOption.brushStyle);
|
|
2859
|
-
}
|
|
2860
|
-
function formatRectRange(x, y, x2, y2) {
|
|
2861
|
-
var min = [mathMin(x, x2), mathMin(y, y2)];
|
|
2862
|
-
var max = [mathMax(x, x2), mathMax(y, y2)];
|
|
2863
|
-
return [[min[0], max[0]], [min[1], max[1]]];
|
|
2864
|
-
}
|
|
2865
|
-
function getTransform(controller) {
|
|
2866
|
-
return getTransform$1(controller.group);
|
|
2867
|
-
}
|
|
2868
|
-
function getGlobalDirection1(controller, localDirName) {
|
|
2869
|
-
return {
|
|
2870
|
-
left: "w",
|
|
2871
|
-
right: "e",
|
|
2872
|
-
top: "n",
|
|
2873
|
-
bottom: "s"
|
|
2874
|
-
}[transformDirection({
|
|
2875
|
-
w: "left",
|
|
2876
|
-
e: "right",
|
|
2877
|
-
n: "top",
|
|
2878
|
-
s: "bottom"
|
|
2879
|
-
}[localDirName], getTransform(controller))];
|
|
2880
|
-
}
|
|
2881
|
-
function getGlobalDirection2(controller, localDirNameSeq) {
|
|
2882
|
-
var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];
|
|
2883
|
-
(globalDir[0] === "e" || globalDir[0] === "w") && globalDir.reverse();
|
|
2884
|
-
return globalDir.join("");
|
|
2885
|
-
}
|
|
2886
|
-
function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {
|
|
2887
|
-
var brushOption = cover.__brushOption;
|
|
2888
|
-
var rectRange = rectRangeConverter.toRectRange(brushOption.range);
|
|
2889
|
-
var localDelta = toLocalDelta(controller, dx, dy);
|
|
2890
|
-
each$1(dirNameSequence, function (dirName) {
|
|
2891
|
-
var ind = DIRECTION_MAP[dirName];
|
|
2892
|
-
rectRange[ind[0]][ind[1]] += localDelta[ind[0]];
|
|
2893
|
-
});
|
|
2894
|
-
brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));
|
|
2895
|
-
updateCoverAfterCreation(controller, cover);
|
|
2896
|
-
trigger(controller, {
|
|
2897
|
-
isEnd: false
|
|
2898
|
-
});
|
|
2899
|
-
}
|
|
2900
|
-
function driftPolygon(controller, cover, dx, dy) {
|
|
2901
|
-
var range = cover.__brushOption.range;
|
|
2902
|
-
var localDelta = toLocalDelta(controller, dx, dy);
|
|
2903
|
-
each$1(range, function (point) {
|
|
2904
|
-
point[0] += localDelta[0];
|
|
2905
|
-
point[1] += localDelta[1];
|
|
2906
|
-
});
|
|
2907
|
-
updateCoverAfterCreation(controller, cover);
|
|
2908
|
-
trigger(controller, {
|
|
2909
|
-
isEnd: false
|
|
2910
|
-
});
|
|
2911
|
-
}
|
|
2912
|
-
function toLocalDelta(controller, dx, dy) {
|
|
2913
|
-
var thisGroup = controller.group;
|
|
2914
|
-
var localD = thisGroup.transformCoordToLocal(dx, dy);
|
|
2915
|
-
var localZero = thisGroup.transformCoordToLocal(0, 0);
|
|
2916
|
-
return [localD[0] - localZero[0], localD[1] - localZero[1]];
|
|
2917
|
-
}
|
|
2918
|
-
function clipByPanel(controller, cover, data) {
|
|
2919
|
-
var panel = getPanelByCover(controller, cover);
|
|
2920
|
-
return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);
|
|
2921
|
-
}
|
|
2922
|
-
function pointsToRect(points) {
|
|
2923
|
-
var xmin = mathMin(points[0][0], points[1][0]);
|
|
2924
|
-
var ymin = mathMin(points[0][1], points[1][1]);
|
|
2925
|
-
var xmax = mathMax(points[0][0], points[1][0]);
|
|
2926
|
-
var ymax = mathMax(points[0][1], points[1][1]);
|
|
2927
|
-
return {
|
|
2928
|
-
x: xmin,
|
|
2929
|
-
y: ymin,
|
|
2930
|
-
width: xmax - xmin,
|
|
2931
|
-
height: ymax - ymin
|
|
2932
|
-
};
|
|
2933
|
-
}
|
|
2934
|
-
function resetCursor(controller, e, localCursorPoint) {
|
|
2935
|
-
if (!controller._brushType || isOutsideZrArea(controller, e.offsetX, e.offsetY)) return;
|
|
2936
|
-
var zr = controller._zr;
|
|
2937
|
-
var covers = controller._covers;
|
|
2938
|
-
var currPanel = getPanelByPoint(controller, e, localCursorPoint);
|
|
2939
|
-
if (!controller._dragging) for (var i = 0; i < covers.length; i++) {
|
|
2940
|
-
var brushOption = covers[i].__brushOption;
|
|
2941
|
-
if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) return;
|
|
2942
|
-
}
|
|
2943
|
-
currPanel && zr.setCursorStyle("crosshair");
|
|
2944
|
-
}
|
|
2945
|
-
function preventDefault(e) {
|
|
2946
|
-
var rawE = e.event;
|
|
2947
|
-
rawE.preventDefault && rawE.preventDefault();
|
|
2948
|
-
}
|
|
2949
|
-
function mainShapeContain(cover, x, y) {
|
|
2950
|
-
return cover.childOfName("main").contain(x, y);
|
|
2951
|
-
}
|
|
2952
|
-
function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {
|
|
2953
|
-
var creatingCover = controller._creatingCover;
|
|
2954
|
-
var panel = controller._creatingPanel;
|
|
2955
|
-
var thisBrushOption = controller._brushOption;
|
|
2956
|
-
var eventParams;
|
|
2957
|
-
controller._track.push(localCursorPoint.slice());
|
|
2958
|
-
if (shouldShowCover(controller) || creatingCover) {
|
|
2959
|
-
if (panel && !creatingCover) {
|
|
2960
|
-
thisBrushOption.brushMode === "single" && clearCovers(controller);
|
|
2961
|
-
var brushOption = clone(thisBrushOption);
|
|
2962
|
-
brushOption.brushType = determineBrushType(brushOption.brushType, panel);
|
|
2963
|
-
brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;
|
|
2964
|
-
creatingCover = controller._creatingCover = createCover(controller, brushOption);
|
|
2965
|
-
controller._covers.push(creatingCover);
|
|
2966
|
-
}
|
|
2967
|
-
if (creatingCover) {
|
|
2968
|
-
var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];
|
|
2969
|
-
var coverBrushOption = creatingCover.__brushOption;
|
|
2970
|
-
coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));
|
|
2971
|
-
if (isEnd) {
|
|
2972
|
-
endCreating(controller, creatingCover);
|
|
2973
|
-
coverRenderer.updateCommon(controller, creatingCover);
|
|
2974
|
-
}
|
|
2975
|
-
updateCoverShape(controller, creatingCover);
|
|
2976
|
-
eventParams = {
|
|
2977
|
-
isEnd
|
|
2978
|
-
};
|
|
2979
|
-
}
|
|
2980
|
-
} else if (isEnd && thisBrushOption.brushMode === "single" && thisBrushOption.removeOnClick) {
|
|
2981
|
-
if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) eventParams = {
|
|
2982
|
-
isEnd,
|
|
2983
|
-
removeOnClick: true
|
|
2984
|
-
};
|
|
2985
|
-
}
|
|
2986
|
-
return eventParams;
|
|
2987
|
-
}
|
|
2988
|
-
function determineBrushType(brushType, panel) {
|
|
2989
|
-
if (brushType === "auto") return panel.defaultBrushType;
|
|
2990
|
-
return brushType;
|
|
2991
|
-
}
|
|
2992
|
-
function handleDragEnd(controller, e) {
|
|
2993
|
-
if (controller._dragging) {
|
|
2994
|
-
preventDefault(e);
|
|
2995
|
-
var x = e.offsetX;
|
|
2996
|
-
var y = e.offsetY;
|
|
2997
|
-
var eventParams = updateCoverByMouse(controller, e, controller.group.transformCoordToLocal(x, y), true);
|
|
2998
|
-
controller._dragging = false;
|
|
2999
|
-
controller._track = [];
|
|
3000
|
-
controller._creatingCover = null;
|
|
3001
|
-
eventParams && trigger(controller, eventParams);
|
|
3002
|
-
}
|
|
3003
|
-
}
|
|
3004
|
-
function isOutsideZrArea(controller, x, y) {
|
|
3005
|
-
var zr = controller._zr;
|
|
3006
|
-
return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
|
|
3007
|
-
}
|
|
3008
|
-
/**
|
|
3009
|
-
* key: brushType
|
|
3010
|
-
*/
|
|
3011
|
-
|
|
3012
|
-
function getLineRenderer(xyIndex) {
|
|
3013
|
-
return {
|
|
3014
|
-
createCover: function (controller, brushOption) {
|
|
3015
|
-
return createBaseRectCover({
|
|
3016
|
-
toRectRange: function (range) {
|
|
3017
|
-
var rectRange = [range, [0, 100]];
|
|
3018
|
-
xyIndex && rectRange.reverse();
|
|
3019
|
-
return rectRange;
|
|
3020
|
-
},
|
|
3021
|
-
fromRectRange: function (rectRange) {
|
|
3022
|
-
return rectRange[xyIndex];
|
|
3023
|
-
}
|
|
3024
|
-
}, controller, brushOption, [[["w"], ["e"]], [["n"], ["s"]]][xyIndex]);
|
|
3025
|
-
},
|
|
3026
|
-
getCreatingRange: function (localTrack) {
|
|
3027
|
-
var ends = getTrackEnds(localTrack);
|
|
3028
|
-
return [mathMin(ends[0][xyIndex], ends[1][xyIndex]), mathMax(ends[0][xyIndex], ends[1][xyIndex])];
|
|
3029
|
-
},
|
|
3030
|
-
updateCoverShape: function (controller, cover, localRange, brushOption) {
|
|
3031
|
-
var otherExtent;
|
|
3032
|
-
var panel = getPanelByCover(controller, cover);
|
|
3033
|
-
if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) otherExtent = panel.getLinearBrushOtherExtent(xyIndex);else {
|
|
3034
|
-
var zr = controller._zr;
|
|
3035
|
-
otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];
|
|
3036
|
-
}
|
|
3037
|
-
var rectRange = [localRange, otherExtent];
|
|
3038
|
-
xyIndex && rectRange.reverse();
|
|
3039
|
-
updateBaseRect(controller, cover, rectRange, brushOption);
|
|
3040
|
-
},
|
|
3041
|
-
updateCommon,
|
|
3042
|
-
contain: mainShapeContain
|
|
3043
|
-
};
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
//#endregion
|
|
3047
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/component/helper/brushHelper.js
|
|
3048
|
-
/**
|
|
3049
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
3050
|
-
*/
|
|
3051
|
-
function makeRectPanelClipPath(rect) {
|
|
3052
|
-
rect = normalizeRect(rect);
|
|
3053
|
-
return function (localPoints) {
|
|
3054
|
-
return clipPointsByRect(localPoints, rect);
|
|
3055
|
-
};
|
|
3056
|
-
}
|
|
3057
|
-
function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {
|
|
3058
|
-
rect = normalizeRect(rect);
|
|
3059
|
-
return function (xyIndex) {
|
|
3060
|
-
var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;
|
|
3061
|
-
var brushWidth = idx ? rect.width : rect.height;
|
|
3062
|
-
var base = idx ? rect.x : rect.y;
|
|
3063
|
-
return [base, base + (brushWidth || 0)];
|
|
3064
|
-
};
|
|
3065
|
-
}
|
|
3066
|
-
function makeRectIsTargetByCursor(rect, api, targetModel) {
|
|
3067
|
-
var boundingRect = normalizeRect(rect);
|
|
3068
|
-
return function (e, localCursorPoint) {
|
|
3069
|
-
return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);
|
|
3070
|
-
};
|
|
3071
|
-
}
|
|
3072
|
-
function normalizeRect(rect) {
|
|
3073
|
-
return BoundingRect.create(rect);
|
|
3074
|
-
}
|
|
3075
|
-
|
|
3076
|
-
//#endregion
|
|
3077
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/util/styleCompat.js
|
|
3078
|
-
/**
|
|
3079
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
3080
|
-
*/
|
|
3081
|
-
/**
|
|
3082
|
-
* Whether need to call `convertEC4CompatibleStyle`.
|
|
3083
|
-
*/
|
|
3084
|
-
function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {
|
|
3085
|
-
return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== "tspan" && (elType === "text" || hasOwn(style, "text")));
|
|
3086
|
-
}
|
|
3087
|
-
/**
|
|
3088
|
-
* `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.
|
|
3089
|
-
* @param hostStyle The properties might be modified.
|
|
3090
|
-
* @return If be text el, `textContentStyle` and `textConfig` will not be returned.
|
|
3091
|
-
* Otherwise a `textContentStyle` and `textConfig` will be created, whose props area
|
|
3092
|
-
* retried from the `hostStyle`.
|
|
3093
|
-
*/
|
|
3094
|
-
function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {
|
|
3095
|
-
var srcStyle = hostStyle;
|
|
3096
|
-
var textConfig;
|
|
3097
|
-
var textContent;
|
|
3098
|
-
var textContentStyle;
|
|
3099
|
-
if (elType === "text") textContentStyle = srcStyle;else {
|
|
3100
|
-
textContentStyle = {};
|
|
3101
|
-
hasOwn(srcStyle, "text") && (textContentStyle.text = srcStyle.text);
|
|
3102
|
-
hasOwn(srcStyle, "rich") && (textContentStyle.rich = srcStyle.rich);
|
|
3103
|
-
hasOwn(srcStyle, "textFill") && (textContentStyle.fill = srcStyle.textFill);
|
|
3104
|
-
hasOwn(srcStyle, "textStroke") && (textContentStyle.stroke = srcStyle.textStroke);
|
|
3105
|
-
hasOwn(srcStyle, "fontFamily") && (textContentStyle.fontFamily = srcStyle.fontFamily);
|
|
3106
|
-
hasOwn(srcStyle, "fontSize") && (textContentStyle.fontSize = srcStyle.fontSize);
|
|
3107
|
-
hasOwn(srcStyle, "fontStyle") && (textContentStyle.fontStyle = srcStyle.fontStyle);
|
|
3108
|
-
hasOwn(srcStyle, "fontWeight") && (textContentStyle.fontWeight = srcStyle.fontWeight);
|
|
3109
|
-
textContent = {
|
|
3110
|
-
type: "text",
|
|
3111
|
-
style: textContentStyle,
|
|
3112
|
-
silent: true
|
|
3113
|
-
};
|
|
3114
|
-
textConfig = {};
|
|
3115
|
-
var hasOwnPos = hasOwn(srcStyle, "textPosition");
|
|
3116
|
-
if (isNormal) textConfig.position = hasOwnPos ? srcStyle.textPosition : "inside";else hasOwnPos && (textConfig.position = srcStyle.textPosition);
|
|
3117
|
-
hasOwn(srcStyle, "textPosition") && (textConfig.position = srcStyle.textPosition);
|
|
3118
|
-
hasOwn(srcStyle, "textOffset") && (textConfig.offset = srcStyle.textOffset);
|
|
3119
|
-
hasOwn(srcStyle, "textRotation") && (textConfig.rotation = srcStyle.textRotation);
|
|
3120
|
-
hasOwn(srcStyle, "textDistance") && (textConfig.distance = srcStyle.textDistance);
|
|
3121
|
-
}
|
|
3122
|
-
convertEC4CompatibleRichItem(textContentStyle, hostStyle);
|
|
3123
|
-
each$1(textContentStyle.rich, function (richItem) {
|
|
3124
|
-
convertEC4CompatibleRichItem(richItem, richItem);
|
|
3125
|
-
});
|
|
3126
|
-
return {
|
|
3127
|
-
textConfig,
|
|
3128
|
-
textContent
|
|
3129
|
-
};
|
|
3130
|
-
}
|
|
3131
|
-
/**
|
|
3132
|
-
* The result will be set to `out`.
|
|
3133
|
-
*/
|
|
3134
|
-
function convertEC4CompatibleRichItem(out, richItem) {
|
|
3135
|
-
if (!richItem) return;
|
|
3136
|
-
richItem.font = richItem.textFont || richItem.font;
|
|
3137
|
-
hasOwn(richItem, "textStrokeWidth") && (out.lineWidth = richItem.textStrokeWidth);
|
|
3138
|
-
hasOwn(richItem, "textAlign") && (out.align = richItem.textAlign);
|
|
3139
|
-
hasOwn(richItem, "textVerticalAlign") && (out.verticalAlign = richItem.textVerticalAlign);
|
|
3140
|
-
hasOwn(richItem, "textLineHeight") && (out.lineHeight = richItem.textLineHeight);
|
|
3141
|
-
hasOwn(richItem, "textWidth") && (out.width = richItem.textWidth);
|
|
3142
|
-
hasOwn(richItem, "textHeight") && (out.height = richItem.textHeight);
|
|
3143
|
-
hasOwn(richItem, "textBackgroundColor") && (out.backgroundColor = richItem.textBackgroundColor);
|
|
3144
|
-
hasOwn(richItem, "textPadding") && (out.padding = richItem.textPadding);
|
|
3145
|
-
hasOwn(richItem, "textBorderColor") && (out.borderColor = richItem.textBorderColor);
|
|
3146
|
-
hasOwn(richItem, "textBorderWidth") && (out.borderWidth = richItem.textBorderWidth);
|
|
3147
|
-
hasOwn(richItem, "textBorderRadius") && (out.borderRadius = richItem.textBorderRadius);
|
|
3148
|
-
hasOwn(richItem, "textBoxShadowColor") && (out.shadowColor = richItem.textBoxShadowColor);
|
|
3149
|
-
hasOwn(richItem, "textBoxShadowBlur") && (out.shadowBlur = richItem.textBoxShadowBlur);
|
|
3150
|
-
hasOwn(richItem, "textBoxShadowOffsetX") && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);
|
|
3151
|
-
hasOwn(richItem, "textBoxShadowOffsetY") && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);
|
|
3152
|
-
}
|
|
3153
|
-
/**
|
|
3154
|
-
* Convert to pure echarts4 format style.
|
|
3155
|
-
* `itemStyle` will be modified, added with ec4 style properties from
|
|
3156
|
-
* `textStyle` and `textConfig`.
|
|
3157
|
-
*
|
|
3158
|
-
* [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where
|
|
3159
|
-
* `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.
|
|
3160
|
-
*/
|
|
3161
|
-
function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {
|
|
3162
|
-
var out = itemStl;
|
|
3163
|
-
out.textPosition = out.textPosition || txCfg.position || "inside";
|
|
3164
|
-
txCfg.offset != null && (out.textOffset = txCfg.offset);
|
|
3165
|
-
txCfg.rotation != null && (out.textRotation = txCfg.rotation);
|
|
3166
|
-
txCfg.distance != null && (out.textDistance = txCfg.distance);
|
|
3167
|
-
var isInside = out.textPosition.indexOf("inside") >= 0;
|
|
3168
|
-
var hostFill = itemStl.fill || tokens.color.neutral99;
|
|
3169
|
-
convertToEC4RichItem(out, txStl);
|
|
3170
|
-
var textFillNotSet = out.textFill == null;
|
|
3171
|
-
if (isInside) {
|
|
3172
|
-
if (textFillNotSet) {
|
|
3173
|
-
out.textFill = txCfg.insideFill || tokens.color.neutral00;
|
|
3174
|
-
!out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);
|
|
3175
|
-
!out.textStroke && (out.textStroke = hostFill);
|
|
3176
|
-
out.textStrokeWidth ??= 2;
|
|
3177
|
-
}
|
|
3178
|
-
} else {
|
|
3179
|
-
if (textFillNotSet) out.textFill = itemStl.fill || txCfg.outsideFill || tokens.color.neutral00;
|
|
3180
|
-
!out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);
|
|
3181
|
-
}
|
|
3182
|
-
out.text = txStl.text;
|
|
3183
|
-
out.rich = txStl.rich;
|
|
3184
|
-
each$1(txStl.rich, function (richItem) {
|
|
3185
|
-
convertToEC4RichItem(richItem, richItem);
|
|
3186
|
-
});
|
|
3187
|
-
return out;
|
|
3188
|
-
}
|
|
3189
|
-
function convertToEC4RichItem(out, richItem) {
|
|
3190
|
-
if (!richItem) return;
|
|
3191
|
-
hasOwn(richItem, "fill") && (out.textFill = richItem.fill);
|
|
3192
|
-
hasOwn(richItem, "stroke") && (out.textStroke = richItem.fill);
|
|
3193
|
-
hasOwn(richItem, "lineWidth") && (out.textStrokeWidth = richItem.lineWidth);
|
|
3194
|
-
hasOwn(richItem, "font") && (out.font = richItem.font);
|
|
3195
|
-
hasOwn(richItem, "fontStyle") && (out.fontStyle = richItem.fontStyle);
|
|
3196
|
-
hasOwn(richItem, "fontWeight") && (out.fontWeight = richItem.fontWeight);
|
|
3197
|
-
hasOwn(richItem, "fontSize") && (out.fontSize = richItem.fontSize);
|
|
3198
|
-
hasOwn(richItem, "fontFamily") && (out.fontFamily = richItem.fontFamily);
|
|
3199
|
-
hasOwn(richItem, "align") && (out.textAlign = richItem.align);
|
|
3200
|
-
hasOwn(richItem, "verticalAlign") && (out.textVerticalAlign = richItem.verticalAlign);
|
|
3201
|
-
hasOwn(richItem, "lineHeight") && (out.textLineHeight = richItem.lineHeight);
|
|
3202
|
-
hasOwn(richItem, "width") && (out.textWidth = richItem.width);
|
|
3203
|
-
hasOwn(richItem, "height") && (out.textHeight = richItem.height);
|
|
3204
|
-
hasOwn(richItem, "backgroundColor") && (out.textBackgroundColor = richItem.backgroundColor);
|
|
3205
|
-
hasOwn(richItem, "padding") && (out.textPadding = richItem.padding);
|
|
3206
|
-
hasOwn(richItem, "borderColor") && (out.textBorderColor = richItem.borderColor);
|
|
3207
|
-
hasOwn(richItem, "borderWidth") && (out.textBorderWidth = richItem.borderWidth);
|
|
3208
|
-
hasOwn(richItem, "borderRadius") && (out.textBorderRadius = richItem.borderRadius);
|
|
3209
|
-
hasOwn(richItem, "shadowColor") && (out.textBoxShadowColor = richItem.shadowColor);
|
|
3210
|
-
hasOwn(richItem, "shadowBlur") && (out.textBoxShadowBlur = richItem.shadowBlur);
|
|
3211
|
-
hasOwn(richItem, "shadowOffsetX") && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);
|
|
3212
|
-
hasOwn(richItem, "shadowOffsetY") && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);
|
|
3213
|
-
hasOwn(richItem, "textShadowColor") && (out.textShadowColor = richItem.textShadowColor);
|
|
3214
|
-
hasOwn(richItem, "textShadowBlur") && (out.textShadowBlur = richItem.textShadowBlur);
|
|
3215
|
-
hasOwn(richItem, "textShadowOffsetX") && (out.textShadowOffsetX = richItem.textShadowOffsetX);
|
|
3216
|
-
hasOwn(richItem, "textShadowOffsetY") && (out.textShadowOffsetY = richItem.textShadowOffsetY);
|
|
3217
|
-
}
|
|
3218
|
-
|
|
3219
|
-
//#endregion
|
|
3220
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/animation/customGraphicTransition.js
|
|
3221
|
-
/**
|
|
3222
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
3223
|
-
*/
|
|
3224
|
-
|
|
3225
|
-
function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {
|
|
3226
|
-
var animationProp = animationType + "Animation";
|
|
3227
|
-
var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};
|
|
3228
|
-
var userDuring = transitionInnerStore(el).userDuring;
|
|
3229
|
-
if (config.duration > 0) {
|
|
3230
|
-
config.during = userDuring ? bind(duringCall, {
|
|
3231
|
-
el,
|
|
3232
|
-
userDuring
|
|
3233
|
-
}) : null;
|
|
3234
|
-
config.setToFinal = true;
|
|
3235
|
-
config.scope = animationType;
|
|
3236
|
-
}
|
|
3237
|
-
extend(config, elOption[animationProp]);
|
|
3238
|
-
return config;
|
|
3239
|
-
}
|
|
3240
|
-
function applyUpdateTransition(el, elOption, animatableModel, opts) {
|
|
3241
|
-
opts = opts || {};
|
|
3242
|
-
var dataIndex = opts.dataIndex,
|
|
3243
|
-
isInit = opts.isInit,
|
|
3244
|
-
clearStyle = opts.clearStyle;
|
|
3245
|
-
var hasAnimation = animatableModel.isAnimationEnabled();
|
|
3246
|
-
var store = transitionInnerStore(el);
|
|
3247
|
-
var styleOpt = elOption.style;
|
|
3248
|
-
store.userDuring = elOption.during;
|
|
3249
|
-
var transFromProps = {};
|
|
3250
|
-
var propsToSet = {};
|
|
3251
|
-
prepareTransformAllPropsFinal(el, elOption, propsToSet);
|
|
3252
|
-
if (el.type === "compound") {
|
|
3253
|
-
/**
|
|
3254
|
-
* We cannot directly clone shape for compoundPath,
|
|
3255
|
-
* because it makes the path to be an object instead of a Path instance,
|
|
3256
|
-
* and thus missing `buildPath` method.
|
|
3257
|
-
*/
|
|
3258
|
-
var paths = el.shape.paths;
|
|
3259
|
-
var optionPaths = elOption.shape.paths;
|
|
3260
|
-
for (var i = 0; i < optionPaths.length; i++) {
|
|
3261
|
-
var path = optionPaths[i];
|
|
3262
|
-
prepareShapeOrExtraAllPropsFinal("shape", path, paths[i]);
|
|
3263
|
-
}
|
|
3264
|
-
} else {
|
|
3265
|
-
prepareShapeOrExtraAllPropsFinal("shape", elOption, propsToSet);
|
|
3266
|
-
prepareShapeOrExtraAllPropsFinal("extra", elOption, propsToSet);
|
|
3267
|
-
}
|
|
3268
|
-
if (!isInit && hasAnimation) {
|
|
3269
|
-
prepareTransformTransitionFrom(el, elOption, transFromProps);
|
|
3270
|
-
prepareShapeOrExtraTransitionFrom("shape", el, elOption, transFromProps);
|
|
3271
|
-
prepareShapeOrExtraTransitionFrom("extra", el, elOption, transFromProps);
|
|
3272
|
-
prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);
|
|
3273
|
-
}
|
|
3274
|
-
propsToSet.style = styleOpt;
|
|
3275
|
-
applyPropsDirectly(el, propsToSet, clearStyle);
|
|
3276
|
-
applyMiscProps(el, elOption);
|
|
3277
|
-
if (hasAnimation) if (isInit) {
|
|
3278
|
-
var enterFromProps_1 = {};
|
|
3279
|
-
each$1(ELEMENT_ANIMATABLE_PROPS, function (propName) {
|
|
3280
|
-
var prop = propName ? elOption[propName] : elOption;
|
|
3281
|
-
if (prop && prop.enterFrom) {
|
|
3282
|
-
if (propName) enterFromProps_1[propName] = enterFromProps_1[propName] || {};
|
|
3283
|
-
extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);
|
|
3284
|
-
}
|
|
3285
|
-
});
|
|
3286
|
-
var config = getElementAnimationConfig("enter", el, elOption, animatableModel, dataIndex);
|
|
3287
|
-
if (config.duration > 0) el.animateFrom(enterFromProps_1, config);
|
|
3288
|
-
} else applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);
|
|
3289
|
-
updateLeaveTo(el, elOption);
|
|
3290
|
-
styleOpt ? el.dirty() : el.markRedraw();
|
|
3291
|
-
}
|
|
3292
|
-
function updateLeaveTo(el, elOption) {
|
|
3293
|
-
var leaveToProps = transitionInnerStore(el).leaveToProps;
|
|
3294
|
-
for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {
|
|
3295
|
-
var propName = ELEMENT_ANIMATABLE_PROPS[i];
|
|
3296
|
-
var prop = propName ? elOption[propName] : elOption;
|
|
3297
|
-
if (prop && prop.leaveTo) {
|
|
3298
|
-
if (!leaveToProps) leaveToProps = transitionInnerStore(el).leaveToProps = {};
|
|
3299
|
-
if (propName) leaveToProps[propName] = leaveToProps[propName] || {};
|
|
3300
|
-
extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);
|
|
3301
|
-
}
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
function applyLeaveTransition(el, elOption, animatableModel, onRemove) {
|
|
3305
|
-
if (el) {
|
|
3306
|
-
var parent_1 = el.parent;
|
|
3307
|
-
var leaveToProps = transitionInnerStore(el).leaveToProps;
|
|
3308
|
-
if (leaveToProps) {
|
|
3309
|
-
var config = getElementAnimationConfig("update", el, elOption, animatableModel, 0);
|
|
3310
|
-
config.done = function () {
|
|
3311
|
-
parent_1 && parent_1.remove(el);
|
|
3312
|
-
onRemove && onRemove();
|
|
3313
|
-
};
|
|
3314
|
-
el.animateTo(leaveToProps, config);
|
|
3315
|
-
} else {
|
|
3316
|
-
parent_1 && parent_1.remove(el);
|
|
3317
|
-
onRemove && onRemove();
|
|
3318
|
-
}
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
function isTransitionAll(transition) {
|
|
3322
|
-
return transition === "all";
|
|
3323
|
-
}
|
|
3324
|
-
function applyPropsDirectly(el, allPropsFinal, clearStyle) {
|
|
3325
|
-
var styleOpt = allPropsFinal.style;
|
|
3326
|
-
if (!el.isGroup && styleOpt) {
|
|
3327
|
-
if (clearStyle) {
|
|
3328
|
-
el.useStyle({});
|
|
3329
|
-
var animators = el.animators;
|
|
3330
|
-
for (var i = 0; i < animators.length; i++) {
|
|
3331
|
-
var animator = animators[i];
|
|
3332
|
-
if (animator.targetName === "style") animator.changeTarget(el.style);
|
|
3333
|
-
}
|
|
3334
|
-
}
|
|
3335
|
-
el.setStyle(styleOpt);
|
|
3336
|
-
}
|
|
3337
|
-
if (allPropsFinal) {
|
|
3338
|
-
allPropsFinal.style = null;
|
|
3339
|
-
allPropsFinal && el.attr(allPropsFinal);
|
|
3340
|
-
allPropsFinal.style = styleOpt;
|
|
3341
|
-
}
|
|
3342
|
-
}
|
|
3343
|
-
function applyPropsTransition(el, elOption, dataIndex, model, transFromProps) {
|
|
3344
|
-
if (transFromProps) {
|
|
3345
|
-
var config = getElementAnimationConfig("update", el, elOption, model, dataIndex);
|
|
3346
|
-
if (config.duration > 0) el.animateFrom(transFromProps, config);
|
|
3347
|
-
}
|
|
3348
|
-
}
|
|
3349
|
-
function applyMiscProps(el, elOption) {
|
|
3350
|
-
hasOwn(elOption, "silent") && (el.silent = elOption.silent);
|
|
3351
|
-
hasOwn(elOption, "ignore") && (el.ignore = elOption.ignore);
|
|
3352
|
-
if (el instanceof Displayable) hasOwn(elOption, "invisible") && (el.invisible = elOption.invisible);
|
|
3353
|
-
if (el instanceof Path) hasOwn(elOption, "autoBatch") && (el.autoBatch = elOption.autoBatch);
|
|
3354
|
-
}
|
|
3355
|
-
function duringCall() {
|
|
3356
|
-
var scope = this;
|
|
3357
|
-
var el = scope.el;
|
|
3358
|
-
if (!el) return;
|
|
3359
|
-
var latestUserDuring = transitionInnerStore(el).userDuring;
|
|
3360
|
-
var scopeUserDuring = scope.userDuring;
|
|
3361
|
-
if (latestUserDuring !== scopeUserDuring) {
|
|
3362
|
-
scope.el = scope.userDuring = null;
|
|
3363
|
-
return;
|
|
3364
|
-
}
|
|
3365
|
-
tmpDuringScope.el = el;
|
|
3366
|
-
scopeUserDuring(transitionDuringAPI);
|
|
3367
|
-
}
|
|
3368
|
-
function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {
|
|
3369
|
-
var attrOpt = elOption[mainAttr];
|
|
3370
|
-
if (!attrOpt) return;
|
|
3371
|
-
var elPropsInAttr = fromEl[mainAttr];
|
|
3372
|
-
var transFromPropsInAttr;
|
|
3373
|
-
if (elPropsInAttr) {
|
|
3374
|
-
var transition = elOption.transition;
|
|
3375
|
-
var attrTransition = attrOpt.transition;
|
|
3376
|
-
if (attrTransition) {
|
|
3377
|
-
!transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
|
|
3378
|
-
if (isTransitionAll(attrTransition)) extend(transFromPropsInAttr, elPropsInAttr);else {
|
|
3379
|
-
var transitionKeys = normalizeToArray(attrTransition);
|
|
3380
|
-
for (var i = 0; i < transitionKeys.length; i++) {
|
|
3381
|
-
var key = transitionKeys[i];
|
|
3382
|
-
var elVal = elPropsInAttr[key];
|
|
3383
|
-
transFromPropsInAttr[key] = elVal;
|
|
3384
|
-
}
|
|
3385
|
-
}
|
|
3386
|
-
} else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {
|
|
3387
|
-
!transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
|
|
3388
|
-
var elPropsInAttrKeys = keys(elPropsInAttr);
|
|
3389
|
-
for (var i = 0; i < elPropsInAttrKeys.length; i++) {
|
|
3390
|
-
var key = elPropsInAttrKeys[i];
|
|
3391
|
-
var elVal = elPropsInAttr[key];
|
|
3392
|
-
if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) transFromPropsInAttr[key] = elVal;
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
|
-
}
|
|
3396
|
-
}
|
|
3397
|
-
function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {
|
|
3398
|
-
var attrOpt = elOption[mainAttr];
|
|
3399
|
-
if (!attrOpt) return;
|
|
3400
|
-
var allPropsInAttr = allProps[mainAttr] = {};
|
|
3401
|
-
var keysInAttr = keys(attrOpt);
|
|
3402
|
-
for (var i = 0; i < keysInAttr.length; i++) {
|
|
3403
|
-
var key = keysInAttr[i];
|
|
3404
|
-
allPropsInAttr[key] = cloneValue(attrOpt[key]);
|
|
3405
|
-
}
|
|
3406
|
-
}
|
|
3407
|
-
function prepareTransformTransitionFrom(el, elOption, transFromProps) {
|
|
3408
|
-
var transition = elOption.transition;
|
|
3409
|
-
var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);
|
|
3410
|
-
for (var i = 0; i < transitionKeys.length; i++) {
|
|
3411
|
-
var key = transitionKeys[i];
|
|
3412
|
-
if (key === "style" || key === "shape" || key === "extra") continue;
|
|
3413
|
-
transFromProps[key] = el[key];
|
|
3414
|
-
}
|
|
3415
|
-
}
|
|
3416
|
-
function prepareTransformAllPropsFinal(el, elOption, allProps) {
|
|
3417
|
-
for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {
|
|
3418
|
-
var legacyName = LEGACY_TRANSFORM_PROPS[i];
|
|
3419
|
-
var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];
|
|
3420
|
-
var legacyArr = elOption[legacyName];
|
|
3421
|
-
if (legacyArr) {
|
|
3422
|
-
allProps[xyName[0]] = legacyArr[0];
|
|
3423
|
-
allProps[xyName[1]] = legacyArr[1];
|
|
3424
|
-
}
|
|
3425
|
-
}
|
|
3426
|
-
for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {
|
|
3427
|
-
var key = TRANSFORMABLE_PROPS[i];
|
|
3428
|
-
if (elOption[key] != null) allProps[key] = elOption[key];
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {
|
|
3432
|
-
if (!styleOpt) return;
|
|
3433
|
-
var fromElStyle = fromEl.style;
|
|
3434
|
-
var transFromStyleProps;
|
|
3435
|
-
if (fromElStyle) {
|
|
3436
|
-
var styleTransition = styleOpt.transition;
|
|
3437
|
-
var elTransition = elOption.transition;
|
|
3438
|
-
if (styleTransition && !isTransitionAll(styleTransition)) {
|
|
3439
|
-
var transitionKeys = normalizeToArray(styleTransition);
|
|
3440
|
-
!transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
|
|
3441
|
-
for (var i = 0; i < transitionKeys.length; i++) {
|
|
3442
|
-
var key = transitionKeys[i];
|
|
3443
|
-
var elVal = fromElStyle[key];
|
|
3444
|
-
transFromStyleProps[key] = elVal;
|
|
3445
|
-
}
|
|
3446
|
-
} else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, "style") >= 0)) {
|
|
3447
|
-
var animationProps = fromEl.getAnimationStyleProps();
|
|
3448
|
-
var animationStyleProps = animationProps ? animationProps.style : null;
|
|
3449
|
-
if (animationStyleProps) {
|
|
3450
|
-
!transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
|
|
3451
|
-
var styleKeys = keys(styleOpt);
|
|
3452
|
-
for (var i = 0; i < styleKeys.length; i++) {
|
|
3453
|
-
var key = styleKeys[i];
|
|
3454
|
-
if (animationStyleProps[key]) {
|
|
3455
|
-
var elVal = fromElStyle[key];
|
|
3456
|
-
transFromStyleProps[key] = elVal;
|
|
3457
|
-
}
|
|
3458
|
-
}
|
|
3459
|
-
}
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
function isNonStyleTransitionEnabled(optVal, elVal) {
|
|
3464
|
-
return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;
|
|
3465
|
-
}
|
|
3466
|
-
|
|
3467
|
-
//#endregion
|
|
3468
|
-
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/animation/customGraphicKeyframeAnimation.js
|
|
3469
|
-
/**
|
|
3470
|
-
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
3471
|
-
*/
|
|
3472
|
-
|
|
3473
|
-
/**
|
|
3474
|
-
* Stop previous keyframe animation and restore the attributes.
|
|
3475
|
-
* Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.
|
|
3476
|
-
*/
|
|
3477
|
-
function stopPreviousKeyframeAnimationAndRestore(el) {
|
|
3478
|
-
el.stopAnimation("keyframe");
|
|
3479
|
-
el.attr(getStateToRestore(el));
|
|
3480
|
-
}
|
|
3481
|
-
function applyKeyframeAnimation(el, animationOpts, animatableModel) {
|
|
3482
|
-
if (!animatableModel.isAnimationEnabled() || !animationOpts) return;
|
|
3483
|
-
if (isArray(animationOpts)) {
|
|
3484
|
-
each$1(animationOpts, function (singleAnimationOpts) {
|
|
3485
|
-
applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);
|
|
3486
|
-
});
|
|
3487
|
-
return;
|
|
3488
|
-
}
|
|
3489
|
-
var keyframes = animationOpts.keyframes;
|
|
3490
|
-
var duration = animationOpts.duration;
|
|
3491
|
-
if (animatableModel && duration == null) {
|
|
3492
|
-
var config = getAnimationConfig("enter", animatableModel, 0);
|
|
3493
|
-
duration = config && config.duration;
|
|
3494
|
-
}
|
|
3495
|
-
if (!keyframes || !duration) return;
|
|
3496
|
-
var stateToRestore = getStateToRestore(el);
|
|
3497
|
-
each$1(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) {
|
|
3498
|
-
if (targetPropName && !el[targetPropName]) return;
|
|
3499
|
-
var animator;
|
|
3500
|
-
keyframes.sort(function (a, b) {
|
|
3501
|
-
return a.percent - b.percent;
|
|
3502
|
-
});
|
|
3503
|
-
each$1(keyframes, function (kf) {
|
|
3504
|
-
var animators = el.animators;
|
|
3505
|
-
var kfValues = targetPropName ? kf[targetPropName] : kf;
|
|
3506
|
-
if (!kfValues) return;
|
|
3507
|
-
var propKeys = keys(kfValues);
|
|
3508
|
-
if (!targetPropName) propKeys = filter(propKeys, function (key) {
|
|
3509
|
-
return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;
|
|
3510
|
-
});
|
|
3511
|
-
if (!propKeys.length) return;
|
|
3512
|
-
if (!animator) {
|
|
3513
|
-
animator = el.animate(targetPropName, animationOpts.loop, true);
|
|
3514
|
-
animator.scope = "keyframe";
|
|
3515
|
-
}
|
|
3516
|
-
for (var i = 0; i < animators.length; i++) if (animators[i] !== animator && animators[i].targetName === animator.targetName) animators[i].stopTracks(propKeys);
|
|
3517
|
-
targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});
|
|
3518
|
-
var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;
|
|
3519
|
-
each$1(propKeys, function (key) {
|
|
3520
|
-
savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];
|
|
3521
|
-
});
|
|
3522
|
-
animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);
|
|
3523
|
-
});
|
|
3524
|
-
if (!animator) return;
|
|
3525
|
-
animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);
|
|
3526
|
-
});
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
//#endregion
|
|
3530
|
-
export { AxisView as A, SymbolDraw as B, updateCenterAndZoomInAction as C, RoamController as D, updateViewOnZoom as E, AxisBuilder as F, getDefaultInterpolatedLabel as H, axisModelCreator as I, computeLabelGeometry as L, getAxisInfo as M, makeKey as N, install$1 as O, layout as P, shiftLayoutOnXY as R, geoSourceManager_default as S, updateViewOnPan as T, getDefaultLabel as U, Symbol as V, ECLinePath as _, isTransitionAll as a, View as b, convertToEC4StyleForCustomSerise as c, makeRectIsTargetByCursor as d, makeRectPanelClipPath as f, Line as g, LineDraw as h, applyUpdateTransition as i, collect as j, install$2 as k, isEC4CompatibleStyle as l, sliderMove as m, stopPreviousKeyframeAnimationAndRestore as n, updateLeaveTo as o, BrushController as p, applyLeaveTransition as r, convertFromEC4CompatibleStyle as s, applyKeyframeAnimation as t, makeLinearBrushOtherExtent as u, VisualMapping as v, updateController as w, MapDraw as x, install as y, isCoordinateSystemType as z };
|
|
3531
|
-
//# sourceMappingURL=customGraphicKeyframeAnimation.d.ts.map
|