reke-ui 0.5.3 → 0.5.4
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/custom-elements.json +465 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.d.ts +99 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.d.ts.map +1 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.js +319 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.d.ts +2 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.d.ts.map +1 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.js +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -20
- package/dist/node_modules/echarts/lib/chart/bar/BarSeries.js +50 -0
- package/dist/node_modules/echarts/lib/chart/bar/BarView.js +431 -0
- package/dist/node_modules/echarts/lib/chart/bar/BaseBarSeries.js +65 -0
- package/dist/node_modules/echarts/lib/chart/bar/install.js +22 -0
- package/dist/node_modules/echarts/lib/chart/helper/Symbol.js +142 -0
- package/dist/node_modules/echarts/lib/chart/helper/SymbolDraw.js +99 -0
- package/dist/node_modules/echarts/lib/chart/helper/axisSnippets.js +19 -0
- package/dist/node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js +50 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesData.js +55 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js +3 -3
- package/dist/node_modules/echarts/lib/chart/helper/labelHelper.js +24 -0
- package/dist/node_modules/echarts/lib/chart/line/LineSeries.js +60 -0
- package/dist/node_modules/echarts/lib/chart/line/LineView.js +471 -0
- package/dist/node_modules/echarts/lib/chart/line/helper.js +34 -0
- package/dist/node_modules/echarts/lib/chart/line/install.js +16 -0
- package/dist/node_modules/echarts/lib/chart/line/lineAnimationDiff.js +59 -0
- package/dist/node_modules/echarts/lib/chart/line/poly.js +135 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieSeries.js +32 -32
- package/dist/node_modules/echarts/lib/chart/pie/PieView.js +69 -69
- package/dist/node_modules/echarts/lib/chart/pie/labelLayout.js +25 -25
- package/dist/node_modules/echarts/lib/chart/pie/pieLayout.js +16 -16
- package/dist/node_modules/echarts/lib/component/axis/AxisBuilder.js +153 -153
- package/dist/node_modules/echarts/lib/component/axis/AxisView.js +13 -13
- package/dist/node_modules/echarts/lib/component/axis/CartesianAxisView.js +106 -0
- package/dist/node_modules/echarts/lib/component/axis/axisSplitHelper.js +50 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js +20 -20
- package/dist/node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js +30 -30
- package/dist/node_modules/echarts/lib/component/axisPointer/viewHelper.js +13 -13
- package/dist/node_modules/echarts/lib/component/dataZoom/AxisProxy.js +114 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/DataZoomModel.js +189 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/DataZoomView.js +15 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js +21 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/InsideZoomView.js +67 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js +75 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/SliderZoomView.js +465 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/dataZoomAction.js +17 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js +55 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/helper.js +88 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installCommon.js +14 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js +10 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js +9 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/roams.js +132 -0
- package/dist/node_modules/echarts/lib/component/grid/install.js +9 -0
- package/dist/node_modules/echarts/lib/component/grid/installSimple.js +32 -0
- package/dist/node_modules/echarts/lib/component/helper/RoamController.js +172 -0
- package/dist/node_modules/echarts/lib/component/helper/cursorHelper.js +17 -0
- package/dist/node_modules/echarts/lib/component/helper/interactionMutex.js +15 -0
- package/dist/node_modules/echarts/lib/component/helper/sliderMove.js +29 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendModel.js +31 -31
- package/dist/node_modules/echarts/lib/component/legend/LegendView.js +61 -61
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendView.js +29 -29
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipRichContent.js +4 -4
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipView.js +105 -105
- package/dist/node_modules/echarts/lib/coord/Axis.js +92 -0
- package/dist/node_modules/echarts/lib/coord/CoordinateSystem.js +6 -0
- package/dist/node_modules/echarts/lib/coord/axisAlignTicks.js +76 -0
- package/dist/node_modules/echarts/lib/coord/axisCommonTypes.js +9 -0
- package/dist/node_modules/echarts/lib/coord/axisDefault.js +124 -0
- package/dist/node_modules/echarts/lib/coord/axisHelper.js +123 -14
- package/dist/node_modules/echarts/lib/coord/axisModelCommonMixin.js +9 -0
- package/dist/node_modules/echarts/lib/coord/axisModelCreator.js +39 -0
- package/dist/node_modules/echarts/lib/coord/axisNiceTicks.js +64 -0
- package/dist/node_modules/echarts/lib/coord/axisStatistics.js +101 -22
- package/dist/node_modules/echarts/lib/coord/axisStatisticsMetricsImpl.js +43 -0
- package/dist/node_modules/echarts/lib/coord/axisTickLabelBuilder.js +151 -5
- package/dist/node_modules/echarts/lib/coord/cartesian/Axis2D.js +24 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/AxisModel.js +18 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Cartesian.js +23 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Cartesian2D.js +69 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Grid.js +314 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/GridModel.js +40 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js +43 -12
- package/dist/node_modules/echarts/lib/coord/scaleRawExtentInfo.js +175 -0
- package/dist/node_modules/echarts/lib/core/CoordinateSystem.js +39 -16
- package/dist/node_modules/echarts/lib/core/echarts.js +421 -421
- package/dist/node_modules/echarts/lib/data/OrdinalMeta.js +30 -0
- package/dist/node_modules/echarts/lib/data/SeriesData.js +18 -18
- package/dist/node_modules/echarts/lib/data/helper/createDimensions.js +6 -6
- package/dist/node_modules/echarts/lib/data/helper/dataStackHelper.js +59 -0
- package/dist/node_modules/echarts/lib/data/helper/dataValueHelper.js +13 -13
- package/dist/node_modules/echarts/lib/data/helper/dimensionHelper.js +7 -4
- package/dist/node_modules/echarts/lib/data/helper/sourceHelper.js +40 -8
- package/dist/node_modules/echarts/lib/data/helper/sourceManager.js +3 -3
- package/dist/node_modules/echarts/lib/data/helper/transform.js +8 -8
- package/dist/node_modules/echarts/lib/extension.js +10 -10
- package/dist/node_modules/echarts/lib/label/labelGuideHelper.js +10 -10
- package/dist/node_modules/echarts/lib/label/labelStyle.js +34 -25
- package/dist/node_modules/echarts/lib/label/sectorLabel.js +83 -0
- package/dist/node_modules/echarts/lib/layout/barCommon.js +19 -0
- package/dist/node_modules/echarts/lib/layout/barGrid.js +165 -0
- package/dist/node_modules/echarts/lib/layout/points.js +37 -0
- package/dist/node_modules/echarts/lib/loading/default.js +6 -6
- package/dist/node_modules/echarts/lib/model/Component.js +39 -39
- package/dist/node_modules/echarts/lib/model/Global.js +122 -122
- package/dist/node_modules/echarts/lib/model/Series.js +78 -78
- package/dist/node_modules/echarts/lib/model/referHelper.js +58 -0
- package/dist/node_modules/echarts/lib/processor/dataSample.js +43 -0
- package/dist/node_modules/echarts/lib/scale/Interval.js +68 -0
- package/dist/node_modules/echarts/lib/scale/Log.js +100 -0
- package/dist/node_modules/echarts/lib/scale/Ordinal.js +92 -0
- package/dist/node_modules/echarts/lib/scale/Scale.js +13 -0
- package/dist/node_modules/echarts/lib/scale/Time.js +242 -0
- package/dist/node_modules/echarts/lib/scale/break.js +10 -2
- package/dist/node_modules/echarts/lib/scale/helper.js +61 -3
- package/dist/node_modules/echarts/lib/scale/minorTicks.js +22 -0
- package/dist/node_modules/echarts/lib/scale/scaleMapper.js +89 -7
- package/dist/node_modules/echarts/lib/util/clazz.js +35 -35
- package/dist/node_modules/echarts/lib/util/component.js +16 -16
- package/dist/node_modules/echarts/lib/util/cycleCache.js +4 -1
- package/dist/node_modules/echarts/lib/util/decal.js +11 -11
- package/dist/node_modules/echarts/lib/util/format.js +1 -1
- package/dist/node_modules/echarts/lib/util/graphic.js +170 -170
- package/dist/node_modules/echarts/lib/util/layout.js +23 -23
- package/dist/node_modules/echarts/lib/util/model.js +128 -68
- package/dist/node_modules/echarts/lib/util/number.js +55 -37
- package/dist/node_modules/echarts/lib/util/shape/sausage.js +25 -0
- package/dist/node_modules/echarts/lib/util/states.js +96 -82
- package/dist/node_modules/echarts/lib/util/styleCompat.js +10 -0
- package/dist/node_modules/echarts/lib/util/symbol.js +24 -21
- package/dist/node_modules/echarts/lib/util/time.js +154 -18
- package/dist/node_modules/echarts/lib/util/vendor.js +26 -0
- package/dist/node_modules/echarts/lib/view/Chart.js +19 -19
- package/dist/node_modules/echarts/lib/view/Component.js +7 -7
- package/dist/node_modules/echarts/lib/visual/style.js +5 -5
- package/dist/node_modules/zrender/lib/Element.js +35 -35
- package/dist/node_modules/zrender/lib/canvas/graphic.js +36 -36
- package/dist/node_modules/zrender/lib/core/PathProxy.js +25 -25
- package/dist/node_modules/zrender/lib/core/event.js +4 -1
- package/dist/node_modules/zrender/lib/core/util.js +69 -64
- package/dist/node_modules/zrender/lib/graphic/TSpan.js +7 -7
- package/dist/node_modules/zrender/lib/graphic/Text.js +37 -37
- package/dist/node_modules/zrender/lib/graphic/helper/parseText.js +59 -59
- package/dist/node_modules/zrender/lib/tool/color.js +60 -41
- package/dist/react.d.ts +5 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +83 -77
- package/package.json +5 -1
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { __extends as e } from "../../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import { each as t, extend as n, map as r } from "../../../../zrender/lib/core/util.js";
|
|
3
|
+
import i from "../../../../zrender/lib/graphic/Path.js";
|
|
4
|
+
import a from "../../../../zrender/lib/graphic/shape/Rect.js";
|
|
5
|
+
import { warn as o } from "../../util/log.js";
|
|
6
|
+
import { getIncrementalId as s } from "../../util/model.js";
|
|
7
|
+
import { getECData as c } from "../../util/innerStore.js";
|
|
8
|
+
import { setStatesStylesFromModel as l, toggleHoverEmphasis as u } from "../../util/states.js";
|
|
9
|
+
import d from "../../../../zrender/lib/graphic/Group.js";
|
|
10
|
+
import f from "../../../../zrender/lib/graphic/shape/Sector.js";
|
|
11
|
+
import { initProps as p, removeElementWithFadeOut as m, saveOldStyle as h, updateProps as g } from "../../animation/basicTransition.js";
|
|
12
|
+
import { traverseElements as _ } from "../../util/graphic.js";
|
|
13
|
+
import { getLabelStatesModels as v, labelInner as y, setLabelStyle as b, setLabelValueAnimation as x } from "../../label/labelStyle.js";
|
|
14
|
+
import { getDefaultInterpolatedLabel as S, getDefaultLabel as C } from "../helper/labelHelper.js";
|
|
15
|
+
import w from "../../view/Chart.js";
|
|
16
|
+
import { createClipPath as T } from "../helper/createClipPathFromCoordSys.js";
|
|
17
|
+
import { isCoordinateSystemType as E } from "../../coord/CoordinateSystem.js";
|
|
18
|
+
import { throttle as D } from "../../util/throttle.js";
|
|
19
|
+
import O from "../../util/shape/sausage.js";
|
|
20
|
+
import { createSectorCalculateTextPosition as k, setSectorTextRotation as A } from "../../label/sectorLabel.js";
|
|
21
|
+
import { getSectorCornerRadius as j } from "../helper/sectorHelper.js";
|
|
22
|
+
//#region node_modules/echarts/lib/chart/bar/BarView.js
|
|
23
|
+
var M = Math.max, N = Math.min, P = function(t) {
|
|
24
|
+
e(n, t);
|
|
25
|
+
function n() {
|
|
26
|
+
var e = t.call(this) || this;
|
|
27
|
+
return e.type = "bar", e._isFirstFrame = !0, e;
|
|
28
|
+
}
|
|
29
|
+
return n.prototype.render = function(e, t, n, r) {
|
|
30
|
+
this._model = e, this._removeOnRenderedListener(n), this._updateDrawMode(e);
|
|
31
|
+
var i = e.get("coordinateSystem");
|
|
32
|
+
i === "cartesian2d" || i === "polar" ? (this._progressiveEls = null, this._isLargeDraw ? this._renderLarge(e, t, n) : this._renderNormal(e, t, n, r)) : process.env.NODE_ENV !== "production" && o("Only cartesian2d and polar supported for bar.");
|
|
33
|
+
}, n.prototype.incrementalPrepareRender = function(e) {
|
|
34
|
+
this._clear(), this._updateDrawMode(e), this._updateLargeClip(e);
|
|
35
|
+
}, n.prototype.incrementalRender = function(e, t) {
|
|
36
|
+
this._progressiveEls = [], this._incrementalRenderLarge(e, t);
|
|
37
|
+
}, n.prototype.eachRendered = function(e) {
|
|
38
|
+
_(this._progressiveEls || this.group, e);
|
|
39
|
+
}, n.prototype._updateDrawMode = function(e) {
|
|
40
|
+
var t = e.pipelineContext.large;
|
|
41
|
+
(this._isLargeDraw == null || t !== this._isLargeDraw) && (this._isLargeDraw = t, this._clear());
|
|
42
|
+
}, n.prototype._renderNormal = function(e, t, n, r) {
|
|
43
|
+
var i = this.group, a = e.getData(), o = this._data, s = e.coordinateSystem, c = s.getBaseAxis(), l;
|
|
44
|
+
s.type === "cartesian2d" ? l = c.isHorizontal() : s.type === "polar" && (l = c.dim === "angle");
|
|
45
|
+
var u = e.isAnimationEnabled() ? e : null, f = L(e, s);
|
|
46
|
+
f && this._enableRealtimeSort(f, a, n);
|
|
47
|
+
var _ = e.get("clip", !0) || f, v = s.getArea();
|
|
48
|
+
i.removeClipPath();
|
|
49
|
+
var b = e.get("roundCap", !0), x = e.get("showBackground", !0), S = e.getModel("backgroundStyle"), C = S.get("borderRadius") || 0, w = [], T = this._backgroundEls, E = r && r.isInitSort, D = r && r.type === "changeAxisOrder";
|
|
50
|
+
function O(e) {
|
|
51
|
+
var t = U[s.type](a, e);
|
|
52
|
+
if (!t) return null;
|
|
53
|
+
var n = ee(s, l, t);
|
|
54
|
+
return n.useStyle(S.getItemStyle()), s.type === "cartesian2d" ? n.setShape("r", C) : n.setShape("cornerRadius", C), w[e] = n, n;
|
|
55
|
+
}
|
|
56
|
+
a.diff(o).add(function(t) {
|
|
57
|
+
var n = a.getItemModel(t), r = U[s.type](a, t, n);
|
|
58
|
+
if (r && (x && O(t), !(!a.hasValue(t) || !H[s.type](r)))) {
|
|
59
|
+
var o = !1;
|
|
60
|
+
_ && (o = F[s.type](v, r));
|
|
61
|
+
var d = I[s.type](e, a, t, r, l, u, c.model, !1, b);
|
|
62
|
+
f && (d.forceLabelAnimation = !0), K(d, a, t, n, r, e, l, s.type === "polar"), E ? d.attr({ shape: r }) : f ? R(f, u, d, r, t, l, !1, !1) : p(d, { shape: r }, e, t), a.setItemGraphicEl(t, d), i.add(d), d.ignore = o;
|
|
63
|
+
}
|
|
64
|
+
}).update(function(t, n) {
|
|
65
|
+
var r = a.getItemModel(t), d = U[s.type](a, t, r);
|
|
66
|
+
if (d) {
|
|
67
|
+
if (x) {
|
|
68
|
+
var p = void 0;
|
|
69
|
+
T.length === 0 ? p = O(n) : (p = T[n], p.useStyle(S.getItemStyle()), s.type === "cartesian2d" ? p.setShape("r", C) : p.setShape("cornerRadius", C), w[t] = p);
|
|
70
|
+
var k = U[s.type](a, t), A = $(l, k, s);
|
|
71
|
+
g(p, { shape: A }, u, t);
|
|
72
|
+
}
|
|
73
|
+
var j = o.getItemGraphicEl(n);
|
|
74
|
+
if (!a.hasValue(t) || !H[s.type](d)) {
|
|
75
|
+
i.remove(j);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var M = !1;
|
|
79
|
+
if (_ && (M = F[s.type](v, d), M && i.remove(j)), j && (j.type === "sector" && b || j.type === "sausage" && !b) && (j && m(j, e, n), j = null), j ? h(j) : j = I[s.type](e, a, t, d, l, u, c.model, !0, b), f && (j.forceLabelAnimation = !0), D) {
|
|
80
|
+
var N = j.getTextContent();
|
|
81
|
+
if (N) {
|
|
82
|
+
var P = y(N);
|
|
83
|
+
P.prevValue != null && (P.prevValue = P.value);
|
|
84
|
+
}
|
|
85
|
+
} else K(j, a, t, r, d, e, l, s.type === "polar");
|
|
86
|
+
E ? j.attr({ shape: d }) : f ? R(f, u, j, d, t, l, !0, D) : g(j, { shape: d }, e, t, null), a.setItemGraphicEl(t, j), j.ignore = M, i.add(j);
|
|
87
|
+
}
|
|
88
|
+
}).remove(function(t) {
|
|
89
|
+
var n = o.getItemGraphicEl(t);
|
|
90
|
+
n && m(n, e, t);
|
|
91
|
+
}).execute();
|
|
92
|
+
var k = this._backgroundGroup ||= new d();
|
|
93
|
+
k.removeAll();
|
|
94
|
+
for (var A = 0; A < w.length; ++A) k.add(w[A]);
|
|
95
|
+
i.add(k), this._backgroundEls = w, this._data = a;
|
|
96
|
+
}, n.prototype._renderLarge = function(e, t, n) {
|
|
97
|
+
this._clear(), X(e, this.group), this._updateLargeClip(e);
|
|
98
|
+
}, n.prototype._incrementalRenderLarge = function(e, t) {
|
|
99
|
+
this._removeBackground(), X(t, this.group, this._progressiveEls, !0);
|
|
100
|
+
}, n.prototype._updateLargeClip = function(e) {
|
|
101
|
+
var t = e.get("clip", !0) && T(e.coordinateSystem, !1, e), n = this.group;
|
|
102
|
+
t ? n.setClipPath(t) : n.removeClipPath();
|
|
103
|
+
}, n.prototype._enableRealtimeSort = function(e, t, n) {
|
|
104
|
+
var r = this;
|
|
105
|
+
if (t.count()) {
|
|
106
|
+
var i = e.baseAxis;
|
|
107
|
+
if (this._isFirstFrame) this._dispatchInitSort(t, e, n), this._isFirstFrame = !1;
|
|
108
|
+
else {
|
|
109
|
+
var a = function(e) {
|
|
110
|
+
var n = t.getItemGraphicEl(e), r = n && n.shape;
|
|
111
|
+
return r && Math.abs(i.isHorizontal() ? r.height : r.width) || 0;
|
|
112
|
+
};
|
|
113
|
+
this._onRendered = function() {
|
|
114
|
+
r._updateSortWithinSameData(t, a, i, n);
|
|
115
|
+
}, n.getZr().on("rendered", this._onRendered);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, n.prototype._dataSort = function(e, t, n) {
|
|
119
|
+
var i = [];
|
|
120
|
+
return e.each(e.mapDimension(t.dim), function(e, t) {
|
|
121
|
+
var r = n(t);
|
|
122
|
+
r ??= NaN, i.push({
|
|
123
|
+
dataIndex: t,
|
|
124
|
+
mappedValue: r,
|
|
125
|
+
ordinalNumber: e
|
|
126
|
+
});
|
|
127
|
+
}), i.sort(function(e, t) {
|
|
128
|
+
return t.mappedValue - e.mappedValue;
|
|
129
|
+
}), { ordinalNumbers: r(i, function(e) {
|
|
130
|
+
return e.ordinalNumber;
|
|
131
|
+
}) };
|
|
132
|
+
}, n.prototype._isOrderChangedWithinSameData = function(e, t, n) {
|
|
133
|
+
for (var r = n.scale, i = e.mapDimension(n.dim), a = Number.MAX_VALUE, o = 0, s = r.getOrdinalMeta().categories.length; o < s; ++o) {
|
|
134
|
+
var c = e.rawIndexOf(i, r.getRawOrdinalNumber(o)), l = c < 0 ? Number.MIN_VALUE : t(e.indexOfRawIndex(c));
|
|
135
|
+
if (l > a) return !0;
|
|
136
|
+
a = l;
|
|
137
|
+
}
|
|
138
|
+
return !1;
|
|
139
|
+
}, n.prototype._isOrderDifferentInView = function(e, t) {
|
|
140
|
+
for (var n = t.scale, r = n.getExtent(), i = Math.max(0, r[0]), a = Math.min(r[1], n.getOrdinalMeta().categories.length - 1); i <= a; ++i) if (e.ordinalNumbers[i] !== n.getRawOrdinalNumber(i)) return !0;
|
|
141
|
+
}, n.prototype._updateSortWithinSameData = function(e, t, n, r) {
|
|
142
|
+
if (this._isOrderChangedWithinSameData(e, t, n)) {
|
|
143
|
+
var i = this._dataSort(e, n, t);
|
|
144
|
+
this._isOrderDifferentInView(i, n) && (this._removeOnRenderedListener(r), r.dispatchAction({
|
|
145
|
+
type: "changeAxisOrder",
|
|
146
|
+
componentType: n.dim + "Axis",
|
|
147
|
+
axisId: n.index,
|
|
148
|
+
sortInfo: i
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
}, n.prototype._dispatchInitSort = function(e, t, n) {
|
|
152
|
+
var r = t.baseAxis, i = this._dataSort(e, r, function(n) {
|
|
153
|
+
return e.get(e.mapDimension(t.otherAxis.dim), n);
|
|
154
|
+
});
|
|
155
|
+
n.dispatchAction({
|
|
156
|
+
type: "changeAxisOrder",
|
|
157
|
+
componentType: r.dim + "Axis",
|
|
158
|
+
isInitSort: !0,
|
|
159
|
+
axisId: r.index,
|
|
160
|
+
sortInfo: i
|
|
161
|
+
});
|
|
162
|
+
}, n.prototype.remove = function(e, t) {
|
|
163
|
+
this._clear(this._model), this._removeOnRenderedListener(t);
|
|
164
|
+
}, n.prototype.dispose = function(e, t) {
|
|
165
|
+
this._removeOnRenderedListener(t);
|
|
166
|
+
}, n.prototype._removeOnRenderedListener = function(e) {
|
|
167
|
+
this._onRendered &&= (e.getZr().off("rendered", this._onRendered), null);
|
|
168
|
+
}, n.prototype._clear = function(e) {
|
|
169
|
+
var t = this.group, n = this._data;
|
|
170
|
+
e && e.isAnimationEnabled() && n && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], n.eachItemGraphicEl(function(t) {
|
|
171
|
+
m(t, e, c(t).dataIndex);
|
|
172
|
+
})) : t.removeAll(), this._data = null, this._isFirstFrame = !0;
|
|
173
|
+
}, n.prototype._removeBackground = function() {
|
|
174
|
+
this.group.remove(this._backgroundGroup), this._backgroundGroup = null;
|
|
175
|
+
}, n.type = "bar", n;
|
|
176
|
+
}(w), F = {
|
|
177
|
+
cartesian2d: function(e, t) {
|
|
178
|
+
var n = t.width < 0 ? -1 : 1, r = t.height < 0 ? -1 : 1;
|
|
179
|
+
n < 0 && (t.x += t.width, t.width = -t.width), r < 0 && (t.y += t.height, t.height = -t.height);
|
|
180
|
+
var i = e.x + e.width, a = e.y + e.height, o = M(t.x, e.x), s = N(t.x + t.width, i), c = M(t.y, e.y), l = N(t.y + t.height, a), u = s < o, d = l < c;
|
|
181
|
+
return t.x = u && o > i ? s : o, t.y = d && c > a ? l : c, t.width = u ? 0 : s - o, t.height = d ? 0 : l - c, n < 0 && (t.x += t.width, t.width = -t.width), r < 0 && (t.y += t.height, t.height = -t.height), u || d;
|
|
182
|
+
},
|
|
183
|
+
polar: function(e, t) {
|
|
184
|
+
var n = t.r0 <= t.r ? 1 : -1;
|
|
185
|
+
if (n < 0) {
|
|
186
|
+
var r = t.r;
|
|
187
|
+
t.r = t.r0, t.r0 = r;
|
|
188
|
+
}
|
|
189
|
+
var i = N(t.r, e.r), a = M(t.r0, e.r0);
|
|
190
|
+
t.r = i, t.r0 = a;
|
|
191
|
+
var o = i - a < 0;
|
|
192
|
+
if (n < 0) {
|
|
193
|
+
var r = t.r;
|
|
194
|
+
t.r = t.r0, t.r0 = r;
|
|
195
|
+
}
|
|
196
|
+
return o;
|
|
197
|
+
}
|
|
198
|
+
}, I = {
|
|
199
|
+
cartesian2d: function(e, t, r, i, o, s, c, l, u) {
|
|
200
|
+
var d = new a({
|
|
201
|
+
shape: n({}, i),
|
|
202
|
+
z2: 1
|
|
203
|
+
});
|
|
204
|
+
if (d.__dataIndex = r, d.name = "item", s) {
|
|
205
|
+
var f = d.shape, p = o ? "height" : "width";
|
|
206
|
+
f[p] = 0;
|
|
207
|
+
}
|
|
208
|
+
return d;
|
|
209
|
+
},
|
|
210
|
+
polar: function(e, t, n, r, i, a, o, s, c) {
|
|
211
|
+
var l = !i && c ? O : f, u = new l({
|
|
212
|
+
shape: r,
|
|
213
|
+
z2: 1
|
|
214
|
+
});
|
|
215
|
+
if (u.name = "item", u.calculateTextPosition = k(G(i), { isRoundCap: l === O }), a) {
|
|
216
|
+
var d = u.shape, m = i ? "r" : "endAngle", h = {};
|
|
217
|
+
d[m] = i ? r.r0 : r.startAngle, h[m] = r[m], (s ? g : p)(u, { shape: h }, a);
|
|
218
|
+
}
|
|
219
|
+
return u;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
function L(e, t) {
|
|
223
|
+
var n = e.get("realtimeSort", !0), r = t.getBaseAxis();
|
|
224
|
+
if (process.env.NODE_ENV !== "production" && n && (r.type !== "category" && o("`realtimeSort` will not work because this bar series is not based on a category axis."), t.type !== "cartesian2d" && o("`realtimeSort` will not work because this bar series is not on cartesian2d.")), n && r.type === "category" && t.type === "cartesian2d") return {
|
|
225
|
+
baseAxis: r,
|
|
226
|
+
otherAxis: t.getOtherAxis(r)
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function R(e, t, n, r, i, a, o, s) {
|
|
230
|
+
var c, l;
|
|
231
|
+
a ? (l = {
|
|
232
|
+
x: r.x,
|
|
233
|
+
width: r.width
|
|
234
|
+
}, c = {
|
|
235
|
+
y: r.y,
|
|
236
|
+
height: r.height
|
|
237
|
+
}) : (l = {
|
|
238
|
+
y: r.y,
|
|
239
|
+
height: r.height
|
|
240
|
+
}, c = {
|
|
241
|
+
x: r.x,
|
|
242
|
+
width: r.width
|
|
243
|
+
}), s || (o ? g : p)(n, { shape: c }, t, i, null);
|
|
244
|
+
var u = t ? e.baseAxis.model : null;
|
|
245
|
+
(o ? g : p)(n, { shape: l }, u, i);
|
|
246
|
+
}
|
|
247
|
+
function z(e, t) {
|
|
248
|
+
for (var n = 0; n < t.length; n++) if (!isFinite(e[t[n]])) return !0;
|
|
249
|
+
return !1;
|
|
250
|
+
}
|
|
251
|
+
var B = [
|
|
252
|
+
"x",
|
|
253
|
+
"y",
|
|
254
|
+
"width",
|
|
255
|
+
"height"
|
|
256
|
+
], V = [
|
|
257
|
+
"cx",
|
|
258
|
+
"cy",
|
|
259
|
+
"r",
|
|
260
|
+
"startAngle",
|
|
261
|
+
"endAngle"
|
|
262
|
+
], H = {
|
|
263
|
+
cartesian2d: function(e) {
|
|
264
|
+
return !z(e, B);
|
|
265
|
+
},
|
|
266
|
+
polar: function(e) {
|
|
267
|
+
return !z(e, V);
|
|
268
|
+
}
|
|
269
|
+
}, U = {
|
|
270
|
+
cartesian2d: function(e, t, n) {
|
|
271
|
+
var r = e.getItemLayout(t);
|
|
272
|
+
if (!r) return null;
|
|
273
|
+
var i = n ? q(n, r) : 0, a = r.width > 0 ? 1 : -1, o = r.height > 0 ? 1 : -1;
|
|
274
|
+
return {
|
|
275
|
+
x: r.x + a * i / 2,
|
|
276
|
+
y: r.y + o * i / 2,
|
|
277
|
+
width: r.width - a * i,
|
|
278
|
+
height: r.height - o * i
|
|
279
|
+
};
|
|
280
|
+
},
|
|
281
|
+
polar: function(e, t, n) {
|
|
282
|
+
var r = e.getItemLayout(t);
|
|
283
|
+
return {
|
|
284
|
+
cx: r.cx,
|
|
285
|
+
cy: r.cy,
|
|
286
|
+
r0: r.r0,
|
|
287
|
+
r: r.r,
|
|
288
|
+
startAngle: r.startAngle,
|
|
289
|
+
endAngle: r.endAngle,
|
|
290
|
+
clockwise: r.clockwise
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
function W(e) {
|
|
295
|
+
return e.startAngle != null && e.endAngle != null && e.startAngle === e.endAngle;
|
|
296
|
+
}
|
|
297
|
+
function G(e) {
|
|
298
|
+
return function(e) {
|
|
299
|
+
var t = e ? "Arc" : "Angle";
|
|
300
|
+
return function(e) {
|
|
301
|
+
switch (e) {
|
|
302
|
+
case "start":
|
|
303
|
+
case "insideStart":
|
|
304
|
+
case "end":
|
|
305
|
+
case "insideEnd": return e + t;
|
|
306
|
+
default: return e;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}(e);
|
|
310
|
+
}
|
|
311
|
+
function K(e, r, i, a, o, s, c, d) {
|
|
312
|
+
var f = r.getItemVisual(i, "style");
|
|
313
|
+
if (!d) {
|
|
314
|
+
var p = a.get(["itemStyle", "borderRadius"]) || 0;
|
|
315
|
+
e.setShape("r", p);
|
|
316
|
+
} else if (!s.get("roundCap")) {
|
|
317
|
+
var m = e.shape;
|
|
318
|
+
n(m, j(a.getModel("itemStyle"), m, !0)), e.setShape(m);
|
|
319
|
+
}
|
|
320
|
+
e.useStyle(f);
|
|
321
|
+
var h = a.getShallow("cursor");
|
|
322
|
+
h && e.attr("cursor", h);
|
|
323
|
+
var g = d ? c ? o.r >= o.r0 ? "endArc" : "startArc" : o.endAngle >= o.startAngle ? "endAngle" : "startAngle" : c ? te(o, s.coordinateSystem) : ne(o, s.coordinateSystem), _ = v(a);
|
|
324
|
+
b(e, _, {
|
|
325
|
+
labelFetcher: s,
|
|
326
|
+
labelDataIndex: i,
|
|
327
|
+
defaultText: C(s.getData(), i),
|
|
328
|
+
inheritColor: f.fill,
|
|
329
|
+
defaultOpacity: f.opacity,
|
|
330
|
+
defaultOutsidePosition: g
|
|
331
|
+
});
|
|
332
|
+
var y = e.getTextContent();
|
|
333
|
+
if (d && y) {
|
|
334
|
+
var w = a.get(["label", "position"]);
|
|
335
|
+
e.textConfig.inside = w === "middle" ? !0 : null, A(e, w === "outside" ? g : w, G(c), a.get(["label", "rotate"]));
|
|
336
|
+
}
|
|
337
|
+
x(y, _, s.getRawValue(i), function(e) {
|
|
338
|
+
return S(r, e);
|
|
339
|
+
});
|
|
340
|
+
var T = a.getModel(["emphasis"]);
|
|
341
|
+
u(e, T.get("focus"), T.get("blurScope"), T.get("disabled")), l(e, a), W(o) && (e.style.fill = "none", e.style.stroke = "none", t(e.states, function(e) {
|
|
342
|
+
e.style && (e.style.fill = e.style.stroke = "none");
|
|
343
|
+
}));
|
|
344
|
+
}
|
|
345
|
+
function q(e, t) {
|
|
346
|
+
var n = e.get(["itemStyle", "borderColor"]);
|
|
347
|
+
if (!n || n === "none") return 0;
|
|
348
|
+
var r = e.get(["itemStyle", "borderWidth"]) || 0, i = isNaN(t.width) ? Number.MAX_VALUE : Math.abs(t.width), a = isNaN(t.height) ? Number.MAX_VALUE : Math.abs(t.height);
|
|
349
|
+
return Math.min(r, i, a);
|
|
350
|
+
}
|
|
351
|
+
var J = function() {
|
|
352
|
+
function e() {}
|
|
353
|
+
return e;
|
|
354
|
+
}(), Y = function(t) {
|
|
355
|
+
e(n, t);
|
|
356
|
+
function n(e) {
|
|
357
|
+
var n = t.call(this, e) || this;
|
|
358
|
+
return n.type = "largeBar", n;
|
|
359
|
+
}
|
|
360
|
+
return n.prototype.getDefaultShape = function() {
|
|
361
|
+
return new J();
|
|
362
|
+
}, n.prototype.buildPath = function(e, t) {
|
|
363
|
+
for (var n = t.points, r = this.baseDimIdx, i = 1 - this.baseDimIdx, a = [], o = [], s = this.barWidth, c = 0; c < n.length; c += 3) o[r] = s, o[i] = n[c + 2], a[r] = n[c + r], a[i] = n[c + i], e.rect(a[0], a[1], o[0], o[1]);
|
|
364
|
+
}, n;
|
|
365
|
+
}(i);
|
|
366
|
+
function X(e, t, n, r) {
|
|
367
|
+
var i = e.getData(), a = +!!i.getLayout("valueAxisHorizontal"), o = i.getLayout("largeDataIndices"), l = i.getLayout("size"), u = e.getModel("backgroundStyle"), d = i.getLayout("largeBackgroundPoints"), f = r ? s(e) : 0;
|
|
368
|
+
if (d) {
|
|
369
|
+
var p = new Y({
|
|
370
|
+
shape: { points: d },
|
|
371
|
+
incremental: f,
|
|
372
|
+
silent: !0,
|
|
373
|
+
z2: 0
|
|
374
|
+
});
|
|
375
|
+
p.baseDimIdx = a, p.largeDataIndices = o, p.barWidth = l, p.useStyle(u.getItemStyle()), t.add(p), n && n.push(p);
|
|
376
|
+
}
|
|
377
|
+
var m = new Y({
|
|
378
|
+
shape: { points: i.getLayout("largePoints") },
|
|
379
|
+
incremental: f,
|
|
380
|
+
ignoreCoarsePointer: !0,
|
|
381
|
+
z2: 1
|
|
382
|
+
});
|
|
383
|
+
m.baseDimIdx = a, m.largeDataIndices = o, m.barWidth = l, t.add(m), m.useStyle(i.getVisual("style")), m.style.stroke = null, c(m).seriesIndex = e.seriesIndex, e.get("silent") || (m.on("mousedown", Z), m.on("mousemove", Z)), n && n.push(m);
|
|
384
|
+
}
|
|
385
|
+
var Z = D(function(e) {
|
|
386
|
+
var t = this, n = Q(t, e.offsetX, e.offsetY);
|
|
387
|
+
c(t).dataIndex = n >= 0 ? n : null;
|
|
388
|
+
}, 30, !1);
|
|
389
|
+
function Q(e, t, n) {
|
|
390
|
+
for (var r = e.baseDimIdx, i = 1 - r, a = e.shape.points, o = e.largeDataIndices, s = [], c = [], l = e.barWidth, u = 0, d = a.length / 3; u < d; u++) {
|
|
391
|
+
var f = u * 3;
|
|
392
|
+
if (c[r] = l, c[i] = a[f + 2], s[r] = a[f + r], s[i] = a[f + i], c[i] < 0 && (s[i] += c[i], c[i] = -c[i]), t >= s[0] && t <= s[0] + c[0] && n >= s[1] && n <= s[1] + c[1]) return o[u];
|
|
393
|
+
}
|
|
394
|
+
return -1;
|
|
395
|
+
}
|
|
396
|
+
function $(e, t, n) {
|
|
397
|
+
if (E(n, "cartesian2d")) {
|
|
398
|
+
var r = t, i = n.getArea();
|
|
399
|
+
return {
|
|
400
|
+
x: e ? r.x : i.x,
|
|
401
|
+
y: e ? i.y : r.y,
|
|
402
|
+
width: e ? r.width : i.width,
|
|
403
|
+
height: e ? i.height : r.height
|
|
404
|
+
};
|
|
405
|
+
} else {
|
|
406
|
+
var i = n.getArea(), a = t;
|
|
407
|
+
return {
|
|
408
|
+
cx: i.cx,
|
|
409
|
+
cy: i.cy,
|
|
410
|
+
r0: e ? i.r0 : a.r0,
|
|
411
|
+
r: e ? i.r : a.r,
|
|
412
|
+
startAngle: e ? a.startAngle : 0,
|
|
413
|
+
endAngle: e ? a.endAngle : Math.PI * 2
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function ee(e, t, n) {
|
|
418
|
+
return new (e.type === "polar" ? f : a)({
|
|
419
|
+
shape: $(t, n, e),
|
|
420
|
+
silent: !0,
|
|
421
|
+
z2: 0
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function te(e, t) {
|
|
425
|
+
return e.height === 0 ? t.getOtherAxis(t.getBaseAxis()).inverse ? "bottom" : "top" : e.height > 0 ? "bottom" : "top";
|
|
426
|
+
}
|
|
427
|
+
function ne(e, t) {
|
|
428
|
+
return e.width === 0 ? t.getOtherAxis(t.getBaseAxis()).inverse ? "left" : "right" : e.width >= 0 ? "right" : "left";
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
export { P as default };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __extends as e } from "../../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import { each as t } from "../../../../zrender/lib/core/util.js";
|
|
3
|
+
import n from "../helper/createSeriesData.js";
|
|
4
|
+
import r from "../../model/Series.js";
|
|
5
|
+
//#region node_modules/echarts/lib/chart/bar/BaseBarSeries.js
|
|
6
|
+
var i = function(r) {
|
|
7
|
+
e(i, r);
|
|
8
|
+
function i() {
|
|
9
|
+
var e = r !== null && r.apply(this, arguments) || this;
|
|
10
|
+
return e.type = i.type, e;
|
|
11
|
+
}
|
|
12
|
+
return i.prototype.getInitialData = function(e, t) {
|
|
13
|
+
return n(null, this, { useEncodeDefaulter: !0 });
|
|
14
|
+
}, i.prototype.getMarkerPosition = function(e, n, r) {
|
|
15
|
+
var i = this.coordinateSystem;
|
|
16
|
+
if (i && i.clampData) {
|
|
17
|
+
var a = i.clampData(e), o = i.dataToPoint(a);
|
|
18
|
+
if (r) t(i.getAxes(), function(e, t) {
|
|
19
|
+
if (e.type === "category" && n != null) {
|
|
20
|
+
var r = e.getTicksCoords(), i = e.getTickModel().get("alignWithLabel"), s = a[t], c = n[t] === "x1" || n[t] === "y1";
|
|
21
|
+
if (c && !i && (s += 1), r.length < 2) return;
|
|
22
|
+
if (r.length === 2) {
|
|
23
|
+
o[t] = e.toGlobalCoord(e.getExtent()[+!!c]);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
for (var l = void 0, u = void 0, d = 1, f = 0; f < r.length; f++) {
|
|
27
|
+
var p = r[f].coord, m = f === r.length - 1 ? r[f - 1].tickValue + d : r[f].tickValue;
|
|
28
|
+
if (m === s) {
|
|
29
|
+
u = p;
|
|
30
|
+
break;
|
|
31
|
+
} else if (m < s) l = p;
|
|
32
|
+
else if (l != null && m > s) {
|
|
33
|
+
u = (p + l) / 2;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
f === 1 && (d = m - r[0].tickValue);
|
|
37
|
+
}
|
|
38
|
+
u ?? (l ? l && (u = r[r.length - 1].coord) : u = r[0].coord), o[t] = e.toGlobalCoord(u);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
else {
|
|
42
|
+
var s = this.getData(), c = s.getLayout("offset"), l = s.getLayout("size"), u = +!i.getBaseAxis().isHorizontal();
|
|
43
|
+
o[u] += c + l / 2;
|
|
44
|
+
}
|
|
45
|
+
return o;
|
|
46
|
+
}
|
|
47
|
+
return [NaN, NaN];
|
|
48
|
+
}, i.prototype.__requireStartValue = function(e) {
|
|
49
|
+
return this.getBaseAxis() !== e;
|
|
50
|
+
}, i.type = "series.__base_bar__", i.defaultOption = {
|
|
51
|
+
z: 2,
|
|
52
|
+
coordinateSystem: "cartesian2d",
|
|
53
|
+
legendHoverLink: !0,
|
|
54
|
+
barMinHeight: 0,
|
|
55
|
+
barMinAngle: 0,
|
|
56
|
+
large: !1,
|
|
57
|
+
largeThreshold: 400,
|
|
58
|
+
progressive: 3e3,
|
|
59
|
+
progressiveChunkMode: "mod",
|
|
60
|
+
defaultBarGap: "10%"
|
|
61
|
+
}, i;
|
|
62
|
+
}(r);
|
|
63
|
+
r.registerClass(i);
|
|
64
|
+
//#endregion
|
|
65
|
+
export { i as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import e from "../../processor/dataSample.js";
|
|
2
|
+
import { createCrossSeriesLayoutHandler as t, createProgressiveLayout as n, registerBarGridAxisHandlers as r } from "../../layout/barGrid.js";
|
|
3
|
+
import i from "./BarSeries.js";
|
|
4
|
+
import a from "./BarView.js";
|
|
5
|
+
//#region node_modules/echarts/lib/chart/bar/install.js
|
|
6
|
+
function o(o) {
|
|
7
|
+
o.registerChartView(a), o.registerSeriesModel(i), o.registerLayout(o.PRIORITY.VISUAL.LAYOUT, t("bar")), o.registerLayout(o.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, n("bar")), o.registerProcessor(o.PRIORITY.PROCESSOR.STATISTIC, e("bar")), o.registerAction({
|
|
8
|
+
type: "changeAxisOrder",
|
|
9
|
+
event: "changeAxisOrder",
|
|
10
|
+
update: "update"
|
|
11
|
+
}, function(e, t) {
|
|
12
|
+
var n = e.componentType || "series";
|
|
13
|
+
t.eachComponent({
|
|
14
|
+
mainType: n,
|
|
15
|
+
query: e
|
|
16
|
+
}, function(t) {
|
|
17
|
+
e.sortInfo && t.axis.setCategorySortInfo(e.sortInfo);
|
|
18
|
+
});
|
|
19
|
+
}), r(o);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { o as install };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { __extends as e } from "../../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import { extend as t, retrieve2 as n } from "../../../../zrender/lib/core/util.js";
|
|
3
|
+
import r from "../../../../zrender/lib/graphic/Image.js";
|
|
4
|
+
import { getECData as i } from "../../util/innerStore.js";
|
|
5
|
+
import { enterEmphasis as a, leaveEmphasis as o, toggleHoverEmphasis as s } from "../../util/states.js";
|
|
6
|
+
import c from "../../../../zrender/lib/graphic/Group.js";
|
|
7
|
+
import { initProps as l, removeElement as u, saveOldStyle as d, updateProps as f } from "../../animation/basicTransition.js";
|
|
8
|
+
import { getLabelStatesModels as p, setLabelStyle as m } from "../../label/labelStyle.js";
|
|
9
|
+
import { createSymbol as h, normalizeSymbolOffset as g, normalizeSymbolSize as _ } from "../../util/symbol.js";
|
|
10
|
+
import { getDefaultLabel as v } from "./labelHelper.js";
|
|
11
|
+
//#region node_modules/echarts/lib/chart/helper/Symbol.js
|
|
12
|
+
var y = function(c) {
|
|
13
|
+
e(y, c);
|
|
14
|
+
function y(e, t, n, r) {
|
|
15
|
+
var i = c.call(this) || this;
|
|
16
|
+
return i.updateData(e, t, n, r), i;
|
|
17
|
+
}
|
|
18
|
+
return y.prototype._createSymbol = function(e, t, r, i, a, o) {
|
|
19
|
+
this.removeAll();
|
|
20
|
+
var s = h(e, -1, -1, 2, 2, null, o);
|
|
21
|
+
s.attr({
|
|
22
|
+
z2: n(a, 100),
|
|
23
|
+
culling: !0,
|
|
24
|
+
scaleX: i[0] / 2,
|
|
25
|
+
scaleY: i[1] / 2
|
|
26
|
+
}), s.drift = b, this._symbolType = e, this.add(s);
|
|
27
|
+
}, y.prototype.stopSymbolAnimation = function(e) {
|
|
28
|
+
this.childAt(0).stopAnimation(null, e);
|
|
29
|
+
}, y.prototype.getSymbolType = function() {
|
|
30
|
+
return this._symbolType;
|
|
31
|
+
}, y.prototype.getSymbolPath = function() {
|
|
32
|
+
return this.childAt(0);
|
|
33
|
+
}, y.prototype.highlight = function() {
|
|
34
|
+
a(this.childAt(0));
|
|
35
|
+
}, y.prototype.downplay = function() {
|
|
36
|
+
o(this.childAt(0));
|
|
37
|
+
}, y.prototype.setZ = function(e, t) {
|
|
38
|
+
var n = this.childAt(0);
|
|
39
|
+
n.zlevel = e, n.z = t;
|
|
40
|
+
}, y.prototype.setDraggable = function(e, t) {
|
|
41
|
+
var n = this.childAt(0);
|
|
42
|
+
n.draggable = e, n.cursor = !t && e ? "move" : n.cursor;
|
|
43
|
+
}, y.prototype.updateData = function(e, t, n, r) {
|
|
44
|
+
this.silent = !1;
|
|
45
|
+
var i = e.getItemVisual(t, "symbol") || "circle", a = e.hostModel, o = y.getSymbolSize(e, t), s = y.getSymbolZ2(e, t), c = i !== this._symbolType, u = r && r.disableAnimation;
|
|
46
|
+
if (c) {
|
|
47
|
+
var p = e.getItemVisual(t, "symbolKeepAspect");
|
|
48
|
+
this._createSymbol(i, e, t, o, s, p);
|
|
49
|
+
} else {
|
|
50
|
+
var m = this.childAt(0);
|
|
51
|
+
m.silent = !1;
|
|
52
|
+
var h = {
|
|
53
|
+
scaleX: o[0] / 2,
|
|
54
|
+
scaleY: o[1] / 2
|
|
55
|
+
};
|
|
56
|
+
u ? m.attr(h) : f(m, h, a, t), d(m);
|
|
57
|
+
}
|
|
58
|
+
if (this._updateCommon(e, t, o, n, r), c) {
|
|
59
|
+
var m = this.childAt(0);
|
|
60
|
+
if (!u) {
|
|
61
|
+
var h = {
|
|
62
|
+
scaleX: this._sizeX,
|
|
63
|
+
scaleY: this._sizeY,
|
|
64
|
+
style: { opacity: m.style.opacity }
|
|
65
|
+
};
|
|
66
|
+
m.scaleX = m.scaleY = 0, m.style.opacity = 0, l(m, h, a, t);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
u && this.childAt(0).stopAnimation("leave");
|
|
70
|
+
}, y.prototype._updateCommon = function(e, n, i, a, o) {
|
|
71
|
+
var c = this.childAt(0), l = e.hostModel, u, d, f, h, _, y, b, x, S;
|
|
72
|
+
if (a && (u = a.emphasisItemStyle, d = a.blurItemStyle, f = a.selectItemStyle, h = a.focus, _ = a.blurScope, b = a.labelStatesModels, x = a.hoverScale, S = a.cursorStyle, y = a.emphasisDisabled), !a || e.hasItemOption) {
|
|
73
|
+
var C = a && a.itemModel ? a.itemModel : e.getItemModel(n), w = C.getModel("emphasis");
|
|
74
|
+
u = w.getModel("itemStyle").getItemStyle(), f = C.getModel(["select", "itemStyle"]).getItemStyle(), d = C.getModel(["blur", "itemStyle"]).getItemStyle(), h = w.get("focus"), _ = w.get("blurScope"), y = w.get("disabled"), b = p(C), x = w.getShallow("scale"), S = C.getShallow("cursor");
|
|
75
|
+
}
|
|
76
|
+
var T = e.getItemVisual(n, "symbolRotate");
|
|
77
|
+
c.attr("rotation", (T || 0) * Math.PI / 180 || 0);
|
|
78
|
+
var E = g(e.getItemVisual(n, "symbolOffset"), i);
|
|
79
|
+
E && (c.x = E[0], c.y = E[1]), S && c.attr("cursor", S);
|
|
80
|
+
var D = e.getItemVisual(n, "style"), O = D.fill;
|
|
81
|
+
if (c instanceof r) {
|
|
82
|
+
var k = c.style;
|
|
83
|
+
c.useStyle(t({
|
|
84
|
+
image: k.image,
|
|
85
|
+
x: k.x,
|
|
86
|
+
y: k.y,
|
|
87
|
+
width: k.width,
|
|
88
|
+
height: k.height
|
|
89
|
+
}, D));
|
|
90
|
+
} else c.__isEmptyBrush ? c.useStyle(t({}, D)) : c.useStyle(D), c.style.decal = null, c.setColor(O, o && o.symbolInnerColor), c.style.strokeNoScale = !0;
|
|
91
|
+
var A = e.getItemVisual(n, "liftZ"), j = this._z2;
|
|
92
|
+
A == null ? j != null && (c.z2 = j, this._z2 = null) : j ?? (this._z2 = c.z2, c.z2 += A);
|
|
93
|
+
var M = o && o.useNameLabel;
|
|
94
|
+
m(c, b, {
|
|
95
|
+
labelFetcher: l,
|
|
96
|
+
labelDataIndex: n,
|
|
97
|
+
defaultText: N,
|
|
98
|
+
inheritColor: O,
|
|
99
|
+
defaultOpacity: D.opacity
|
|
100
|
+
});
|
|
101
|
+
function N(t) {
|
|
102
|
+
return M ? e.getName(t) : v(e, t);
|
|
103
|
+
}
|
|
104
|
+
this._sizeX = i[0] / 2, this._sizeY = i[1] / 2;
|
|
105
|
+
var P = c.ensureState("emphasis");
|
|
106
|
+
P.style = u, c.ensureState("select").style = f, c.ensureState("blur").style = d;
|
|
107
|
+
var F = x == null || x === !0 ? Math.max(1.1, 3 / this._sizeY) : isFinite(x) && x > 0 ? +x : 1;
|
|
108
|
+
P.scaleX = this._sizeX * F, P.scaleY = this._sizeY * F, this.setSymbolScale(1), s(this, h, _, y);
|
|
109
|
+
}, y.prototype.setSymbolScale = function(e) {
|
|
110
|
+
this.scaleX = this.scaleY = e;
|
|
111
|
+
}, y.prototype.fadeOut = function(e, t, n) {
|
|
112
|
+
var r = this.childAt(0), a = i(this).dataIndex, o = n && n.animation;
|
|
113
|
+
if (this.silent = r.silent = !0, n && n.fadeLabel) {
|
|
114
|
+
var s = r.getTextContent();
|
|
115
|
+
s && u(s, { style: { opacity: 0 } }, t, {
|
|
116
|
+
dataIndex: a,
|
|
117
|
+
removeOpt: o,
|
|
118
|
+
cb: function() {
|
|
119
|
+
r.removeTextContent();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
} else r.removeTextContent();
|
|
123
|
+
u(r, {
|
|
124
|
+
style: { opacity: 0 },
|
|
125
|
+
scaleX: 0,
|
|
126
|
+
scaleY: 0
|
|
127
|
+
}, t, {
|
|
128
|
+
dataIndex: a,
|
|
129
|
+
cb: e,
|
|
130
|
+
removeOpt: o
|
|
131
|
+
});
|
|
132
|
+
}, y.getSymbolSize = function(e, t) {
|
|
133
|
+
return _(e.getItemVisual(t, "symbolSize"));
|
|
134
|
+
}, y.getSymbolZ2 = function(e, t) {
|
|
135
|
+
return e.getItemVisual(t, "z2");
|
|
136
|
+
}, y;
|
|
137
|
+
}(c);
|
|
138
|
+
function b(e, t) {
|
|
139
|
+
this.parent.drift(e, t);
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { y as default };
|