reke-ui 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/custom-elements.json +1888 -445
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/components/reke-chip/reke-chip.d.ts +7 -0
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +8 -2
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +32 -0
- package/dist/components/reke-combobox/reke-combobox.d.ts +21 -1
- package/dist/components/reke-combobox/reke-combobox.d.ts.map +1 -1
- package/dist/components/reke-combobox/reke-combobox.js +76 -16
- package/dist/components/reke-combobox/reke-combobox.styles.d.ts.map +1 -1
- package/dist/components/reke-combobox/reke-combobox.styles.js +128 -0
- package/dist/components/reke-input/reke-input.d.ts +14 -0
- package/dist/components/reke-input/reke-input.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.js +41 -22
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +44 -16
- package/dist/components/reke-menu/reke-menu.d.ts +51 -0
- package/dist/components/reke-menu/reke-menu.d.ts.map +1 -0
- package/dist/components/reke-menu/reke-menu.js +106 -0
- package/dist/components/reke-menu/reke-menu.styles.d.ts +2 -0
- package/dist/components/reke-menu/reke-menu.styles.d.ts.map +1 -0
- package/dist/components/reke-menu/reke-menu.styles.js +25 -0
- package/dist/components/reke-menu-item/reke-menu-item.d.ts +32 -0
- package/dist/components/reke-menu-item/reke-menu-item.d.ts.map +1 -0
- package/dist/components/reke-menu-item/reke-menu-item.js +49 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.d.ts +2 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.d.ts.map +1 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.js +53 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts +59 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts.map +1 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.js +117 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.d.ts +2 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.d.ts.map +1 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.js +28 -0
- package/dist/components/reke-table/reke-table.d.ts +202 -3
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +244 -64
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +29 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- package/dist/node_modules/echarts/lib/animation/basicTransition.js +70 -0
- package/dist/node_modules/echarts/lib/chart/custom/customSeriesRegister.js +7 -0
- package/dist/node_modules/echarts/lib/chart/helper/createRenderPlanner.js +11 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js +11 -0
- package/dist/node_modules/echarts/lib/chart/helper/sectorHelper.js +19 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieSeries.js +112 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieView.js +119 -0
- package/dist/node_modules/echarts/lib/chart/pie/install.js +12 -0
- package/dist/node_modules/echarts/lib/chart/pie/labelLayout.js +190 -0
- package/dist/node_modules/echarts/lib/chart/pie/pieLayout.js +72 -0
- package/dist/node_modules/echarts/lib/component/axis/AxisBuilder.js +554 -0
- package/dist/node_modules/echarts/lib/component/axis/AxisView.js +36 -0
- package/dist/node_modules/echarts/lib/component/axis/axisAction.js +4 -0
- package/dist/node_modules/echarts/lib/component/axis/axisBreakHelper.js +5 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js +57 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/AxisPointerView.js +28 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js +174 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js +65 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/axisTrigger.js +189 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js +27 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/globalListener.js +56 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/install.js +25 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/modelHelper.js +117 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/viewHelper.js +103 -0
- package/dist/node_modules/echarts/lib/component/helper/listComponent.js +20 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendModel.js +184 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendView.js +227 -0
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendModel.js +45 -0
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendView.js +145 -0
- package/dist/node_modules/echarts/lib/component/legend/install.js +9 -0
- package/dist/node_modules/echarts/lib/component/legend/installLegendPlain.js +12 -0
- package/dist/node_modules/echarts/lib/component/legend/installLegendScroll.js +11 -0
- package/dist/node_modules/echarts/lib/component/legend/legendAction.js +38 -0
- package/dist/node_modules/echarts/lib/component/legend/legendFilter.js +12 -0
- package/dist/node_modules/echarts/lib/component/legend/scrollableLegendAction.js +15 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js +170 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipModel.js +55 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipRichContent.js +102 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipView.js +367 -0
- package/dist/node_modules/echarts/lib/component/tooltip/helper.js +37 -0
- package/dist/node_modules/echarts/lib/component/tooltip/install.js +19 -0
- package/dist/node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js +56 -0
- package/dist/node_modules/echarts/lib/component/tooltip/tooltipMarkup.js +173 -0
- package/dist/node_modules/echarts/lib/coord/axisBand.js +31 -0
- package/dist/node_modules/echarts/lib/coord/axisHelper.js +21 -0
- package/dist/node_modules/echarts/lib/coord/axisStatistics.js +38 -0
- package/dist/node_modules/echarts/lib/coord/axisTickLabelBuilder.js +14 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js +31 -0
- package/dist/node_modules/echarts/lib/core/CoordinateSystem.js +50 -0
- package/dist/node_modules/echarts/lib/core/ExtensionAPI.js +32 -0
- package/dist/node_modules/echarts/lib/core/Scheduler.js +203 -0
- package/dist/node_modules/echarts/lib/core/echarts.js +986 -0
- package/dist/node_modules/echarts/lib/core/impl.js +11 -0
- package/dist/node_modules/echarts/lib/core/lifecycle.js +5 -0
- package/dist/node_modules/echarts/lib/core/locale.js +27 -0
- package/dist/node_modules/echarts/lib/core/task.js +81 -0
- package/dist/node_modules/echarts/lib/data/DataDiffer.js +68 -0
- package/dist/node_modules/echarts/lib/data/DataStore.js +359 -0
- package/dist/node_modules/echarts/lib/data/SeriesData.js +328 -0
- package/dist/node_modules/echarts/lib/data/SeriesDimensionDefine.js +10 -0
- package/dist/node_modules/echarts/lib/data/Source.js +132 -0
- package/dist/node_modules/echarts/lib/data/helper/SeriesDataSchema.js +80 -0
- package/dist/node_modules/echarts/lib/data/helper/createDimensions.js +105 -0
- package/dist/node_modules/echarts/lib/data/helper/dataProvider.js +155 -0
- package/dist/node_modules/echarts/lib/data/helper/dataValueHelper.js +87 -0
- package/dist/node_modules/echarts/lib/data/helper/dimensionHelper.js +50 -0
- package/dist/node_modules/echarts/lib/data/helper/sourceHelper.js +98 -0
- package/dist/node_modules/echarts/lib/data/helper/sourceManager.js +115 -0
- package/dist/node_modules/echarts/lib/data/helper/transform.js +145 -0
- package/dist/node_modules/echarts/lib/extension.js +62 -0
- package/dist/node_modules/echarts/lib/i18n/langEN.js +148 -0
- package/dist/node_modules/echarts/lib/i18n/langZH.js +148 -0
- package/dist/node_modules/echarts/lib/label/labelGuideHelper.js +106 -0
- package/dist/node_modules/echarts/lib/label/labelLayoutHelper.js +152 -0
- package/dist/node_modules/echarts/lib/label/labelStyle.js +190 -0
- package/dist/node_modules/echarts/lib/legacy/dataSelectAction.js +53 -0
- package/dist/node_modules/echarts/lib/loading/default.js +85 -0
- package/dist/node_modules/echarts/lib/model/Component.js +64 -0
- package/dist/node_modules/echarts/lib/model/Global.js +320 -0
- package/dist/node_modules/echarts/lib/model/Model.js +50 -0
- package/dist/node_modules/echarts/lib/model/OptionManager.js +78 -0
- package/dist/node_modules/echarts/lib/model/Series.js +216 -0
- package/dist/node_modules/echarts/lib/model/globalDefault.js +94 -0
- package/dist/node_modules/echarts/lib/model/internalComponentCreator.js +14 -0
- package/dist/node_modules/echarts/lib/model/mixin/areaStyle.js +16 -0
- package/dist/node_modules/echarts/lib/model/mixin/dataFormat.js +63 -0
- package/dist/node_modules/echarts/lib/model/mixin/itemStyle.js +24 -0
- package/dist/node_modules/echarts/lib/model/mixin/lineStyle.js +23 -0
- package/dist/node_modules/echarts/lib/model/mixin/makeStyleMapper.js +17 -0
- package/dist/node_modules/echarts/lib/model/mixin/palette.js +32 -0
- package/dist/node_modules/echarts/lib/model/mixin/textStyle.js +36 -0
- package/dist/node_modules/echarts/lib/preprocessor/backwardCompat.js +89 -0
- package/dist/node_modules/echarts/lib/preprocessor/helper/compatStyle.js +118 -0
- package/dist/node_modules/echarts/lib/processor/dataFilter.js +18 -0
- package/dist/node_modules/echarts/lib/processor/dataStack.js +52 -0
- package/dist/node_modules/echarts/lib/processor/negativeDataFilter.js +16 -0
- package/dist/node_modules/echarts/lib/renderer/installCanvasRenderer.js +7 -0
- package/dist/node_modules/echarts/lib/scale/break.js +9 -0
- package/dist/node_modules/echarts/lib/scale/helper.js +9 -0
- package/dist/node_modules/echarts/lib/scale/scaleMapper.js +26 -0
- package/dist/node_modules/echarts/lib/theme/dark.js +159 -0
- package/dist/node_modules/echarts/lib/util/ECEventProcessor.js +52 -0
- package/dist/node_modules/echarts/lib/util/clazz.js +99 -0
- package/dist/node_modules/echarts/lib/util/component.js +75 -0
- package/dist/node_modules/echarts/lib/util/cycleCache.js +14 -0
- package/dist/node_modules/echarts/lib/util/decal.js +162 -0
- package/dist/node_modules/echarts/lib/util/event.js +7 -0
- package/dist/node_modules/echarts/lib/util/format.js +87 -0
- package/dist/node_modules/echarts/lib/util/graphic.js +361 -0
- package/dist/node_modules/echarts/lib/util/innerStore.js +13 -0
- package/dist/node_modules/echarts/lib/util/layout.js +174 -0
- package/dist/node_modules/echarts/lib/util/log.js +54 -0
- package/dist/node_modules/echarts/lib/util/model.js +296 -0
- package/dist/node_modules/echarts/lib/util/number.js +132 -0
- package/dist/node_modules/echarts/lib/util/states.js +323 -0
- package/dist/node_modules/echarts/lib/util/symbol.js +146 -0
- package/dist/node_modules/echarts/lib/util/throttle.js +37 -0
- package/dist/node_modules/echarts/lib/util/time.js +43 -0
- package/dist/node_modules/echarts/lib/util/types.js +13 -0
- package/dist/node_modules/echarts/lib/view/Chart.js +81 -0
- package/dist/node_modules/echarts/lib/view/Component.js +16 -0
- package/dist/node_modules/echarts/lib/visual/LegendVisualProvider.js +18 -0
- package/dist/node_modules/echarts/lib/visual/decal.js +25 -0
- package/dist/node_modules/echarts/lib/visual/helper.js +23 -0
- package/dist/node_modules/echarts/lib/visual/style.js +79 -0
- package/dist/node_modules/echarts/lib/visual/symbol.js +47 -0
- package/dist/node_modules/echarts/lib/visual/tokens.js +108 -0
- package/dist/node_modules/echarts/node_modules/tslib/tslib.es6.js +18 -0
- package/dist/node_modules/zrender/lib/Element.js +442 -0
- package/dist/node_modules/zrender/lib/Handler.js +167 -0
- package/dist/node_modules/zrender/lib/Storage.js +68 -0
- package/dist/node_modules/zrender/lib/animation/Animation.js +65 -0
- package/dist/node_modules/zrender/lib/animation/Animator.js +348 -0
- package/dist/node_modules/zrender/lib/animation/Clip.js +31 -0
- package/dist/node_modules/zrender/lib/animation/cubicEasing.js +17 -0
- package/dist/node_modules/zrender/lib/animation/easing.js +104 -0
- package/dist/node_modules/zrender/lib/animation/requestAnimationFrame.js +7 -0
- package/dist/node_modules/zrender/lib/canvas/Layer.js +135 -0
- package/dist/node_modules/zrender/lib/canvas/Painter.js +352 -0
- package/dist/node_modules/zrender/lib/canvas/dashStyle.js +17 -0
- package/dist/node_modules/zrender/lib/canvas/graphic.js +199 -0
- package/dist/node_modules/zrender/lib/canvas/helper.js +33 -0
- package/dist/node_modules/zrender/lib/config.js +7 -0
- package/dist/node_modules/zrender/lib/contain/arc.js +20 -0
- package/dist/node_modules/zrender/lib/contain/cubic.js +9 -0
- package/dist/node_modules/zrender/lib/contain/line.js +12 -0
- package/dist/node_modules/zrender/lib/contain/path.js +133 -0
- package/dist/node_modules/zrender/lib/contain/quadratic.js +9 -0
- package/dist/node_modules/zrender/lib/contain/text.js +106 -0
- package/dist/node_modules/zrender/lib/contain/util.js +7 -0
- package/dist/node_modules/zrender/lib/contain/windingLine.js +10 -0
- package/dist/node_modules/zrender/lib/core/BoundingRect.js +111 -0
- package/dist/node_modules/zrender/lib/core/Eventful.js +82 -0
- package/dist/node_modules/zrender/lib/core/GestureMgr.js +56 -0
- package/dist/node_modules/zrender/lib/core/LRU.js +49 -0
- package/dist/node_modules/zrender/lib/core/OrientedBoundingRect.js +41 -0
- package/dist/node_modules/zrender/lib/core/PathProxy.js +288 -0
- package/dist/node_modules/zrender/lib/core/Point.js +72 -0
- package/dist/node_modules/zrender/lib/core/Transformable.js +96 -0
- package/dist/node_modules/zrender/lib/core/WeakMap.js +25 -0
- package/dist/node_modules/zrender/lib/core/bbox.js +40 -0
- package/dist/node_modules/zrender/lib/core/curve.js +142 -0
- package/dist/node_modules/zrender/lib/core/dom.js +74 -0
- package/dist/node_modules/zrender/lib/core/env.js +22 -0
- package/dist/node_modules/zrender/lib/core/event.js +58 -0
- package/dist/node_modules/zrender/lib/core/fourPointsTransform.js +109 -0
- package/dist/node_modules/zrender/lib/core/matrix.js +39 -0
- package/dist/node_modules/zrender/lib/core/platform.js +42 -0
- package/dist/node_modules/zrender/lib/core/timsort.js +246 -0
- package/dist/node_modules/zrender/lib/core/util.js +314 -0
- package/dist/node_modules/zrender/lib/core/vector.js +52 -0
- package/dist/node_modules/zrender/lib/dom/HandlerProxy.js +190 -0
- package/dist/node_modules/zrender/lib/graphic/CompoundPath.js +25 -0
- package/dist/node_modules/zrender/lib/graphic/Displayable.js +133 -0
- package/dist/node_modules/zrender/lib/graphic/Gradient.js +14 -0
- package/dist/node_modules/zrender/lib/graphic/Group.js +86 -0
- package/dist/node_modules/zrender/lib/graphic/Image.js +49 -0
- package/dist/node_modules/zrender/lib/graphic/IncrementalDisplayable.js +65 -0
- package/dist/node_modules/zrender/lib/graphic/LinearGradient.js +13 -0
- package/dist/node_modules/zrender/lib/graphic/Path.js +200 -0
- package/dist/node_modules/zrender/lib/graphic/RadialGradient.js +13 -0
- package/dist/node_modules/zrender/lib/graphic/TSpan.js +39 -0
- package/dist/node_modules/zrender/lib/graphic/Text.js +216 -0
- package/dist/node_modules/zrender/lib/graphic/helper/image.js +39 -0
- package/dist/node_modules/zrender/lib/graphic/helper/parseText.js +226 -0
- package/dist/node_modules/zrender/lib/graphic/helper/poly.js +21 -0
- package/dist/node_modules/zrender/lib/graphic/helper/roundRect.js +9 -0
- package/dist/node_modules/zrender/lib/graphic/helper/roundSector.js +85 -0
- package/dist/node_modules/zrender/lib/graphic/helper/smoothBezier.js +26 -0
- package/dist/node_modules/zrender/lib/graphic/helper/subPixelOptimize.js +25 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Arc.js +28 -0
- package/dist/node_modules/zrender/lib/graphic/shape/BezierCurve.js +40 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Circle.js +22 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Ellipse.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Line.js +37 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Polygon.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Polyline.js +28 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Rect.js +31 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Ring.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Sector.js +25 -0
- package/dist/node_modules/zrender/lib/mixin/Draggable.js +28 -0
- package/dist/node_modules/zrender/lib/svg/helper.js +19 -0
- package/dist/node_modules/zrender/lib/tool/color.js +1039 -0
- package/dist/node_modules/zrender/lib/tool/path.js +153 -0
- package/dist/node_modules/zrender/lib/tool/transformPath.js +41 -0
- package/dist/node_modules/zrender/lib/zrender.js +124 -0
- package/dist/node_modules/zrender/node_modules/tslib/tslib.es6.js +18 -0
- package/dist/react-bridge/table.d.ts.map +1 -1
- package/dist/react-bridge/table.js +36 -21
- package/dist/react.d.ts +8 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +58 -46
- package/dist/shared/base-element.d.ts +1 -0
- package/dist/shared/base-element.d.ts.map +1 -1
- package/dist/shared/base-element.js +6 -0
- package/dist/shared/tailwind.js +1 -1
- package/dist/tokens/reke-tokens.css +15 -0
- package/package.json +15 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { platformApi as e } from "../core/platform.js";
|
|
2
|
+
import { disableUserSelect as t, each as n, isGradientObject as r, isImagePatternObject as i, isObject as a } from "../core/util.js";
|
|
3
|
+
import { __extends as o } from "../../node_modules/tslib/tslib.es6.js";
|
|
4
|
+
import s from "../core/BoundingRect.js";
|
|
5
|
+
import c from "../core/Eventful.js";
|
|
6
|
+
import { devicePixelRatio as l } from "../config.js";
|
|
7
|
+
import { getCanvasGradient as u } from "./helper.js";
|
|
8
|
+
import { createCanvasPattern as d } from "./graphic.js";
|
|
9
|
+
//#region node_modules/zrender/lib/canvas/Layer.js
|
|
10
|
+
function f(t, n, r) {
|
|
11
|
+
var i = e.createCanvas(), a = n.getWidth(), o = n.getHeight(), s = i.style;
|
|
12
|
+
return s && (s.position = "absolute", s.left = "0", s.top = "0", s.width = a + "px", s.height = o + "px", i.setAttribute("data-zr-dom-id", t)), i.width = a * r, i.height = o * r, i;
|
|
13
|
+
}
|
|
14
|
+
function p(e) {
|
|
15
|
+
return !e.__cursors.get(0);
|
|
16
|
+
}
|
|
17
|
+
function m(e) {
|
|
18
|
+
var t = e.__cursors.get(0);
|
|
19
|
+
return {
|
|
20
|
+
startIdx: t ? t.startIdx : 0,
|
|
21
|
+
endIdx: t ? t.endIdx : 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var h = function(e) {
|
|
25
|
+
o(c, e);
|
|
26
|
+
function c(n, r, i) {
|
|
27
|
+
var o = e.call(this) || this;
|
|
28
|
+
o.motionBlur = !1, o.lastFrameAlpha = .7, o.dpr = 1, o.virtual = !1, o.config = {}, o.zlevel = 0, o.zlevel2 = 0, o.maxRepaintRectCount = 5, o.__dirty = !0, o.__firstTimePaint = !0, o.__prevIdx = {
|
|
29
|
+
startIdx: 0,
|
|
30
|
+
endIdx: 0
|
|
31
|
+
};
|
|
32
|
+
var s;
|
|
33
|
+
i ||= l, typeof n == "string" ? s = f(n, r, i) : a(n) && (s = n, n = s.id), o.id = n, o.dom = s;
|
|
34
|
+
var c = s.style;
|
|
35
|
+
return c && (t(s), s.onselectstart = function() {
|
|
36
|
+
return !1;
|
|
37
|
+
}, c.padding = "0", c.margin = "0", c.borderWidth = "0"), o.painter = r, o.dpr = i, o;
|
|
38
|
+
}
|
|
39
|
+
return c.prototype.afterBrush = function() {
|
|
40
|
+
this.__prevIdx = m(this);
|
|
41
|
+
}, c.prototype.initContext = function() {
|
|
42
|
+
this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr;
|
|
43
|
+
}, c.prototype.setUnpainted = function() {
|
|
44
|
+
this.__firstTimePaint = !0;
|
|
45
|
+
}, c.prototype.createBackBuffer = function() {
|
|
46
|
+
var e = this.dpr;
|
|
47
|
+
this.domBack = f("back-" + this.id, this.painter, e), this.ctxBack = this.domBack.getContext("2d"), e !== 1 && this.ctxBack.scale(e, e);
|
|
48
|
+
}, c.prototype.createRepaintRects = function(e, t, n, r) {
|
|
49
|
+
if (this.__firstTimePaint) return this.__firstTimePaint = !1, null;
|
|
50
|
+
var i = [], a = this.maxRepaintRectCount, o = !1, c = new s(0, 0, 0, 0);
|
|
51
|
+
function l(e) {
|
|
52
|
+
if (!(!e.isFinite() || e.isZero())) if (i.length === 0) {
|
|
53
|
+
var t = new s(0, 0, 0, 0);
|
|
54
|
+
t.copy(e), i.push(t);
|
|
55
|
+
} else {
|
|
56
|
+
for (var n = !1, r = Infinity, l = 0, u = 0; u < i.length; ++u) {
|
|
57
|
+
var d = i[u];
|
|
58
|
+
if (d.intersect(e)) {
|
|
59
|
+
var f = new s(0, 0, 0, 0);
|
|
60
|
+
f.copy(d), f.union(e), i[u] = f, n = !0;
|
|
61
|
+
break;
|
|
62
|
+
} else if (o) {
|
|
63
|
+
c.copy(e), c.union(d);
|
|
64
|
+
var p = e.width * e.height, m = d.width * d.height, h = c.width * c.height - p - m;
|
|
65
|
+
h < r && (r = h, l = u);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (o && (i[l].union(e), n = !0), !n) {
|
|
69
|
+
var t = new s(0, 0, 0, 0);
|
|
70
|
+
t.copy(e), i.push(t);
|
|
71
|
+
}
|
|
72
|
+
o ||= i.length >= a;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (var u = m(this), d = u.startIdx; d < u.endIdx; ++d) {
|
|
76
|
+
var f = e[d];
|
|
77
|
+
if (f) {
|
|
78
|
+
var p = f.shouldBePainted(n, r, !0, !0), h = f.__isRendered && (f.__dirty & 1 || !p) ? f.getPrevPaintRect() : null;
|
|
79
|
+
h && l(h);
|
|
80
|
+
var g = p && (f.__dirty & 1 || !f.__isRendered) ? f.getPaintRect() : null;
|
|
81
|
+
g && l(g);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (var _ = this.__prevIdx, d = _.startIdx; d < _.endIdx; ++d) {
|
|
85
|
+
var f = t[d], p = f && f.shouldBePainted(n, r, !0, !0);
|
|
86
|
+
if (f && (!p || !f.__zr) && f.__isRendered) {
|
|
87
|
+
var h = f.getPrevPaintRect();
|
|
88
|
+
h && l(h);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var v;
|
|
92
|
+
do {
|
|
93
|
+
v = !1;
|
|
94
|
+
for (var d = 0; d < i.length;) {
|
|
95
|
+
if (i[d].isZero()) {
|
|
96
|
+
i.splice(d, 1);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
for (var y = d + 1; y < i.length;) i[d].intersect(i[y]) ? (v = !0, i[d].union(i[y]), i.splice(y, 1)) : y++;
|
|
100
|
+
d++;
|
|
101
|
+
}
|
|
102
|
+
} while (v);
|
|
103
|
+
return this._paintRects = i, i;
|
|
104
|
+
}, c.prototype.debugGetPaintRects = function() {
|
|
105
|
+
return (this._paintRects || []).slice();
|
|
106
|
+
}, c.prototype.resize = function(e, t) {
|
|
107
|
+
var n = this.dpr, r = this.dom, i = r.style, a = this.domBack;
|
|
108
|
+
i && (i.width = e + "px", i.height = t + "px"), r.width = e * n, r.height = t * n, a && (a.width = e * n, a.height = t * n, n !== 1 && this.ctxBack.scale(n, n));
|
|
109
|
+
}, c.prototype.clear = function(e, t, a) {
|
|
110
|
+
var o = this.dom, s = this.ctx, c = o.width, l = o.height;
|
|
111
|
+
t ||= this.clearColor;
|
|
112
|
+
var f = this.motionBlur && !e, p = this.lastFrameAlpha, m = this.dpr, h = this;
|
|
113
|
+
f && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(o, 0, 0, c / m, l / m));
|
|
114
|
+
var g = this.domBack;
|
|
115
|
+
function _(e, n, a, o) {
|
|
116
|
+
if (s.clearRect(e, n, a, o), t && t !== "transparent") {
|
|
117
|
+
var c = void 0;
|
|
118
|
+
r(t) ? (c = (t.global || t.__width === a && t.__height === o) && t.__canvasGradient || u(s, t, {
|
|
119
|
+
x: 0,
|
|
120
|
+
y: 0,
|
|
121
|
+
width: a,
|
|
122
|
+
height: o
|
|
123
|
+
}), t.__canvasGradient = c, t.__width = a, t.__height = o) : i(t) && (t.scaleX = t.scaleX || m, t.scaleY = t.scaleY || m, c = d(s, t, { dirty: function() {
|
|
124
|
+
h.setUnpainted(), h.painter.refresh();
|
|
125
|
+
} })), s.save(), s.fillStyle = c || t, s.fillRect(e, n, a, o), s.restore();
|
|
126
|
+
}
|
|
127
|
+
f && (s.save(), s.globalAlpha = p, s.drawImage(g, e, n, a, o), s.restore());
|
|
128
|
+
}
|
|
129
|
+
!a || f ? _(0, 0, c, l) : a.length && n(a, function(e) {
|
|
130
|
+
_(e.x * m, e.y * m, e.width * m, e.height * m);
|
|
131
|
+
});
|
|
132
|
+
}, c;
|
|
133
|
+
}(c);
|
|
134
|
+
//#endregion
|
|
135
|
+
export { h as default, p as isIncrementalLayer };
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { platformApi as e } from "../core/platform.js";
|
|
2
|
+
import { createHashMap as t, disableUserSelect as n, each as r, extend as i, isObject as a, logError as o, merge as s, retrieve2 as c } from "../core/util.js";
|
|
3
|
+
import l from "../core/env.js";
|
|
4
|
+
import { devicePixelRatio as u } from "../config.js";
|
|
5
|
+
import d from "../animation/requestAnimationFrame.js";
|
|
6
|
+
import { getSize as f } from "./helper.js";
|
|
7
|
+
import { brush as p, brushLoopFinalize as m, brushSingle as h } from "./graphic.js";
|
|
8
|
+
import g, { isIncrementalLayer as _ } from "./Layer.js";
|
|
9
|
+
//#region node_modules/zrender/lib/canvas/Painter.js
|
|
10
|
+
var v = 1e5, y = 314159, b = void 0, x = 1, S = 2;
|
|
11
|
+
function C(e) {
|
|
12
|
+
return e ? e.__builtin__ ? !0 : !(typeof e.resize != "function" || typeof e.refresh != "function") : !1;
|
|
13
|
+
}
|
|
14
|
+
function w(e, t) {
|
|
15
|
+
var n = document.createElement("div");
|
|
16
|
+
return n.style.cssText = [
|
|
17
|
+
"position:relative",
|
|
18
|
+
"width:" + e + "px",
|
|
19
|
+
"height:" + t + "px",
|
|
20
|
+
"padding:0",
|
|
21
|
+
"margin:0",
|
|
22
|
+
"border-width:0"
|
|
23
|
+
].join(";") + ";", n;
|
|
24
|
+
}
|
|
25
|
+
function T(e, t, n, r) {
|
|
26
|
+
var i = new g(e, t, t.dpr);
|
|
27
|
+
return i.zlevel = n, i.zlevel2 = r, i.__builtin__ = !0, E(i), i;
|
|
28
|
+
}
|
|
29
|
+
function E(e) {
|
|
30
|
+
e.__cursorStack = [], e.__cursors = t();
|
|
31
|
+
}
|
|
32
|
+
function D(e) {
|
|
33
|
+
return e.startIdx = e.drawIdx = e.endIdx = e.endIdxNew = 0, e.used = !1, e.first = e.last = NaN, e.notClearIdx = -1, e;
|
|
34
|
+
}
|
|
35
|
+
function O(e, t) {
|
|
36
|
+
var n = e.__cursors, r = +t;
|
|
37
|
+
return n.get(r) || (e.__cursorStack.push(r), n.set(r, D({ key: r })));
|
|
38
|
+
}
|
|
39
|
+
function k(e, t) {
|
|
40
|
+
for (var n = e.__cursorStack, r = 0; r < n.length; r++) t(e.__cursors.get(n[r]));
|
|
41
|
+
}
|
|
42
|
+
function A(e, t) {
|
|
43
|
+
var n = e.layers;
|
|
44
|
+
return n[t] || (n[t] = [
|
|
45
|
+
,
|
|
46
|
+
,
|
|
47
|
+
,
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
function j(e, t, n) {
|
|
51
|
+
for (var r = e.layerStack, i = 0; i < r.length; i++) {
|
|
52
|
+
var a = r[i].zl, o = r[i].zl2, s = e.layers[a][o];
|
|
53
|
+
(!n || (!(n & M) || s.__builtin__) && (!(n & N) || !s.__builtin__) && (!(n & P) || s !== e.hoverlayer)) && t(s, a, o, i);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var M = 1, N = 2, P = 4, F = M | P, I = function() {
|
|
57
|
+
function t(e, t, r, a) {
|
|
58
|
+
this.type = "canvas", this._prevDisplayList = [], this._layerConfig = {}, this._needsManuallyCompositing = !1, this.type = "canvas", this._i = {
|
|
59
|
+
layerStack: [],
|
|
60
|
+
layers: []
|
|
61
|
+
};
|
|
62
|
+
var o = !e.nodeName || e.nodeName.toUpperCase() === "CANVAS";
|
|
63
|
+
if (this._opts = r = i({}, r || {}), this.dpr = r.devicePixelRatio || u, this._singleCanvas = o, this.root = e, e.style && (n(e), e.innerHTML = ""), this.storage = t, this._prevDisplayList = [], o) {
|
|
64
|
+
var s = e, c = s.width, l = s.height;
|
|
65
|
+
r.width != null && (c = r.width), r.height != null && (l = r.height), this.dpr = r.devicePixelRatio || 1, s.width = c * this.dpr, s.height = l * this.dpr, this._width = c, this._height = l;
|
|
66
|
+
var d = T(s, this, y, 0);
|
|
67
|
+
d.initContext(), this._insertLayer(d, y, 0, !0), this._domRoot = e;
|
|
68
|
+
} else {
|
|
69
|
+
this._width = f(e, 0, r), this._height = f(e, 1, r);
|
|
70
|
+
var p = this._domRoot = w(this._width, this._height);
|
|
71
|
+
e.appendChild(p);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return t.prototype.getType = function() {
|
|
75
|
+
return "canvas";
|
|
76
|
+
}, t.prototype.isSingleCanvas = function() {
|
|
77
|
+
return this._singleCanvas;
|
|
78
|
+
}, t.prototype.getViewportRoot = function() {
|
|
79
|
+
return this._domRoot;
|
|
80
|
+
}, t.prototype.getViewportRootOffset = function() {
|
|
81
|
+
var e = this.getViewportRoot();
|
|
82
|
+
if (e) return {
|
|
83
|
+
offsetLeft: e.offsetLeft || 0,
|
|
84
|
+
offsetTop: e.offsetTop || 0
|
|
85
|
+
};
|
|
86
|
+
}, t.prototype.refresh = function(e) {
|
|
87
|
+
var t = e && !a(e) ? { paintAll: !!e } : e || {}, n = c(t.refresh, !0), r = c(t.refreshHover, !1);
|
|
88
|
+
if (r && (this._hoverLayerDirty = S), !n) return r && this._paintHoverList(this.storage.getDisplayList(!1)), this;
|
|
89
|
+
var i = this.storage.getDisplayList(!0);
|
|
90
|
+
this._updateLayerStatus(i, t.paintAll), this._redrawId = Math.random();
|
|
91
|
+
var o = this._prevDisplayList;
|
|
92
|
+
this._paintList(i, o, this._redrawId);
|
|
93
|
+
var s = this._backgroundColor;
|
|
94
|
+
return j(this._i, function(e, t, n, r) {
|
|
95
|
+
e.refresh && e.refresh(r === 0 ? s : null);
|
|
96
|
+
}, N), this._opts.useDirtyRect && (this._prevDisplayList = i.slice()), this;
|
|
97
|
+
}, t.prototype._paintHoverList = function(e) {
|
|
98
|
+
var t = this._i.hoverlayer, n = this._hoverLayerDirty;
|
|
99
|
+
if (this._hoverLayerDirty = b, n !== b && (!t && n === S && (t = this._i.hoverlayer = this._ensureLayer(v)), t)) {
|
|
100
|
+
t.clear();
|
|
101
|
+
for (var r = {
|
|
102
|
+
inHover: !0,
|
|
103
|
+
viewWidth: this._width,
|
|
104
|
+
viewHeight: this._height,
|
|
105
|
+
beforeBrushParam: {}
|
|
106
|
+
}, i, a = 0, o = e.length; a < o; a++) {
|
|
107
|
+
var s = e[a];
|
|
108
|
+
if (s.__inHover) {
|
|
109
|
+
i || (i = t.ctx, i.save());
|
|
110
|
+
var c = s.__hoverStyle, l = void 0;
|
|
111
|
+
c && (l = s.style, s.style = c), p(i, s, r), c && (s.style = l);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
i && (m(i, r), i.restore());
|
|
115
|
+
}
|
|
116
|
+
}, t.prototype.getHoverLayer = function() {
|
|
117
|
+
return this._ensureLayer(v);
|
|
118
|
+
}, t.prototype.paintOne = function(e, t) {
|
|
119
|
+
h(e, t);
|
|
120
|
+
}, t.prototype._paintList = function(e, t, n) {
|
|
121
|
+
if (this._redrawId === n) {
|
|
122
|
+
var r = this._doPaintList(e, t);
|
|
123
|
+
if (this._needsManuallyCompositing && this._compositeManually(), r) j(this._i, function(e) {
|
|
124
|
+
e.afterBrush && e.afterBrush();
|
|
125
|
+
}, F), this._paintHoverList(e);
|
|
126
|
+
else {
|
|
127
|
+
var i = this;
|
|
128
|
+
d(function() {
|
|
129
|
+
i._paintList(e, t, n);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, t.prototype._compositeManually = function() {
|
|
134
|
+
var e = this._ensureLayer(y).ctx, t = this._domRoot.width, n = this._domRoot.height;
|
|
135
|
+
e.clearRect(0, 0, t, n), j(this._i, function(r) {
|
|
136
|
+
r.virtual && e.drawImage(r.dom, 0, 0, t, n);
|
|
137
|
+
}, M);
|
|
138
|
+
}, t.prototype._doPaintList = function(e, t) {
|
|
139
|
+
var n = this, r = !0;
|
|
140
|
+
return j(this._i, function(i) {
|
|
141
|
+
var a = !1;
|
|
142
|
+
if (k(i, function(e) {
|
|
143
|
+
(e.drawIdx < e.endIdx || e.notClearIdx >= 0) && (a = !0);
|
|
144
|
+
}), !(!a && !i.__dirty)) {
|
|
145
|
+
var o = n._opts.useDirtyRect && !_(i) ? i.createRepaintRects(e, t, n._width, n._height) : null, s = n._i.layerStack[0], c = !0;
|
|
146
|
+
if (i.__dirty) {
|
|
147
|
+
c = !1, i.__dirty = !1;
|
|
148
|
+
var l = i.zlevel === s.zl && i.zlevel2 === s.zl2 ? n._backgroundColor : null;
|
|
149
|
+
i.clear(!1, l, o);
|
|
150
|
+
}
|
|
151
|
+
k(i, function(t) {
|
|
152
|
+
var a = n._paintPerCursor(i, t, e, o, c);
|
|
153
|
+
r &&= a;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}, F), l.wxa && j(this._i, function(e) {
|
|
157
|
+
e && e.ctx && e.ctx.draw && e.ctx.draw();
|
|
158
|
+
}), r;
|
|
159
|
+
}, t.prototype._paintPerCursor = function(e, t, n, r, i) {
|
|
160
|
+
var a = e.ctx;
|
|
161
|
+
if (r) if (!r.length) t.drawIdx = t.endIdx;
|
|
162
|
+
else for (var o = this.dpr, s = 0; s < r.length; ++s) {
|
|
163
|
+
var c = r[s];
|
|
164
|
+
a.save(), a.beginPath(), a.rect(c.x * o, c.y * o, c.width * o, c.height * o), a.clip(), this._paintPerCursorInRect(e, t, n, c, i), a.restore();
|
|
165
|
+
}
|
|
166
|
+
else a.save(), this._paintPerCursorInRect(e, t, n, null, i), a.restore();
|
|
167
|
+
return t.drawIdx >= t.endIdx;
|
|
168
|
+
}, t.prototype._paintPerCursorInRect = function(t, n, r, i, a) {
|
|
169
|
+
for (var o = {
|
|
170
|
+
inHover: !1,
|
|
171
|
+
allClipped: !1,
|
|
172
|
+
prevEl: null,
|
|
173
|
+
viewWidth: this._width,
|
|
174
|
+
viewHeight: this._height,
|
|
175
|
+
beforeBrushParam: { contentRetained: a }
|
|
176
|
+
}, s = t.ctx, c = _(t), l = c && e.getTime(), u = n.drawIdx, d = n.notClearIdx, f = d >= 0 ? Math.min(d, u) : u; f < n.endIdx; f++) {
|
|
177
|
+
var h = r[f];
|
|
178
|
+
if (!(f < u && !h.notClear)) {
|
|
179
|
+
if (h.__inHover && (this._hoverLayerDirty = S), i != null) {
|
|
180
|
+
var g = h.getPaintRect();
|
|
181
|
+
g && g.intersect(i) && (p(s, h, o), h.setPrevPaintRect(g));
|
|
182
|
+
} else p(s, h, o);
|
|
183
|
+
if (c && e.getTime() - l > 15) {
|
|
184
|
+
f++;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
m(s, o), n.drawIdx = Math.max(f, u);
|
|
190
|
+
}, t.prototype.getLayer = function(e, t) {
|
|
191
|
+
return this._ensureLayer(e, 0, t);
|
|
192
|
+
}, t.prototype._ensureLayer = function(e, t, n) {
|
|
193
|
+
t ||= 0;
|
|
194
|
+
var r = this._singleCanvas;
|
|
195
|
+
r && !this._needsManuallyCompositing && (e = y, t = 0);
|
|
196
|
+
var i = A(this._i, e)[t];
|
|
197
|
+
return i || (i = T("zr_" + e + "." + t, this, e, t), this._layerConfig[e] && s(i, this._layerConfig[e], !0), (n || r && e !== y) && (i.virtual = !0), this._insertLayer(i, e, t, !1), i.initContext()), i;
|
|
198
|
+
}, t.prototype.insertLayer = function(e, t) {
|
|
199
|
+
this._insertLayer(t, e, 0, !1);
|
|
200
|
+
}, t.prototype._insertLayer = function(e, t, n, r) {
|
|
201
|
+
var i = this._i, a = i.layers, s = i.layerStack, c = this._domRoot, l = null;
|
|
202
|
+
if (a[t] && a[t][n]) {
|
|
203
|
+
process.env.NODE_ENV !== "production" && o("ZLevel " + t + "." + n + " has been used already");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (!C(e)) {
|
|
207
|
+
process.env.NODE_ENV !== "production" && o("Layer of zlevel " + t + " is not valid");
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
for (var u = s.length, d = 0; d < u && (s[d].zl < t || s[d].zl === t && s[d].zl2 < n);) d++;
|
|
211
|
+
if (d > 0 && (l = A(i, s[d - 1].zl)[s[d - 1].zl2]), s.splice(d, 0, {
|
|
212
|
+
zl: t,
|
|
213
|
+
zl2: n
|
|
214
|
+
}), A(i, t)[n] = e, !r && !e.virtual) if (l) {
|
|
215
|
+
var f = l.dom;
|
|
216
|
+
f.nextSibling ? c.insertBefore(e.dom, f.nextSibling) : c.appendChild(e.dom);
|
|
217
|
+
} else c.firstChild ? c.insertBefore(e.dom, c.firstChild) : c.appendChild(e.dom);
|
|
218
|
+
e.painter ||= this;
|
|
219
|
+
}, t.prototype.eachLayer = function(e, t) {
|
|
220
|
+
return j(this._i, function(n, r) {
|
|
221
|
+
e.call(t, n, r);
|
|
222
|
+
});
|
|
223
|
+
}, t.prototype.eachBuiltinLayer = function(e, t) {
|
|
224
|
+
return j(this._i, function(n, r) {
|
|
225
|
+
e.call(t, n, r);
|
|
226
|
+
}, M);
|
|
227
|
+
}, t.prototype.eachOtherLayer = function(e, t) {
|
|
228
|
+
return j(this._i, function(n, r) {
|
|
229
|
+
e.call(t, n, r);
|
|
230
|
+
}, N);
|
|
231
|
+
}, t.prototype.getLayers = function() {
|
|
232
|
+
var e = {};
|
|
233
|
+
return j(this._i, function(t, n, r) {
|
|
234
|
+
e[t.id] = t;
|
|
235
|
+
}), e;
|
|
236
|
+
}, t.prototype._updateLayerStatus = function(e, t) {
|
|
237
|
+
var n = this;
|
|
238
|
+
if (n._singleCanvas) for (var r = 1; r < e.length; r++) {
|
|
239
|
+
var i = e[r];
|
|
240
|
+
if (i.zlevel !== e[r - 1].zlevel || i.incremental) {
|
|
241
|
+
n._needsManuallyCompositing = !0;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
j(n._i, function(e) {
|
|
246
|
+
e.__dirty = !1, k(e, function(e) {
|
|
247
|
+
e.used = !1, e.endIdxNew = 0, e.notClearIdx = -1;
|
|
248
|
+
});
|
|
249
|
+
}, F);
|
|
250
|
+
for (var a, s = null, c = null, l = !1, u = 0, d = e.length; u < d; u++) {
|
|
251
|
+
var i = e[u], f = i.zlevel, p = i.incremental, m = void 0;
|
|
252
|
+
if (a !== f && (a = f, l = !1), p ? (l = !0, m = 1) : m = l ? 2 : 0, (!s || f !== s.zlevel || m !== s.zlevel2) && (s = n._ensureLayer(f, m), c = null, !s.__builtin__)) {
|
|
253
|
+
o("ZLevel " + f + " has been used by unknown layer " + s.id);
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if ((!c || p !== c.key) && (c = O(s, p), !c.used)) if (c.used = !0, !t && c.first === i.id) {
|
|
257
|
+
var h = u - c.startIdx;
|
|
258
|
+
c.startIdx = u, c.drawIdx += h, c.endIdx += h;
|
|
259
|
+
} else s.__dirty = !0, c.first = i.id, c.startIdx = c.drawIdx = u, c.endIdx = u + 1;
|
|
260
|
+
c.endIdxNew = u + 1, i.__dirty & 1 && !i.__inHover && ((!p || !i.notClear && u < c.drawIdx) && (s.__dirty = !0), p && i.notClear && c.notClearIdx < 0 && (c.notClearIdx = u));
|
|
261
|
+
}
|
|
262
|
+
j(n._i, function(t) {
|
|
263
|
+
for (var r = t.__cursorStack, i = t.__cursors, a = r.length - 1; a >= 0; a--) {
|
|
264
|
+
var o = i.get(r[a]);
|
|
265
|
+
if (!o.used) t.__dirty = !0, i.removeKey(r[a]), r.splice(a, 1);
|
|
266
|
+
else {
|
|
267
|
+
var s = o.endIdxNew;
|
|
268
|
+
(_(t) ? s < o.drawIdx : s !== o.endIdx || !s || e[s - 1].id !== o.last) && (t.__dirty = !0), o.endIdx = o.endIdxNew, o.last = s ? e[s - 1].id : NaN;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
t.__dirty && (k(t, function(e) {
|
|
272
|
+
e.drawIdx = e.startIdx;
|
|
273
|
+
}), n._hoverLayerDirty === b && (n._hoverLayerDirty = x));
|
|
274
|
+
}, F);
|
|
275
|
+
}, t.prototype.clear = function() {
|
|
276
|
+
return j(this._i, function(e) {
|
|
277
|
+
e.clear(), E(e);
|
|
278
|
+
}, M), this;
|
|
279
|
+
}, t.prototype.setBackgroundColor = function(e) {
|
|
280
|
+
this._backgroundColor = e, j(this._i, function(e) {
|
|
281
|
+
e.setUnpainted();
|
|
282
|
+
});
|
|
283
|
+
}, t.prototype.configLayer = function(e, t) {
|
|
284
|
+
if (t) {
|
|
285
|
+
var n = this._layerConfig;
|
|
286
|
+
n[e] ? s(n[e], t, !0) : n[e] = t, j(this._i, function(e, t) {
|
|
287
|
+
s(e, n[t], !0);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}, t.prototype.delLayer = function(e) {
|
|
291
|
+
for (var t = this._i.layerStack, n = this._i.layers, r = t.length - 1; r >= 0; r--) {
|
|
292
|
+
var i = t[r];
|
|
293
|
+
if (i.zl === e) {
|
|
294
|
+
var a = n[e][i.zl2];
|
|
295
|
+
if (a.__builtin__) continue;
|
|
296
|
+
if (t.splice(r, 1), n[e][i.zl2] = void 0, !a.virtual) {
|
|
297
|
+
var o = a.dom.parentNode;
|
|
298
|
+
o && o.removeChild(a.dom);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}, t.prototype.resize = function(e, t) {
|
|
303
|
+
if (this._domRoot.style) {
|
|
304
|
+
var n = this._domRoot;
|
|
305
|
+
n.style.display = "none";
|
|
306
|
+
var r = this._opts, i = this.root;
|
|
307
|
+
e != null && (r.width = e), t != null && (r.height = t), e = f(i, 0, r), t = f(i, 1, r), n.style.display = "", (this._width !== e || t !== this._height) && (n.style.width = e + "px", n.style.height = t + "px", j(this._i, function(n) {
|
|
308
|
+
n.resize(e, t);
|
|
309
|
+
}), this.refresh({ paintAll: !0 })), this._width = e, this._height = t;
|
|
310
|
+
} else {
|
|
311
|
+
if (e == null || t == null) return;
|
|
312
|
+
this._width = e, this._height = t, this._ensureLayer(y).resize(e, t);
|
|
313
|
+
}
|
|
314
|
+
return this;
|
|
315
|
+
}, t.prototype.clearLayer = function(e) {
|
|
316
|
+
r(this._i.layers[e], function(e) {
|
|
317
|
+
e && !e.__builtin__ && e.clear();
|
|
318
|
+
});
|
|
319
|
+
}, t.prototype.dispose = function() {
|
|
320
|
+
this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._i = null;
|
|
321
|
+
}, t.prototype.getRenderedCanvas = function(e) {
|
|
322
|
+
if (e ||= {}, this._singleCanvas && !this._compositeManually) return this._i.layers[y][0].dom;
|
|
323
|
+
var t = new g("image", this, e.pixelRatio || this.dpr);
|
|
324
|
+
t.initContext(), t.clear(!1, e.backgroundColor || this._backgroundColor);
|
|
325
|
+
var n = t.ctx;
|
|
326
|
+
if (e.pixelRatio <= this.dpr) {
|
|
327
|
+
this.refresh();
|
|
328
|
+
var r = t.dom.width, i = t.dom.height;
|
|
329
|
+
j(this._i, function(e) {
|
|
330
|
+
e.__builtin__ ? n.drawImage(e.dom, 0, 0, r, i) : e.renderToCanvas && (n.save(), e.renderToCanvas(n), n.restore());
|
|
331
|
+
});
|
|
332
|
+
} else {
|
|
333
|
+
for (var a = {
|
|
334
|
+
inHover: !1,
|
|
335
|
+
viewWidth: this._width,
|
|
336
|
+
viewHeight: this._height,
|
|
337
|
+
beforeBrushParam: {}
|
|
338
|
+
}, o = this.storage.getDisplayList(!0), s = 0, c = o.length; s < c; s++) {
|
|
339
|
+
var l = o[s];
|
|
340
|
+
p(n, l, a);
|
|
341
|
+
}
|
|
342
|
+
m(n, a);
|
|
343
|
+
}
|
|
344
|
+
return t.dom;
|
|
345
|
+
}, t.prototype.getWidth = function() {
|
|
346
|
+
return this._width;
|
|
347
|
+
}, t.prototype.getHeight = function() {
|
|
348
|
+
return this._height;
|
|
349
|
+
}, t;
|
|
350
|
+
}();
|
|
351
|
+
//#endregion
|
|
352
|
+
export { I as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isArray as e, isNumber as t, map as n } from "../core/util.js";
|
|
2
|
+
//#region node_modules/zrender/lib/canvas/dashStyle.js
|
|
3
|
+
function r(n, r) {
|
|
4
|
+
return !n || n === "solid" || !(r > 0) ? null : n === "dashed" ? [4 * r, 2 * r] : n === "dotted" ? [r] : t(n) ? [n] : e(n) ? n : null;
|
|
5
|
+
}
|
|
6
|
+
function i(e) {
|
|
7
|
+
var t = e.style, i = t.lineDash && t.lineWidth > 0 && r(t.lineDash, t.lineWidth), a = t.lineDashOffset;
|
|
8
|
+
if (i) {
|
|
9
|
+
var o = t.strokeNoScale && e.getLineScale ? e.getLineScale() : 1;
|
|
10
|
+
o && o !== 1 && (i = n(i, function(e) {
|
|
11
|
+
return e / o;
|
|
12
|
+
}), a /= o);
|
|
13
|
+
}
|
|
14
|
+
return [i, a];
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as getLineDash };
|