1 |
- {"version":3,"sources":["webpack:///./node_modules/axios/lib/core/Axios.js","webpack:///./node_modules/axios/lib/helpers/spread.js","webpack:///./node_modules/axios/lib/helpers/bind.js","webpack:///./node_modules/axios/lib/defaults.js","webpack:///./node_modules/axios/lib/core/createError.js","webpack:///./node_modules/axios/lib/cancel/isCancel.js","webpack:///./node_modules/axios/lib/helpers/buildURL.js","webpack:///./node_modules/echarts/node_modules/tslib/tslib.es6.js","webpack:///./node_modules/zrender/lib/core/env.js","webpack:///./node_modules/zrender/lib/core/util.js","webpack:///./node_modules/zrender/node_modules/tslib/tslib.es6.js","webpack:///./node_modules/zrender/lib/core/vector.js","webpack:///./node_modules/zrender/lib/mixin/Draggable.js","webpack:///./node_modules/zrender/lib/core/Eventful.js","webpack:///./node_modules/zrender/lib/core/fourPointsTransform.js","webpack:///./node_modules/zrender/lib/core/dom.js","webpack:///./node_modules/zrender/lib/core/event.js","webpack:///./node_modules/zrender/lib/core/GestureMgr.js","webpack:///./node_modules/zrender/lib/Handler.js","webpack:///./node_modules/zrender/lib/core/matrix.js","webpack:///./node_modules/zrender/lib/core/Transformable.js","webpack:///./node_modules/zrender/lib/animation/easing.js","webpack:///./node_modules/zrender/lib/animation/Clip.js","webpack:///./node_modules/zrender/lib/core/LRU.js","webpack:///./node_modules/zrender/lib/tool/color.js","webpack:///./node_modules/zrender/lib/animation/Animator.js","webpack:///./node_modules/zrender/lib/contain/text.js","webpack:///./node_modules/zrender/lib/core/Point.js","webpack:///./node_modules/zrender/lib/core/BoundingRect.js","webpack:///./node_modules/zrender/lib/config.js","webpack:///./node_modules/zrender/lib/Element.js","webpack:///./node_modules/zrender/lib/core/timsort.js","webpack:///./node_modules/zrender/lib/Storage.js","webpack:///./node_modules/zrender/lib/animation/requestAnimationFrame.js","webpack:///./node_modules/zrender/lib/animation/Animation.js","webpack:///./node_modules/zrender/lib/dom/HandlerProxy.js","webpack:///./node_modules/zrender/lib/graphic/Group.js","webpack:///./node_modules/zrender/lib/zrender.js","webpack:///./node_modules/echarts/lib/util/number.js","webpack:///./node_modules/echarts/lib/util/model.js","webpack:///./node_modules/echarts/lib/util/clazz.js","webpack:///./node_modules/echarts/lib/model/mixin/makeStyleMapper.js","webpack:///./node_modules/echarts/lib/model/mixin/areaStyle.js","webpack:///./node_modules/zrender/lib/graphic/helper/image.js","webpack:///./node_modules/zrender/lib/graphic/helper/parseText.js","webpack:///./node_modules/zrender/lib/graphic/Displayable.js","webpack:///./node_modules/zrender/lib/core/curve.js","webpack:///./node_modules/zrender/lib/core/bbox.js","webpack:///./node_modules/zrender/lib/core/PathProxy.js","webpack:///./node_modules/zrender/lib/contain/line.js","webpack:///./node_modules/zrender/lib/contain/cubic.js","webpack:///./node_modules/zrender/lib/contain/quadratic.js","webpack:///./node_modules/zrender/lib/contain/util.js","webpack:///./node_modules/zrender/lib/contain/arc.js","webpack:///./node_modules/zrender/lib/contain/windingLine.js","webpack:///./node_modules/zrender/lib/contain/path.js","webpack:///./node_modules/zrender/lib/graphic/Path.js","webpack:///./node_modules/zrender/lib/graphic/TSpan.js","webpack:///./node_modules/zrender/lib/graphic/Image.js","webpack:///./node_modules/zrender/lib/graphic/helper/roundRect.js","webpack:///./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","webpack:///./node_modules/zrender/lib/graphic/shape/Rect.js","webpack:///./node_modules/zrender/lib/graphic/Text.js","webpack:///./node_modules/echarts/lib/util/innerStore.js","webpack:///./node_modules/echarts/lib/util/states.js","webpack:///./node_modules/zrender/lib/tool/transformPath.js","webpack:///./node_modules/zrender/lib/tool/path.js","webpack:///./node_modules/zrender/lib/graphic/shape/Circle.js","webpack:///./node_modules/zrender/lib/graphic/shape/Ellipse.js","webpack:///./node_modules/zrender/lib/graphic/helper/roundSector.js","webpack:///./node_modules/zrender/lib/graphic/shape/Sector.js","webpack:///./node_modules/zrender/lib/graphic/shape/Ring.js","webpack:///./node_modules/zrender/lib/graphic/helper/smoothSpline.js","webpack:///./node_modules/zrender/lib/graphic/helper/smoothBezier.js","webpack:///./node_modules/zrender/lib/graphic/helper/poly.js","webpack:///./node_modules/zrender/lib/graphic/shape/Polygon.js","webpack:///./node_modules/zrender/lib/graphic/shape/Polyline.js","webpack:///./node_modules/zrender/lib/graphic/shape/Line.js","webpack:///./node_modules/zrender/lib/graphic/shape/BezierCurve.js","webpack:///./node_modules/zrender/lib/graphic/shape/Arc.js","webpack:///./node_modules/zrender/lib/graphic/CompoundPath.js","webpack:///./node_modules/zrender/lib/graphic/Gradient.js","webpack:///./node_modules/zrender/lib/graphic/LinearGradient.js","webpack:///./node_modules/zrender/lib/graphic/RadialGradient.js","webpack:///./node_modules/zrender/lib/core/OrientedBoundingRect.js","webpack:///./node_modules/zrender/lib/graphic/IncrementalDisplayable.js","webpack:///./node_modules/echarts/lib/util/graphic.js","webpack:///./node_modules/echarts/lib/label/labelStyle.js","webpack:///./node_modules/echarts/lib/model/mixin/textStyle.js","webpack:///./node_modules/echarts/lib/model/mixin/lineStyle.js","webpack:///./node_modules/echarts/lib/model/mixin/itemStyle.js","webpack:///./node_modules/echarts/lib/model/Model.js","webpack:///./node_modules/echarts/lib/util/component.js","webpack:///./node_modules/echarts/lib/i18n/langEN.js","webpack:///./node_modules/echarts/lib/i18n/langZH.js","webpack:///./node_modules/echarts/lib/core/locale.js","webpack:///./node_modules/echarts/lib/util/time.js","webpack:///./node_modules/echarts/lib/util/format.js","webpack:///./node_modules/echarts/lib/util/layout.js","webpack:///./node_modules/echarts/lib/model/Component.js","webpack:///./node_modules/echarts/lib/model/globalDefault.js","webpack:///./node_modules/echarts/lib/util/types.js","webpack:///./node_modules/echarts/lib/data/helper/sourceHelper.js","webpack:///./node_modules/echarts/lib/model/internalComponentCreator.js","webpack:///./node_modules/echarts/lib/model/mixin/palette.js","webpack:///./node_modules/echarts/lib/model/Global.js","webpack:///./node_modules/echarts/lib/core/ExtensionAPI.js","webpack:///./node_modules/echarts/lib/core/CoordinateSystem.js","webpack:///./node_modules/echarts/lib/model/OptionManager.js","webpack:///./node_modules/echarts/lib/preprocessor/helper/compatStyle.js","webpack:///./node_modules/echarts/lib/preprocessor/backwardCompat.js","webpack:///./node_modules/echarts/lib/processor/dataStack.js","webpack:///./node_modules/echarts/lib/data/Source.js","webpack:///./node_modules/echarts/lib/data/helper/dataProvider.js","webpack:///./node_modules/echarts/lib/model/mixin/dataFormat.js","webpack:///./node_modules/echarts/lib/core/task.js","webpack:///./node_modules/echarts/lib/util/log.js","webpack:///./node_modules/echarts/lib/data/helper/dataValueHelper.js","webpack:///./node_modules/echarts/lib/data/helper/transform.js","webpack:///./node_modules/echarts/lib/data/helper/sourceManager.js","webpack:///./node_modules/echarts/lib/component/tooltip/tooltipMarkup.js","webpack:///./node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js","webpack:///./node_modules/echarts/lib/model/Series.js","webpack:///./node_modules/echarts/lib/view/Component.js","webpack:///./node_modules/echarts/lib/chart/helper/createRenderPlanner.js","webpack:///./node_modules/echarts/lib/view/Chart.js","webpack:///./node_modules/echarts/lib/util/throttle.js","webpack:///./node_modules/echarts/lib/visual/style.js","webpack:///./node_modules/echarts/lib/loading/default.js","webpack:///./node_modules/echarts/lib/core/Scheduler.js","webpack:///./node_modules/echarts/lib/theme/light.js","webpack:///./node_modules/echarts/lib/theme/dark.js","webpack:///./node_modules/echarts/lib/util/ECEventProcessor.js","webpack:///./node_modules/echarts/lib/visual/symbol.js","webpack:///./node_modules/echarts/lib/visual/helper.js","webpack:///./node_modules/echarts/lib/label/labelGuideHelper.js","webpack:///./node_modules/echarts/lib/label/labelLayoutHelper.js","webpack:///./node_modules/echarts/lib/label/LabelManager.js","webpack:///./node_modules/echarts/lib/legacy/dataSelectAction.js","webpack:///./node_modules/echarts/lib/util/event.js","webpack:///./node_modules/zrender/lib/core/WeakMap.js","webpack:///./node_modules/echarts/lib/util/symbol.js","webpack:///./node_modules/zrender/lib/canvas/helper.js","webpack:///./node_modules/zrender/lib/graphic/helper/dashStyle.js","webpack:///./node_modules/zrender/lib/canvas/graphic.js","webpack:///./node_modules/echarts/lib/util/decal.js","webpack:///./node_modules/zrender/lib/tool/parseSVG.js","webpack:///./node_modules/echarts/lib/visual/decal.js","webpack:///./node_modules/zrender/lib/tool/parseXML.js","webpack:///./node_modules/zrender/lib/contain/polygon.js","webpack:///./node_modules/echarts/lib/coord/geo/Region.js","webpack:///./node_modules/echarts/lib/coord/geo/GeoSVGResource.js","webpack:///./node_modules/echarts/lib/coord/geo/parseGeoJson.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/nanhai.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/textCoord.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/geoCoord.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js","webpack:///./node_modules/echarts/lib/coord/geo/GeoJSONResource.js","webpack:///./node_modules/echarts/lib/coord/geo/geoSourceManager.js","webpack:///./node_modules/echarts/lib/core/echarts.js","webpack:///./node_modules/echarts/lib/extension.js","webpack:///./node_modules/zrender/lib/canvas/Layer.js","webpack:///./node_modules/zrender/lib/canvas/Painter.js","webpack:///./node_modules/echarts/lib/renderer/installCanvasRenderer.js","webpack:///./node_modules/zrender/lib/svg/core.js","webpack:///./node_modules/zrender/lib/core/arrayDiff.js","webpack:///./node_modules/zrender/lib/svg/graphic.js","webpack:///./node_modules/zrender/lib/svg/helper/Definable.js","webpack:///./node_modules/zrender/lib/svg/helper/GradientManager.js","webpack:///./node_modules/zrender/lib/svg/helper/PatternManager.js","webpack:///./node_modules/zrender/lib/svg/helper/ClippathManager.js","webpack:///./node_modules/zrender/lib/svg/helper/ShadowManager.js","webpack:///./node_modules/zrender/lib/svg/Painter.js","webpack:///./node_modules/echarts/lib/renderer/installSVGRenderer.js","webpack:///./node_modules/echarts/lib/data/DataDiffer.js","webpack:///./node_modules/echarts/lib/data/helper/dimensionHelper.js","webpack:///./node_modules/echarts/lib/data/DataDimensionInfo.js","webpack:///./node_modules/echarts/lib/data/List.js","webpack:///./node_modules/echarts/lib/data/helper/completeDimensions.js","webpack:///./node_modules/echarts/lib/data/helper/createDimensions.js","webpack:///./node_modules/echarts/lib/model/referHelper.js","webpack:///./node_modules/echarts/lib/data/helper/dataStackHelper.js","webpack:///./node_modules/echarts/lib/chart/helper/createListFromArray.js","webpack:///./node_modules/echarts/lib/chart/line/LineSeries.js","webpack:///./node_modules/echarts/lib/chart/helper/labelHelper.js","webpack:///./node_modules/echarts/lib/chart/helper/Symbol.js","webpack:///./node_modules/echarts/lib/chart/helper/SymbolDraw.js","webpack:///./node_modules/echarts/lib/chart/line/helper.js","webpack:///./node_modules/echarts/lib/util/vendor.js","webpack:///./node_modules/echarts/lib/chart/line/lineAnimationDiff.js","webpack:///./node_modules/echarts/lib/chart/line/poly.js","webpack:///./node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js","webpack:///./node_modules/echarts/lib/coord/CoordinateSystem.js","webpack:///./node_modules/echarts/lib/chart/line/LineView.js","webpack:///./node_modules/echarts/lib/layout/points.js","webpack:///./node_modules/echarts/lib/processor/dataSample.js","webpack:///./node_modules/echarts/lib/chart/line/install.js","webpack:///./node_modules/echarts/lib/layout/barGrid.js","webpack:///./node_modules/echarts/lib/chart/bar/BaseBarSeries.js","webpack:///./node_modules/echarts/lib/chart/bar/BarSeries.js","webpack:///./node_modules/echarts/lib/util/shape/sausage.js","webpack:///./node_modules/echarts/lib/chart/bar/BarView.js","webpack:///./node_modules/echarts/lib/chart/bar/install.js","webpack:///./node_modules/echarts/lib/chart/pie/pieLayout.js","webpack:///./node_modules/echarts/lib/processor/dataFilter.js","webpack:///./node_modules/echarts/lib/chart/pie/labelLayout.js","webpack:///./node_modules/echarts/lib/chart/helper/pieHelper.js","webpack:///./node_modules/echarts/lib/chart/pie/PieView.js","webpack:///./node_modules/echarts/lib/chart/helper/createListSimply.js","webpack:///./node_modules/echarts/lib/visual/LegendVisualProvider.js","webpack:///./node_modules/echarts/lib/chart/pie/PieSeries.js","webpack:///./node_modules/echarts/lib/chart/pie/install.js","webpack:///./node_modules/echarts/lib/chart/scatter/ScatterSeries.js","webpack:///./node_modules/echarts/lib/chart/helper/LargeSymbolDraw.js","webpack:///./node_modules/echarts/lib/chart/scatter/ScatterView.js","webpack:///./node_modules/echarts/lib/coord/cartesian/GridModel.js","webpack:///./node_modules/echarts/lib/coord/axisModelCommonMixin.js","webpack:///./node_modules/echarts/lib/coord/cartesian/AxisModel.js","webpack:///./node_modules/echarts/lib/coord/axisDefault.js","webpack:///./node_modules/echarts/lib/data/OrdinalMeta.js","webpack:///./node_modules/echarts/lib/coord/axisCommonTypes.js","webpack:///./node_modules/echarts/lib/coord/axisModelCreator.js","webpack:///./node_modules/echarts/lib/scale/Scale.js","webpack:///./node_modules/echarts/lib/scale/helper.js","webpack:///./node_modules/echarts/lib/scale/Ordinal.js","webpack:///./node_modules/echarts/lib/scale/Interval.js","webpack:///./node_modules/echarts/lib/scale/Time.js","webpack:///./node_modules/echarts/lib/scale/Log.js","webpack:///./node_modules/echarts/lib/coord/scaleRawExtentInfo.js","webpack:///./node_modules/echarts/lib/coord/axisHelper.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Cartesian.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Cartesian2D.js","webpack:///./node_modules/echarts/lib/coord/axisTickLabelBuilder.js","webpack:///./node_modules/echarts/lib/coord/Axis.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Axis2D.js","webpack:///./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Grid.js","webpack:///./node_modules/echarts/lib/component/axis/AxisBuilder.js","webpack:///./node_modules/echarts/lib/component/axisPointer/modelHelper.js","webpack:///./node_modules/echarts/lib/component/axis/AxisView.js","webpack:///./node_modules/echarts/lib/component/axis/axisSplitHelper.js","webpack:///./node_modules/echarts/lib/component/axis/CartesianAxisView.js","webpack:///./node_modules/echarts/lib/component/grid/installSimple.js","webpack:///./node_modules/echarts/lib/chart/scatter/install.js","webpack:///./node_modules/echarts/lib/chart/radar/radarLayout.js","webpack:///./node_modules/echarts/lib/chart/radar/backwardCompat.js","webpack:///./node_modules/echarts/lib/chart/radar/RadarView.js","webpack:///./node_modules/echarts/lib/chart/radar/RadarSeries.js","webpack:///./node_modules/echarts/lib/coord/radar/RadarModel.js","webpack:///./node_modules/echarts/lib/component/radar/RadarView.js","webpack:///./node_modules/echarts/lib/coord/radar/IndicatorAxis.js","webpack:///./node_modules/echarts/lib/coord/radar/Radar.js","webpack:///./node_modules/echarts/lib/component/radar/install.js","webpack:///./node_modules/echarts/lib/chart/radar/install.js","webpack:///./node_modules/echarts/lib/component/helper/interactionMutex.js","webpack:///./node_modules/echarts/lib/component/helper/RoamController.js","webpack:///./node_modules/echarts/lib/component/helper/roamHelper.js","webpack:///./node_modules/echarts/lib/component/helper/cursorHelper.js","webpack:///./node_modules/echarts/lib/component/helper/MapDraw.js","webpack:///./node_modules/echarts/lib/chart/map/MapView.js","webpack:///./node_modules/echarts/lib/chart/map/MapSeries.js","webpack:///./node_modules/echarts/lib/chart/map/mapDataStatistic.js","webpack:///./node_modules/echarts/lib/chart/map/mapSymbolLayout.js","webpack:///./node_modules/echarts/lib/coord/View.js","webpack:///./node_modules/echarts/lib/coord/geo/Geo.js","webpack:///./node_modules/echarts/lib/coord/geo/geoCreator.js","webpack:///./node_modules/echarts/lib/coord/geo/GeoModel.js","webpack:///./node_modules/echarts/lib/action/roamHelper.js","webpack:///./node_modules/echarts/lib/component/geo/GeoView.js","webpack:///./node_modules/echarts/lib/component/geo/install.js","webpack:///./node_modules/echarts/lib/chart/map/install.js","webpack:///./node_modules/echarts/lib/chart/tree/layoutHelper.js","webpack:///./node_modules/echarts/lib/chart/tree/TreeView.js","webpack:///./node_modules/echarts/lib/data/helper/linkList.js","webpack:///./node_modules/echarts/lib/data/Tree.js","webpack:///./node_modules/echarts/lib/chart/tree/TreeSeries.js","webpack:///./node_modules/echarts/lib/chart/tree/traversalHelper.js","webpack:///./node_modules/echarts/lib/chart/tree/treeLayout.js","webpack:///./node_modules/echarts/lib/chart/tree/treeVisual.js","webpack:///./node_modules/echarts/lib/chart/tree/treeAction.js","webpack:///./node_modules/echarts/lib/chart/tree/install.js","webpack:///./node_modules/echarts/lib/chart/helper/treeHelper.js","webpack:///./node_modules/echarts/lib/chart/treemap/treemapAction.js","webpack:///./node_modules/echarts/lib/chart/helper/enableAriaDecalForTree.js","webpack:///./node_modules/echarts/lib/chart/treemap/TreemapSeries.js","webpack:///./node_modules/echarts/lib/chart/treemap/Breadcrumb.js","webpack:///./node_modules/echarts/lib/util/animation.js","webpack:///./node_modules/echarts/lib/chart/treemap/TreemapView.js","webpack:///./node_modules/echarts/lib/visual/VisualMapping.js","webpack:///./node_modules/echarts/lib/chart/treemap/treemapVisual.js","webpack:///./node_modules/echarts/lib/chart/treemap/treemapLayout.js","webpack:///./node_modules/echarts/lib/chart/treemap/install.js","webpack:///./node_modules/echarts/lib/chart/graph/categoryFilter.js","webpack:///./node_modules/echarts/lib/chart/graph/categoryVisual.js","webpack:///./node_modules/echarts/lib/chart/graph/edgeVisual.js","webpack:///./node_modules/echarts/lib/chart/helper/multipleGraphEdgeHelper.js","webpack:///./node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js","webpack:///./node_modules/echarts/lib/chart/graph/simpleLayout.js","webpack:///./node_modules/echarts/lib/chart/graph/graphHelper.js","webpack:///./node_modules/echarts/lib/chart/graph/circularLayoutHelper.js","webpack:///./node_modules/echarts/lib/chart/graph/circularLayout.js","webpack:///./node_modules/echarts/lib/chart/graph/forceHelper.js","webpack:///./node_modules/echarts/lib/chart/graph/forceLayout.js","webpack:///./node_modules/echarts/lib/chart/graph/createView.js","webpack:///./node_modules/echarts/lib/chart/helper/LinePath.js","webpack:///./node_modules/echarts/lib/chart/helper/Line.js","webpack:///./node_modules/echarts/lib/chart/helper/LineDraw.js","webpack:///./node_modules/echarts/lib/chart/graph/adjustEdge.js","webpack:///./node_modules/echarts/lib/chart/graph/GraphView.js","webpack:///./node_modules/echarts/lib/data/Graph.js","webpack:///./node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js","webpack:///./node_modules/echarts/lib/chart/graph/GraphSeries.js","webpack:///./node_modules/echarts/lib/chart/graph/install.js","webpack:///./node_modules/echarts/lib/chart/gauge/PointerPath.js","webpack:///./node_modules/echarts/lib/chart/gauge/GaugeView.js","webpack:///./node_modules/echarts/lib/chart/gauge/GaugeSeries.js","webpack:///./node_modules/echarts/lib/chart/gauge/install.js","webpack:///./node_modules/echarts/lib/chart/funnel/FunnelView.js","webpack:///./node_modules/echarts/lib/chart/funnel/FunnelSeries.js","webpack:///./node_modules/echarts/lib/chart/funnel/funnelLayout.js","webpack:///./node_modules/echarts/lib/chart/funnel/install.js","webpack:///./node_modules/echarts/lib/chart/parallel/ParallelView.js","webpack:///./node_modules/echarts/lib/chart/parallel/ParallelSeries.js","webpack:///./node_modules/echarts/lib/chart/parallel/parallelVisual.js","webpack:///./node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js","webpack:///./node_modules/echarts/lib/component/parallel/ParallelView.js","webpack:///./node_modules/echarts/lib/coord/parallel/ParallelModel.js","webpack:///./node_modules/echarts/lib/coord/parallel/ParallelAxis.js","webpack:///./node_modules/echarts/lib/component/helper/sliderMove.js","webpack:///./node_modules/echarts/lib/coord/parallel/Parallel.js","webpack:///./node_modules/echarts/lib/coord/parallel/parallelCreator.js","webpack:///./node_modules/echarts/lib/coord/parallel/AxisModel.js","webpack:///./node_modules/echarts/lib/component/helper/BrushController.js","webpack:///./node_modules/echarts/lib/component/helper/brushHelper.js","webpack:///./node_modules/echarts/lib/component/axis/ParallelAxisView.js","webpack:///./node_modules/echarts/lib/component/axis/parallelAxisAction.js","webpack:///./node_modules/echarts/lib/component/parallel/install.js","webpack:///./node_modules/echarts/lib/chart/parallel/install.js","webpack:///./node_modules/echarts/lib/chart/sankey/SankeyView.js","webpack:///./node_modules/echarts/lib/chart/sankey/SankeySeries.js","webpack:///./node_modules/echarts/lib/chart/sankey/sankeyLayout.js","webpack:///./node_modules/echarts/lib/chart/sankey/sankeyVisual.js","webpack:///./node_modules/echarts/lib/chart/sankey/install.js","webpack:///./node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js","webpack:///./node_modules/echarts/lib/chart/boxplot/BoxplotSeries.js","webpack:///./node_modules/echarts/lib/chart/boxplot/BoxplotView.js","webpack:///./node_modules/echarts/lib/chart/boxplot/boxplotVisual.js","webpack:///./node_modules/echarts/lib/chart/boxplot/boxplotLayout.js","webpack:///./node_modules/echarts/lib/chart/boxplot/prepareBoxplotData.js","webpack:///./node_modules/echarts/lib/chart/boxplot/boxplotTransform.js","webpack:///./node_modules/echarts/lib/chart/boxplot/install.js","webpack:///./node_modules/echarts/lib/chart/candlestick/CandlestickView.js","webpack:///./node_modules/echarts/lib/chart/candlestick/CandlestickSeries.js","webpack:///./node_modules/echarts/lib/chart/candlestick/preprocessor.js","webpack:///./node_modules/echarts/lib/chart/candlestick/candlestickVisual.js","webpack:///./node_modules/echarts/lib/chart/candlestick/candlestickLayout.js","webpack:///./node_modules/echarts/lib/chart/candlestick/install.js","webpack:///./node_modules/echarts/lib/chart/helper/EffectSymbol.js","webpack:///./node_modules/echarts/lib/chart/effectScatter/EffectScatterView.js","webpack:///./node_modules/echarts/lib/chart/effectScatter/EffectScatterSeries.js","webpack:///./node_modules/echarts/lib/chart/effectScatter/install.js","webpack:///./node_modules/echarts/lib/chart/helper/EffectLine.js","webpack:///./node_modules/echarts/lib/chart/helper/Polyline.js","webpack:///./node_modules/echarts/lib/chart/helper/EffectPolyline.js","webpack:///./node_modules/echarts/lib/chart/helper/LargeLineDraw.js","webpack:///./node_modules/echarts/lib/chart/lines/linesLayout.js","webpack:///./node_modules/echarts/lib/chart/lines/LinesView.js","webpack:///./node_modules/echarts/lib/chart/lines/LinesSeries.js","webpack:///./node_modules/echarts/lib/chart/lines/linesVisual.js","webpack:///./node_modules/echarts/lib/chart/lines/install.js","webpack:///./node_modules/echarts/lib/chart/heatmap/HeatmapLayer.js","webpack:///./node_modules/echarts/lib/chart/heatmap/HeatmapView.js","webpack:///./node_modules/echarts/lib/chart/heatmap/HeatmapSeries.js","webpack:///./node_modules/echarts/lib/chart/heatmap/install.js","webpack:///./node_modules/echarts/lib/chart/bar/PictorialBarView.js","webpack:///./node_modules/echarts/lib/chart/bar/PictorialBarSeries.js","webpack:///./node_modules/echarts/lib/chart/bar/installPictorialBar.js","webpack:///./node_modules/echarts/lib/chart/themeRiver/ThemeRiverView.js","webpack:///./node_modules/echarts/lib/chart/themeRiver/ThemeRiverSeries.js","webpack:///./node_modules/echarts/lib/chart/themeRiver/themeRiverLayout.js","webpack:///./node_modules/echarts/lib/chart/themeRiver/install.js","webpack:///./node_modules/echarts/lib/chart/sunburst/SunburstPiece.js","webpack:///./node_modules/echarts/lib/chart/sunburst/sunburstAction.js","webpack:///./node_modules/echarts/lib/chart/sunburst/SunburstView.js","webpack:///./node_modules/echarts/lib/chart/sunburst/SunburstSeries.js","webpack:///./node_modules/echarts/lib/chart/sunburst/sunburstLayout.js","webpack:///./node_modules/echarts/lib/chart/sunburst/sunburstVisual.js","webpack:///./node_modules/echarts/lib/chart/sunburst/install.js","webpack:///./node_modules/echarts/lib/coord/cartesian/prepareCustom.js","webpack:///./node_modules/echarts/lib/coord/geo/prepareCustom.js","webpack:///./node_modules/echarts/lib/coord/single/prepareCustom.js","webpack:///./node_modules/echarts/lib/coord/polar/prepareCustom.js","webpack:///./node_modules/echarts/lib/coord/calendar/prepareCustom.js","webpack:///./node_modules/echarts/lib/util/styleCompat.js","webpack:///./node_modules/zrender/lib/tool/morphPath.js","webpack:///./node_modules/echarts/lib/chart/custom/install.js","webpack:///./node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js","webpack:///./node_modules/echarts/lib/component/axisPointer/viewHelper.js","webpack:///./node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js","webpack:///./node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js","webpack:///./node_modules/echarts/lib/component/axisPointer/globalListener.js","webpack:///./node_modules/echarts/lib/component/axisPointer/AxisPointerView.js","webpack:///./node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js","webpack:///./node_modules/echarts/lib/component/axisPointer/axisTrigger.js","webpack:///./node_modules/echarts/lib/component/axisPointer/install.js","webpack:///./node_modules/echarts/lib/component/grid/install.js","webpack:///./node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js","webpack:///./node_modules/echarts/lib/coord/polar/PolarModel.js","webpack:///./node_modules/echarts/lib/coord/polar/AxisModel.js","webpack:///./node_modules/echarts/lib/coord/polar/RadiusAxis.js","webpack:///./node_modules/echarts/lib/coord/polar/AngleAxis.js","webpack:///./node_modules/echarts/lib/coord/polar/Polar.js","webpack:///./node_modules/echarts/lib/coord/polar/polarCreator.js","webpack:///./node_modules/echarts/lib/component/axis/AngleAxisView.js","webpack:///./node_modules/echarts/lib/component/axis/RadiusAxisView.js","webpack:///./node_modules/echarts/lib/layout/barPolar.js","webpack:///./node_modules/echarts/lib/component/polar/install.js","webpack:///./node_modules/echarts/lib/coord/single/singleAxisHelper.js","webpack:///./node_modules/echarts/lib/component/axis/SingleAxisView.js","webpack:///./node_modules/echarts/lib/coord/single/AxisModel.js","webpack:///./node_modules/echarts/lib/coord/single/SingleAxis.js","webpack:///./node_modules/echarts/lib/coord/single/Single.js","webpack:///./node_modules/echarts/lib/coord/single/singleCreator.js","webpack:///./node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js","webpack:///./node_modules/echarts/lib/component/singleAxis/install.js","webpack:///./node_modules/echarts/lib/coord/calendar/CalendarModel.js","webpack:///./node_modules/echarts/lib/component/calendar/CalendarView.js","webpack:///./node_modules/echarts/lib/coord/calendar/Calendar.js","webpack:///./node_modules/echarts/lib/component/calendar/install.js","webpack:///./node_modules/echarts/lib/component/graphic/install.js","webpack:///./node_modules/echarts/lib/component/dataZoom/helper.js","webpack:///./node_modules/echarts/lib/component/dataZoom/DataZoomModel.js","webpack:///./node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js","webpack:///./node_modules/echarts/lib/component/dataZoom/DataZoomView.js","webpack:///./node_modules/echarts/lib/component/dataZoom/SelectZoomView.js","webpack:///./node_modules/echarts/lib/component/dataZoom/AxisProxy.js","webpack:///./node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js","webpack:///./node_modules/echarts/lib/component/dataZoom/dataZoomAction.js","webpack:///./node_modules/echarts/lib/component/dataZoom/installCommon.js","webpack:///./node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js","webpack:///./node_modules/echarts/lib/component/toolbox/featureManager.js","webpack:///./node_modules/echarts/lib/component/toolbox/ToolboxModel.js","webpack:///./node_modules/echarts/lib/component/helper/listComponent.js","webpack:///./node_modules/echarts/lib/component/toolbox/ToolboxView.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/MagicType.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/DataView.js","webpack:///./node_modules/echarts/lib/component/dataZoom/history.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/Restore.js","webpack:///./node_modules/echarts/lib/component/helper/BrushTargetManager.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/DataZoom.js","webpack:///./node_modules/echarts/lib/component/toolbox/install.js","webpack:///./node_modules/echarts/lib/component/tooltip/TooltipModel.js","webpack:///./node_modules/echarts/lib/component/tooltip/helper.js","webpack:///./node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js","webpack:///./node_modules/echarts/lib/component/tooltip/TooltipRichContent.js","webpack:///./node_modules/echarts/lib/component/tooltip/TooltipView.js","webpack:///./node_modules/echarts/lib/component/tooltip/install.js","webpack:///./node_modules/echarts/lib/component/brush/preprocessor.js","webpack:///./node_modules/echarts/lib/visual/visualSolution.js","webpack:///./node_modules/echarts/lib/component/brush/selector.js","webpack:///./node_modules/echarts/lib/component/brush/visualEncoding.js","webpack:///./node_modules/echarts/lib/component/brush/BrushView.js","webpack:///./node_modules/echarts/lib/component/brush/BrushModel.js","webpack:///./node_modules/echarts/lib/component/toolbox/feature/Brush.js","webpack:///./node_modules/echarts/lib/component/brush/install.js","webpack:///./node_modules/echarts/lib/component/title/install.js","webpack:///./node_modules/echarts/lib/component/timeline/TimelineModel.js","webpack:///./node_modules/echarts/lib/component/timeline/SliderTimelineModel.js","webpack:///./node_modules/echarts/lib/component/timeline/TimelineView.js","webpack:///./node_modules/echarts/lib/component/timeline/TimelineAxis.js","webpack:///./node_modules/echarts/lib/component/timeline/SliderTimelineView.js","webpack:///./node_modules/echarts/lib/component/timeline/timelineAction.js","webpack:///./node_modules/echarts/lib/component/timeline/preprocessor.js","webpack:///./node_modules/echarts/lib/component/timeline/install.js","webpack:///./node_modules/echarts/lib/component/marker/checkMarkerInSeries.js","webpack:///./node_modules/echarts/lib/component/marker/MarkerModel.js","webpack:///./node_modules/echarts/lib/component/marker/MarkPointModel.js","webpack:///./node_modules/echarts/lib/component/marker/markerHelper.js","webpack:///./node_modules/echarts/lib/component/marker/MarkerView.js","webpack:///./node_modules/echarts/lib/component/marker/MarkPointView.js","webpack:///./node_modules/echarts/lib/component/marker/installMarkPoint.js","webpack:///./node_modules/echarts/lib/component/marker/MarkLineModel.js","webpack:///./node_modules/echarts/lib/component/marker/MarkLineView.js","webpack:///./node_modules/echarts/lib/component/marker/installMarkLine.js","webpack:///./node_modules/echarts/lib/component/marker/MarkAreaModel.js","webpack:///./node_modules/echarts/lib/component/marker/MarkAreaView.js","webpack:///./node_modules/echarts/lib/component/marker/installMarkArea.js","webpack:///./node_modules/echarts/lib/component/legend/LegendModel.js","webpack:///./node_modules/echarts/lib/component/legend/LegendView.js","webpack:///./node_modules/echarts/lib/component/legend/legendFilter.js","webpack:///./node_modules/echarts/lib/component/legend/legendAction.js","webpack:///./node_modules/echarts/lib/component/legend/installLegendPlain.js","webpack:///./node_modules/echarts/lib/component/legend/ScrollableLegendModel.js","webpack:///./node_modules/echarts/lib/component/legend/ScrollableLegendView.js","webpack:///./node_modules/echarts/lib/component/legend/scrollableLegendAction.js","webpack:///./node_modules/echarts/lib/component/legend/installLegendScroll.js","webpack:///./node_modules/echarts/lib/component/legend/install.js","webpack:///./node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js","webpack:///./node_modules/echarts/lib/component/dataZoom/roams.js","webpack:///./node_modules/echarts/lib/component/dataZoom/InsideZoomView.js","webpack:///./node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js","webpack:///./node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js","webpack:///./node_modules/echarts/lib/component/dataZoom/SliderZoomView.js","webpack:///./node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js","webpack:///./node_modules/echarts/lib/component/dataZoom/install.js","webpack:///./node_modules/echarts/lib/visual/visualDefault.js","webpack:///./node_modules/echarts/lib/component/visualMap/VisualMapModel.js","webpack:///./node_modules/echarts/lib/component/visualMap/ContinuousModel.js","webpack:///./node_modules/echarts/lib/component/visualMap/VisualMapView.js","webpack:///./node_modules/echarts/lib/component/visualMap/helper.js","webpack:///./node_modules/echarts/lib/component/visualMap/ContinuousView.js","webpack:///./node_modules/echarts/lib/component/visualMap/visualMapAction.js","webpack:///./node_modules/echarts/lib/component/visualMap/visualEncoding.js","webpack:///./node_modules/echarts/lib/component/visualMap/preprocessor.js","webpack:///./node_modules/echarts/lib/component/visualMap/installCommon.js","webpack:///./node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js","webpack:///./node_modules/echarts/lib/component/visualMap/PiecewiseModel.js","webpack:///./node_modules/echarts/lib/component/visualMap/PiecewiseView.js","webpack:///./node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js","webpack:///./node_modules/echarts/lib/component/visualMap/install.js","webpack:///./node_modules/echarts/lib/visual/aria.js","webpack:///./node_modules/echarts/lib/component/aria/preprocessor.js","webpack:///./node_modules/echarts/lib/component/aria/install.js","webpack:///./node_modules/echarts/lib/util/conditionalExpression.js","webpack:///./node_modules/echarts/lib/component/transform/filterTransform.js","webpack:///./node_modules/echarts/lib/component/transform/sortTransform.js","webpack:///./node_modules/echarts/lib/component/transform/install.js","webpack:///./node_modules/echarts/lib/component/dataset/install.js","webpack:///./node_modules/echarts/index.js","webpack:///./node_modules/axios/lib/core/enhanceError.js","webpack:///./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack:///./node_modules/node-libs-browser/mock/process.js","webpack:///./node_modules/axios/lib/core/settle.js","webpack:///./node_modules/axios/lib/core/mergeConfig.js","webpack:///./node_modules/axios/lib/core/dispatchRequest.js","webpack:///./node_modules/vuex/dist/vuex.esm-browser.js","webpack:///./node_modules/axios/lib/helpers/isAxiosError.js","webpack:///./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","webpack:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","webpack:///./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","webpack:///./node_modules/axios/lib/cancel/Cancel.js","webpack:///./node_modules/axios/lib/helpers/cookies.js","webpack:///./node_modules/axios/lib/core/buildFullPath.js","webpack:///./node_modules/axios/lib/cancel/CancelToken.js","webpack:///./node_modules/@vue/shared/dist/shared.esm-bundler.js","webpack:///./node_modules/axios/lib/adapters/xhr.js","webpack:///./node_modules/axios/index.js","webpack:///./node_modules/axios/lib/helpers/parseHeaders.js","webpack:///./node_modules/axios/lib/core/transformData.js","webpack:///./node_modules/axios/lib/utils.js","webpack:///./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/axios/lib/axios.js","webpack:///./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack:///./node_modules/path-browserify/index.js","webpack:///./node_modules/axios/lib/helpers/combineURLs.js","webpack:///./node_modules/axios/lib/core/InterceptorManager.js"],"names":["utils","buildURL","InterceptorManager","dispatchRequest","mergeConfig","Axios","instanceConfig","this","defaults","interceptors","request","response","prototype","config","arguments","url","method","toLowerCase","chain","undefined","promise","Promise","resolve","forEach","interceptor","unshift","fulfilled","rejected","push","length","then","shift","getUri","params","paramsSerializer","replace","data","module","exports","callback","arr","apply","fn","thisArg","args","Array","i","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","value","isUndefined","getDefaultAdapter","adapter","XMLHttpRequest","process","Object","toString","call","transformRequest","isFormData","isArrayBuffer","isBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","isURLSearchParams","isObject","JSON","stringify","transformResponse","parse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","merge","enhanceError","message","code","error","Error","__CANCEL__","encode","val","encodeURIComponent","serializedParams","parts","key","isArray","v","isDate","toISOString","join","hashmarkIndex","indexOf","slice","extendStatics","d","b","setPrototypeOf","__proto__","p","hasOwnProperty","__extends","__","constructor","create","__assign","assign","t","s","n","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","newEdge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","transformSupported","transform3dSupported","env","detect","ua","match","test","version","split","document","createElement","getContext","SVGRect","window","style","documentElement","WebKitCSSMatrix","wx","getSystemInfoSync","self","navigator","userAgent","BUILTIN_OBJECT","TYPED_ARRAY","objToString","arrayProto","nativeForEach","nativeFilter","filter","nativeSlice","nativeMap","map","ctorFunction","protoFunction","idStart","guid","logError","_i","console","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","target","overwrite","targetProp","sourceProp","isBuiltInObject","mergeAll","targetAndSources","extend","overlay","keysArr","createCanvas","array","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","each","cb","context","reduce","memo","find","obj","keys","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","assert","condition","trim","str","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","x","y","out","v1","v2","scaleAndAdd","Math","sqrt","lenSquare","normalize","distanceSquare","distSquare","lerp","applyTransform","m","min","max","Param","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","idxLR","idxTB","cssText","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","touch","targetTouches","changedTouches","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","button","which","rawWheelDelta","deltaX","deltaY","delta","abs","sign","name","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","pointPair","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","_super","EmptyProxy","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","_downEl","_downPoint","_upEl","identity","m1","m2","out0","out1","out2","out3","out4","out5","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","vx","vy","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","easing","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","cached","strLen","op","ep","fname","substr","alpha","hsla2rgba","iv","hsla","rgba","rgba2hsla","H","S","R","G","B","vMin","vMax","L","deltaR","deltaG","deltaB","lift","color","level","colorArr","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","_ctx","_cachedFont","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","frameIdx","isAdditive","valueKey","kfsNum","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","copy","other","equal","add","scale","scalar","sub","dot","distance","negate","toArray","fromArray","input","onet","lb","rt","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","defaultMeasureText","text","font","measureText","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","removeTextConfig","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","enhanceArray","defineProperty","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","mid","pivot","right","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","runStart","runLength","minGallop","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","count1","count2","exit","_minGallop","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","requestAnimationFrame","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","isLocalEl","elTmp","domBelongToZr","parentNode","FakeGlobalEvent","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","element","toElement","relatedTarget","__pointerCapturing","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpRect","tmpMat","invisible","childRect","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","useDirtyRect","handerProxy","HandlerProxy","getViewportRoot","_flush","configLayer","zLevel","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","end","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","getType","clearAnimation","pathToImage","dpr","eventHandler","init","registerPainter","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","all","NaN","precision","returnStr","toFixed","asc","getPrecision","count","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","Number","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","radian","pi2","isRadianAroundZero","TIME_REG","parseDate","exec","hour","UTC","quantity","quantityExponent","exp","nice","nf","exponent","exp10","quantile","ascArr","reformIntervals","littleThan","curr","currClose","interval","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","random","getGreatestCommonDividor","getLeastCommonMultiple","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","_a","preParseFinder","mainTypeSpecified","queryOptionMap","others","defaultMainType","queryOption","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","finder","parsedKey","queryType","includeMainTypes","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","makeContainer","componentTypeInfo","container","registerClass","componentFullType","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","lineWidth","subLength","estimateLength","charCode","charCodeAt","parsePlainText","lines","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","strLines","linesWidths","isEmptyStr","newLine","tokenPadding","tokenPaddingH","outerWidth_1","isLineHolder","tokensLen","isLatin","ch","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","mathPow","mathSqrt","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","_t","cubicLength","iteration","px","py","quadraticRootAt","divider","quadraticProjectPoint","quadraticLength","mathSin","mathCos","PI2","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema","cubicAt","fromQuadratic","quadraticExtremum","quadraticAt","fromArc","rx","ry","startAngle","endAngle","anticlockwise","vec2Min","vec2Max","diff","angle","M","Q","Z","tmpOutX","tmpOutY","mathAbs","hasTypedArray","Float32Array","modPI2","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dash","dashSum","dist","nDash","bezierLen","tmpLen","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","displayedLength","drawPart","accumLength","psi","isEllipse","breakBuild","ellipse","d_1","CMD","containStroke","_l","_b","_s","normalizeRadian","windingLine","dir","x_","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","pathProto","subPixelOptimize","autoBatch","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","fontSize","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","rectEl","imgEl","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","fontFamily","fontWeight","fontStyle","VALID_TEXT_ALIGN","center","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","blurSeries","targetSeriesIndex","focus","blurScope","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurComponent","componentMainType","componentIndex","focusBlurEnabled","blurSeriesFromHighlightPayload","seriesIndex","dataType","current","ecData","focus_1","findComponentHighDownDispatchers","focusSelf","dispatchers","findHighDownDispatchers","handleGlobalMouseOverForHighDown","dispatcher","componentHighDownName","handleGlboalMouseOutForHighDown","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","enableComponentHighDownFeatures","getHighlightDigit","highlightKey","payloadType","isHighDownPayload","savePathStates","selectState","select","mathAtan2","transformPath","nPoint","p_1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","prevCmd","cpx","cpy","subpathX","subpathY","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","CircleShape","Circle","EllipseShape","Ellipse","mathACos","mathATan2","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","innerRadius","r0","hasRadius","hasInnerRadius","tmpAngles","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","RingShape","Ring","interpolate","smoothSpline","isLoop","segs","w2","w3","smoothBezier","smooth","constraint","prevPoint","nextPoint","cps","point","cp0","cp1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","LineShape","Line","pointAt","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","ArcShape","Arc","unitX","unitY","CompoundPath","_updatePathDirty","paths","dirtyPath","Gradient","addColorStop","LinearGradient","globalCoord","global","RadialGradient","extent2","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","minTv","maxTv","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","IncrementalDisplayable","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","aspect","pathRect","param","animateOrSetProps","animationType","animatableModel","removeOpt","isFrom","animationPayload","isUpdate","isRemove","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","invert","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","elMap1","getElMap","anid","oldEl","newProp","getAnimatableProps","elMap","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","setTooltipConfig","itemTooltipOption","itemName","itemTooltipOptionObj","formatter","formatterParams","$vars","formatterParamsExtra","tooltipConfig","option","content","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","interpolatedValue","baseText","labelFetcher","labelDataIndex","labelDimIndex","normalModel","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","richResult","globalTextStyle","richItemNames","getRichItemNames","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currValue","labelText","enableLayoutLayoutFeatures","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","makeDepndencyGraph","fullNameList","graph","noEntryList","thisItem","createDependencyGraphItem","originalDeps","availableDeps","getAvailableDependencies","entryCount","dependentName","predecessor","thatItem","successor","dep","topologicalTravel","targetNameList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","inheritDefaultOption","superOption","subOption","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","langEN","langZH","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","toCamelCase","upperCaseFirst","group1","replaceReg","replaceMap","'","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","num","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","seriesLen","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","location","href","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextX","nextY","nextChild","nextChildRect","moveX","newline","moveY","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","getDependencies","deps","dependencies","Component","platform","decalColor","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","baseCategoryDimIndex","categoryWayValueDimStart","encodeItemName","encodeSeriesName","seriesLayoutBy","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","coordDimName","seriesName","makeSeriesEncodeForNameBased","dimCount","potentialNameDimIndex","sourceFormat","dimensionsDefine","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","startIndex","isPureNumber","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","dimName","dimType","maxLoop","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","reCreateSeriesIndices","assertSeriesInitialized","initBase","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","inner","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","OPTION_INNER_KEY","OPTION_INNER_VALUE","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","isSeriesType","ComponentModelClass","extraOpt","__requireNewView","componentOption","mainTypeInReplaceMerge","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","globalDefault","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","Global","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","CoordinateSystem","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","doPreprocess","preProcess","singleMedia","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","_c","providerMethods","mountMethods","SourceImpl","dimensionsDetectedCount","encodeDefine","metaRawOption","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","sourceHeader","dimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","methods","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","extent","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","extendParams","getItemModel","dimensionIndex","dimStr","dimLoose","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","define","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","planResult","upTask","_upstream","skip","outputData","__pipeline","currentTask","forceFirstProgress","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","_doReset","_dueEnd","_outputDueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","deprecateLog","throwError","msg","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lt","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","errMsg_1","__isBuiltIn","rawValueGetter","upstream","isSupportedSourceFormat","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","resultIndex","resultMetaRawOption","firstUpSource","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","resultSourceList","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","upSourceMgr","newMetaRawOption","_getSourceMetaRawOption","upMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","datasetIndex","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_LINE_HEIGHT_CSS","getTooltipTextStyle","nameFontColor","nameFontSize","nameFontWeight","valueFontColor","valueFontSize","valueFontWeight","nameStyle","valueStyle","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","toolTipTextStyle","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","tooltipTextStyle","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","inlineValue","inlineValueType","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","Series","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","Chart","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","debounceNextCall","lastCall","lastExec","timer","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","hasAutoColor","colorPalette","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","needSetDirty","setDirty","dirtyMap","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","performArgs_1","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","Clz","cond","colorAll","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","symbolOffset","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasSymbolOffsetCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","seriesSymbolOffset","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolOffset","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","setItemVisualFromData","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","tan","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","shifts","totalShifts","shiftList","minGap","maxGap","first","last","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","rotate","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","prevStates","oldLayoutSelect","oldLayoutEmphasis","oldOpacity","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","symbolPath","setColor","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","setTransform","matrix","rotateSelf","scaleSelf","translateSelf","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","nodeParsers","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","canvas","svgRoot","createSVGElement","pSize","getPatternSize","xlen","symbolRepeats","brushDecal","clearRect","fillRect","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","paintOne","svgWidth","svgHeight","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","INHERITABLE_STYLE_ATTRIBUTES_MAP","INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS","SELF_STYLE_ATTRIBUTES_MAP","SELF_STYLE_ATTRIBUTES_MAP_KEYS","SVGParser","_defs","_root","xml","_defsUsePending","named","viewBox","parseAttributes","viewBoxRect","viewBoxTransform","_parseNode","applyDefs","viewBoxArr","splitNumberSequence","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","namedFrom","isInDefs","isInText","namedFromForSub","parser_1","newNamed","svgNodeTagLower","paintServerParsers","def","_parseText","_textX","_textY","inheritStyle","applyTextAlignment","pointsArr","pointsStr","parsePoints","polyline","gradient","parsePaintServerUnit","parseGradientColorStops","gradientUnits","toLocaleLowerCase","offsetStr","styleVals","parseInlineStyle","stopColor","__inheritedStyle","pointsString","defsUsePending","onlyInlineStyle","isTextGroup","inheritedStyle","selfStyle","parseTransformAttribute","parseAttributeStyle","getFillStrokeStyle","__selfStyle","visibility","display","parentSelfStyle","zrTextBaseline","parentInheritedStyle","zrTextAlign","urlRegex","urlMatch","defs","rawStr","transformRegex","transformOps_1","mt","valueArr","styleRegex","inheritableStyleResult","selfStyleResult","styleRegResult","svgStlAttr","zrInheritableStlAttr","zrSelfStlAttr","svgAttrName","attrValue","parseSVG","TMP_TRANSFORM","Region","getCenter","GeoJSONRegion","geometries","cp","_center","MAX_NUMBER","min2","max2","exterior","loopGeo","interiors","transformTo","newRegion","setCenter","GeoSVGRegion","elOnlyForCalculate","_elOnlyForCalculate","_calculateCenter","isGeoSVGGraphicRoot","REGION_AVAILABLE_SVG_TAG_MAP","GeoSVGResource","mapName","_usedGraphicMap","_freedGraphics","_mapName","_parsedXML","load","firstGraphic","_firstGraphic","_buildGraphic","_boundingRect","createRegions","regionsMap","_regions","_regionsMap","svgXML","rootFromParse","bRectX","bRectY","bRectWidth","bRectHeight","calculatedBoundingRect","namedItem","setSilent","useGraphic","hostKey","usedRootMap","svgGraphic","freeGraphic","region","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","features","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","c2","prevX","prevY","parseGeoJSON","geoJson","nameProperty","featureObj","geoCoord","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","geoCoordMap","fixGeoCoords","fixDiaoyuIsland","DEFAULT_NAME_PROPERTY","GeoJSONResource","geoJSON","specialAreas","_parsedMap","_specialAreas","_geoJSON","parseInput","parsed","rawRegions","_parseToRegions","calculateBoundingRect","finalRegions","regionName","specialArea","getMapForUser","regionRect","registerMap","rawDef","rawSpecialAreas","resource","getGeoResource","hasWindow","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","toLowercaseNameAndCallEventful","disposedWarning","createRegisterEventWithLowercaseMessageCenter","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","MessageCenter","messageCenterProto","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","startTime","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getRenderedCanvas","pixelRatio","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","mathMin","mathMax","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","chart","getSvgDom","innerHTML","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","applyElementStates","newStates","updateHoverLayerStatus","elCount","preventUsingHoverLayer","__alive","updateBlend","updateZ","preventAutoZ","_updateZ","maxZ2","updateStates","stateAnimationModel","enableAnimation","isComponent","viewList","viewMap","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","excludeSeriesIdMap","excludeSeriesId","modelId","notBlur","callView","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isHighDown","batchItem","action","newObj","pendingActions","dirtyList","__transientTransitionOpt","postUpdateFuncs","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","to","finderOpt","fromResult","toResult","toSeries","dimension","dividingMethod","echartsProto","one","wrapped","args2","postInitFuncs","idBase","existInstance","getInstanceByDom","postInitFunc","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","registerLayout","layoutTask","registerVisual","visualTask","registeredTasks","targetList","defaultPriority","__raw","registerLoading","loadingFx","geoSourceManager","registerTransform","light","dark","extensions","extensionRegisters","registerComponentModel","registerComponentView","ComponentViewClass","registerSeriesModel","SeriesModelClass","registerChartView","ChartViewClass","painterType","PainterCtor","use","ext","singleExt","install","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","hasIntersections","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearColorGradientOrPattern","__canvasGradient","__painter","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","zlevelList","layers","rootCanvas","_width","_height","mainLayer","_domRoot","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","eachLayer","self_1","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","prevZlevel","incrementalLayerCount","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","clearLayer","imageLayer","width_1","height_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","registers","createElementNS","oldArr","newArr","equals","newLen","oldLen","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","NONE","mathRound","degree","round3","round4","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","lineJoin","SVGPathRebuilder","_d","_str","_add","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","HTMLCanvasElement","dw","dh","__imageSrc","TEXT_ALIGN_TO_ANCHOR","svgText","textSvgEl","textSvgElStyle","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","getElementsByTagName","defs_1","contains","doUpdate","onUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","isGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","parentEl","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","viewportStyle","viewportNode","outerHTML","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","DataDimensionInfo","mathFloor","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","maxArea","area","nextRawIndex","sampledIndex","currentRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","cloneChunk","originalChunk","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","newStore","excludeDimensions","allDimensions","originalStorage","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","stackedByDimInfo","stackedDimInfo","byIndex","stackedCoordDimension","mayStack","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","coordSysDimDefs","registeredCoordSys","coordSysInfo","getDimensionsInfo","hasNameEncode","useEncodeDefaulter","dimInfoList","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","LineSeriesModel","getLegendIcon","itemHeight","itemWidth","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","LineSeries","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","baseAxis","getOtherAxis","valueStart","getValueStart","baseAxisDim","valueAxisDim","valueDim","baseDim","baseDataOffset","stacked","stackResultDim","dataDimsForPoint","getExtent","getStackedOnPoint","dataCoordInfo","stackedData","dataToPoint","supportFloat32Array","Float32ArrayCtor","createFloat32Array","arg","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","cartesian","hasAnimation","getArea","isHorizontal","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","toGlobalCoord","dataToCoord","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","getViewLabels","ordinalNumber","getRawOrdinalNumber","tickValue","axisExtent","availSize","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","expandSize","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","_initSymbolLabelAnimation","_newPolyline","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","symbolLabel","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","distanceX","distanceY","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","getLayoutOnAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","lastColumn","widthSum","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","barMinHeight","isValueAxisH","valueAxisStart","getValueAxisStart","baseValue","baseCoord","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","BaseBarSeriesModel","getMarkerPosition","clampData","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BaseBarSeries","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","BarSeries","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","_eventPos","getClipArea","coordSysClipArea","onBand","expandWidth","BarView","_isFirstFrame","_removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","realtimeSortCfg","shouldRealtimeSort","_enableRealtimeSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dispatchInitSort","orderMapping_1","_onRendered","_updateSortWithinSameData","_dataSort","orderMapping","mappedValue","ordinalNumbers","_isOrderChangedWithinSameData","ordinalDataDim","lastValue","tickNum","MIN_VALUE","_isOrderDifferentInView","orderInfo","tickMax","sortInfo","axisId","sortResult","otherAxis","coordSysBoundingRect","signWidth","signHeight","coordSysX2","coordSysY2","xClipped","yClipped","signR","clipped","__dataIndex","animateProperty","sector","sectorShape","animateTarget","realtimeSortOption","seriesAnimationModel","seriesTarget","axisTarget","axisAnimationModel","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","setCategorySortInfo","getViewRect","pieLayout","viewRect","minAngle","validDataCount","unitRadian","roseType","stillShowZeroSum","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","adjustSingleSide","viewLeft","viewTop","farthestX","labelAlignTo","recalculateX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","items","topSemi","bottomSemi","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","bleedMargin","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelModel","labelLineLen","labelLineLen2","midAngle","isLabelInside","textRect","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minShowLabelAngle","selectedOffset","percentPrecision","distanceToLabelLine","labelLayout","avoidLabelOverlap","animationTypeUpdate","PieSeries","ScatterSeriesModel","ScatterSeries","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","GridModel","containLabel","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","boundaryGap","deduplication","alignWithLabel","splitNumber","minorTick","primary","logBase","category","OrdinalMeta","_needCollect","needCollect","_deduplication","createByAxisModel","dedplication","getOrdinal","_getOrCreateMap","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","axisDefault","AxisModel","getAxisType","thisOption","__ordinalMeta","getCategories","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","roundNumber","intervalScaleNiceTicks","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","OrdinalScale","_ordinalMeta","_getTickNumber","getTicks","ticks","getMinorTicks","setSortInfo","infoOrdinalNumbers","ordinalsByTick","_ordinalNumbersByTick","ticksByOrdinal","_ticksByOrdinalNumber","allCategoryLen","unusedOrdinal","ordinal","ticksByOrdinalNumber","tickNumber","ordinalNumbersByTick","getLabel","cateogry","niceTicks","niceExtent","Ordinal","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","dataNum","fixMax","fixMin","Interval","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","targetTickNum","levelsTicksInExtent","maxLevel","Time","scaleProto","intervalScaleProto","roundingErrorFix","mathCeil","mathLog","LogScale","base","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","err","originalVal","Log","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","frozen","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","Cartesian","_dimList","getAxes","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","containData","xVal","yVal","xAxis","yAxis","xScale","yScale","xAxisExtent","yAxisExtent","pointToData","coordToData","xExtent","getGlobalExtent","yExtent","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","makeCategoryLabelsActually","labels","labelCategoryInterval","numericLabelInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","tickCategoryInterval","ticksCache","optionTickInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","fixExtentWithBands","getTicksCoords","getTickModel","ticksCoords","tickVal","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","Axis2D","coordExtent","categorySortInfo","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelDirection","tickDirection","nameDirection","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","gridRect","axesList","adjustAxes","updateAxisTransform","labelUnionRect","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","getCartesians","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","isCategory","axesModelMap","getTooltipAxes","baseAxes","otherAxes","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","AxisBuilder","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","pt1","pt2","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","axisNameAvailableWidth","gapSignal","isNameLocationCenter","nameRotation","endTextLayout","truncateOpt","nameTruncateMaxWidth","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","saveTooltipAxisInfo","triggerAxis","cross","tooltipAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","GridView","extraOption","radarLayout","getIndicatorAxes","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","indicator","polarIndex","radarIndex","normalizeSymbolSize","RadarView","createSymbol","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","RadarSeriesModel","indicatorAxes","nameToDisplay","getTooltipPosition","coordToPoint","RadarSeries","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","getIndicatorModels","radarModel","_buildAxes","_buildSplitLineAndArea","axisBuilders","indicatorAxis","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","ticksRadius","getColorIndex","realSplitNumber_1","axesTicksPoints","prevPoints","areaOrLine","areaOrLineColorList","IndicatorAxis","radiusExtent","Radar","_indicatorAxes","indicatorModel","indicatorIndex","closestAxis","minRadianDiff","closestAxisIdx","viewSize","radarSeries","increaseInterval","fixedMin","fixedMax","nicedSplitNumber","pixel","radarList","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","OPTION_STYLE_ENABLED_TAGS","OPTION_STYLE_ENABLED_TAG_MAP","STATE_TRIGGER_TAG_MAP","LABEL_HOST_MAP","mapLabelRaw","getFixedItemStyle","areaColor","MapDraw","_controller","_controllerHost","_regionsGroup","_svgGroup","mapOrGeoModel","fromView","isGeo","mapSeries","getHostGeoModel","regionsGroup","transformInfo","getTransformInfo","transformInfoRaw","raw","transformInfoRoam","roam","isFirstDraw","isVisualEncodedByVisualMap","viewBuildCtx","resourceType","_buildGeoJSON","_buildSVG","_updateController","_updateMapSelectHandler","_regionsGroupByName","transformPoint","regionModel","getRegionModel","regionGroup","hasRegionGroup","compoundPath","resetEventTriggerForRegion","resetTooltipForRegion","resetStateTriggerForRegion","interior","points_1","applyOptionStyleForRegion","centerPt","resetLabelForRegion","_svgResourceChanged","_freeSVG","_useSVG","svgDispatcherMap","_svgDispatcherMap","_svgGraphicRecord","els","_enableBlurEntireSVG","opacity_1","geoModel","regionsGroupByName","_svgMapName","getZoom","makeActionBase","_mouseDownFlag","resetForLabelLayout","mapDraw","normalStyleModel","emphasisStyleModel","blurStyleModel","selectStyleModel","selectStyle","labelXY","isDataNaN","showLabel","specifiedTextOpt","eventTrigger","geoIndex","MapView","mapModel","_mapDraw","needsDrawMap","_renderSymbols","originalData","originalDataIndex","fullData","mainSeries","fullIndex_1","MapSeries","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","geoSource","getMapType","seriesNames","otherIndex","setZoom","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_transformTo","_viewRect","rawTransform","rawParent","_updateTransform","centerCoord","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","roamTransform","defaultCenter","roamTransformable","rawTransformable","_rawTransform","dummyTransformable","getViewRectAfterRoam","noRoam","getCoordSys","GEO_DEFAULT_PARAMS","invertLongitute","Geo","_nameCoordMap","defaultParmas","_invertLongitute","getRegionByCoord","addGeoCoord","getGeoCoord","resizeGeo","leftTop","rightBottom","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","updateCenterAndZoom","previousZoom","fixX","fixY","GeoView","_handleRegionClick","updateSelectStatus","geoId","makeAction","allSelected","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","isExpand","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","updateNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","nodeScaleRatio","groupZoom","roamZoom","getNodeByDataIndex","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","rawX","__radialOldRawX","rawY","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","realRoot","rootLayout","isLeft","labelRotateRadian","focusDataIndices","getAncestorsIndices","getDescendantIndices","drawEdge","__edge","edgeShape","getOrient","curvature","edgeForkPosition","getEdgeShape","childLayout","removeAnimationOpt","sourceEdge","layoutOpt","radialCoor1","radialCoor2","radialCoor3","radialCoor4","linkList","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","depth","viewChildren","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","getAncestors","includeSelf","currNode","childNode","getValue","getLevelModel","levelModels","isAncestorOf","isDescendantOf","Tree","_nodes","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","addChild","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","curveness","TreeSeries","eachAfter","eachBefore","treeLayout","commonLayout","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","installTreeAction","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","actionTypes","installTreemapAction","handleRootToNode","originViewRoot","getViewRoot","resetViewRoot","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TreemapSeries","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","layoutParam","totalWidth","renderList","_prepare","_renderContent","lastX","availableSize","itemNode","makeItemPoints","onclick","packEventData","selfType","AnimationWrap","_elExistsMap","_finishedCallback","checkTerminate","createWrap","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z2_BASE","Z2_BG","Z2_CONTENT","getStateItemStyle","getItemStyleNormal","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","renderFinally","_doAnimation","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","focusOrIndices","renderContent","useUpperLabel","processInvisible","visualBorderColor","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","isShow","addDrillDownIcon","textEmphasisState","iconChar","lasts","prepareAnimationWhenHasOld","calculateZ2","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","z2InLevel","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","travelTree","designatedVisual","viewRootAncestors","nodeLayout","thisNodeColor","nodeItemStyleModel","visuals","buildVisuals","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","score","worst","orderBy","overLeafDepth","statistic","filterByThreshold","orderedChildren","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","treemapVisual","treemapLayout","categoryFilter","graphSeries","categoriesData","getCategoriesData","getGraph","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryIdx","categoryStyle","visualList","graphEdgeVisual","getEdgeData","getEdgeByIndex","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","n1","n2","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","simpleLayout","simpleLayoutEdge","eachEdge","graphSimpleLayout","getNodeGlobalScale","_symbolRadiansHalf","circularLayout","basedOn","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","graphCircularLayout","inNodes","inEdges","gravity","pp","beforeStepCallback","afterStepCallback","initialFriction","friction","warmUp","setFixed","setUnfixed","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","initLayout","nodeDataExtent_1","edgeDataExtent_1","repulsion","edgeLength","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getNodeByIndex","forceLayout","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","lineData","symbolSizeArr","symbolOffsetArr","__specifiedRotation","createLine","setLinePoints","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","halfPercent","tangent","specifiedRotation","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","v3","v2DistSquare","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","layoutAnimation","_startForceLayoutIteration","getGraphicEl","_layouting","getAdjacentDataIndices","circularRotateLabel","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","addEdge","edgesMap","GraphEdge","outEdges","getEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","inDegree","outDegree","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","GraphSeriesModel","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryModel","oldGetModel","newGetModel","newPathArr","sourceName","nodeMarkup","circular","rotateLabel","edgeSymbol","edgeSymbolSize","edgeLabel","GraphSeries","PointerShape","PointerPath","parsePosition","formatLabel","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerOffsetX","pointerOffsetY","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","fmt","GaugeSeriesModel","icon","GaugeSeries","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","FunnelSeriesModel","minSize","funnelAlign","FunnelSeries","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","DEFAULT_SMOOTH","ParallelView","_dataGroup","dataGroup","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","activeState","eachActiveState","theActiveState","parallelIndex","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","ParallelSeries","parallelVisual","opacityMap","active","inactive","itemOpacity","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelOption","CLICK_THRESHOLD","_handlers","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","getSlidedAxisExpandWindow","behavior","axisExpandWindow","triggerOn","ParallelModel","_initDimensions","setAxisExpand","axisModels","axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","currDistSign","extentMinSpan","realExtent","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","winSize","layoutExtent","axisCount","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","dataDimensions","hasActiveSet","hasAxisBrushed","getActiveState","axisLayout","getAxisLayout","pointCoord","triggerArea","useJump","winSize2","createParallelCoordSys","parallelCoordSysCreator","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","BRUSH_PANEL_GLOBAL","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_uid","pointerHandlers","enableBrush","brushOption","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panel","panels","pn","isTargetByCursor","getPanelByCover","covers","originalLength","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","eventParams","_creatingPanel","thisBrushOption","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaSelectStyle","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","realtime","parallelAxisId","installParallelActions","parallelAxisModel","defaultAxisOption","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","sourceColor","targetColor","dragX","dragY","localX","localY","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","SankeySeries","sankeyLayout","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","WhiskerBoxCommonMixin","addOrdinal","xAxisType","yAxisType","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotSeries","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotVisual","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","availableWidth","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","low","high","itemNameFormatter","outlier","boxplotTransform","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","setBoxCommon","NormalBoxPathShape","NormalBoxPath","__simpleBox","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","CandlestickSeriesModel","getShadowDim","brushRect","CandlestickSeries","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","candlestickLayout","candleWidth","calculateCandleWidth","openDim","closeDim","lowestDim","highestDim","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","getSign","makeBrushRect","pmin","pmax","EFFECT_RIPPLE_NUMBER","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","period","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","showEffectOn","EffectScatterView","effectSymbolDraw","_updateGroupTransform","EffectScatterSeriesModel","effectType","rippleEffect","EffectScatterSeries","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","constantSpeed","delayExpr","_updateAnimationPoints","_getLineLength","_period","delayNum","__t","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt","__lastT","_createPolyline","hoverLineStyle","lineEmphasisState","EffectPolyline","accLenArr","_offsets","_length","offsets","LargeLinesPathShape","LargeLinesPath","LargeLineDraw","lineEl","linesLayout","isPolyline","isLarge","lineCoords","totalCoordsCount","getLineCoordsCount","getLineCoords","LinesView","_updateLineDraw","trailLength","_lastZlevel","_showEffect","hasEffect","_hasEffet","_isPolyline","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","effect","LinesSeries","linesVisual","GRADIENT_LEVELS","HeatmapLayer","blurSize","pointSize","maxOpacity","minOpacity","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_incrementalDisplayable","_renderOnCartesianAndCalendar","_renderOnGeo","dataDimX","dataDimY","dataToRect","contentShape","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","HeatmapSeriesModel","HeatmapSeries","BAR_BORDER_WIDTH_QUERY","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","symbolRepeat","symbolClip","symbolPosition","symbolPatternSize","symbolRepeatDirection","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","symbolBoundingData","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","parsedSymbolSize","categorySize","unitLength","pathLen","absBoundingLength","symbolMargin","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","updateAttr","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","pathes","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","PictorialBarSeriesModel","PictorialBarSeries","ThemeRiverView","layersSeries","getLayerSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","oldLayersGroups","points0","textLayout","layerGroup","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","lenCount","indexArr","timeDim","layerSeries","index1","index2","getAxisTooltipData","nestestValue","nearestIdx","pointNum","theValue","singleAxisIndex","ThemeRiverSeries","themeRiverLayout","doThemeRiverLayout","baseY0","layerPoints","singleLayer","computeBaseline","baseLine","layerIndex","sums","temp","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_ecModel","itemStyleModel","labelMinAngle","isNormalShown","getLabelAttr","stateAttr","labelStateModel","isShown","sectorState","labelColor","labelPadding","rotateType","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","UNHIGHLIGHT_ACTION","installSunburstAction","handleHighlight","SunburstView","newRoot","renderLabelForZeroData","newChildren","oldChildren","_oldChildren","newNode","removeNode","renderRollUp","virtualPiece","targetFound","SunburstSeriesModel","SunburstSeries","sunburstLayout","rootDepth","renderRollupNode","rPerLevel","renderNode","rStart","rEnd","siblingAngle_1","sortOrder","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","geoPrepareCustom","singlePrepareCustom","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","textContentStyle","srcStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","PROP_XY","PROP_WH","aroundEqual","pathToBezierCurves","currentSubpath","bezierArray","createNewSubpath","addLine","addArc","c1","s1","s2","x4","y4","hx","hy","nextAngle","alignSubpath","subpath1","subpath2","shorterPath","shorterLen","shorterBezierCount","eachCurveSubDivCount","newSubpath","tmpSegX","tmpSegY","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","centroid","signedArea","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","findBestMorphingRotation","fromArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","tmpArr_1","sa","ca","newX1","newY1","morphPath","fromPath","toPath","animationOpts","fromPathProxy","toPathProxy","isIndividualMorphingPath","__oldBuildPath","fromBezierCurves","toBezierCurves","morphingData","becomeIndividualMorphingPath","oldDone","oldAborted","oldDuring","__morphT","restoreIndividualMorphingPath","morphingPathBuildPath","__morphingData","newCp","morphT","updateIndividualMorphingPath","morphingPath","isCombiningPath","__combiningSubList","isInAnyMorphing","combine","fromPathList","copyPropsIfDivided","fromIndividuals","separateCount","fromCombiningSubList","toPathSplittedList","divideShape","doneCount","abortedCalled","morphAnimationOpts","restoreCombiningPath","becomeCombiningPath","toIndividuals","combiningSubList","updateCombiningPathSubList","combiningPath","__oldAddSelfToZr","__oldRemoveSelfFromZr","combiningAddSelfToZr","combiningRemoveSelfFromZr","combiningChildrenRef","combiningPathSubListAddRemoveWithZr","separate","toPathList","toPathListLen","copyProps","duplicateShape","splitShape","resultPaths","toPathShape","splitPropIdx","propWH","propXY","subWH","xyCurr","subShape","splitted","endAngleNormalized","angleCurr","TRANSFORM_PROPS","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","GROUP_DIFF_PREFIX","attachedTxInfoTmp","LEGACY_TRANSFORM_PROPS","tmpTransformable","prepareCustoms","CustomSeriesModel","currentZLevel","currentZ","CustomSeriesView","customSeries","renderItem","makeRenderItem","morphPreparation_1","createGetKey","createOrUpdateItem","doRemoveEl","findAndAddFrom","hasFrom","removeElementDirectly","applyMorphing","oldIndices","setIncrementalAndHoverLayer","elementName","diffByDimName","createEl","elOption","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","isMorphTo","styleOpt","attachedTxInfo","isTextContent","transFromProps","allPropsFinal","elDisplayable","prepareShapeOrExtraTransitionFrom","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareTransformAllPropsFinal","txCfgOpt","textOptionStyle","decalPattern","decalObj","__decalPattern","prepareStyleTransitionFrom","applyPropsFinal","applyTransitionFrom","originalDecalObj","userDuring","cfgDuringCall","duringCall","mainAttr","morphFromEl","attrOpt","transFromPropsInAttr","elPropsInAttr","enterFrom","enterFromKeys","transitionKeys","elVal","elPropsInAttrKeys","isNonStyleTransitionEnabled","leaveTo","leaveToProps","getOrCreateLeaveToPropsFromEl","leaveToPropsInAttr","leaveToKeys","allProps","allPropsInAttr","keysInAttr","fromTransformable","calcOldElLocalTransformBasedOnNewElParent","setTransformPropToTransitionFrom","setLagecyTransformProp","setTransformProp","transFromStyleProps","fromEl","fromElStyle","animationStyleProps","styleKeys","leaveToStyleProps","newEl","tmpM","oldGlobalTransform","newParent","optVal","innerEl","tmpDuringScope","customDuringAPI","isShapeDirty","getShape","isStyleDirty","setExtra","getExtra","newstUserDuring","scopeUserDuring","updateElOnState","elStateOpt","isRoot","existingEmphasisState","optZ2","updateZForEachState","retrieveStateOption","targetProps","legacyName","legacyArr","xyName","transitionFrom","prepareResult","currDataIndexInside","currItemModel","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","morphPreparation","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","elIsNewCreated","canMorph","morph","thisElIsMorphTo","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","pendingAllPropsFinal","addTo","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","processAddUpdate","processRemove","childOption","MorphPreparation","_fromList","_toList","_toElOptionList","_allPropsFinalList","_toDataIndices","_morphConfigList","_transOpt","_type","fromList","toList","toListLen","fromListLen","toIdx","_oneToOneForSingleTo","fromSingleSegLen","fromIdxStart","fromCount","_manyToOneForSingleTo","toSingleSegLen","toIdxStart","fromIdx","toCount","_oneToManyForSingleFrom","toElOption","toDataIndex","elAnimationConfig","_getOrCreateMorphConfig","morphDuration","combineResult","copyPropsWhenDivided","_processResultIndividuals","morphFrom","combineFromList","separateToList","separateResult","combineSeparateResult","isSeparate","fromIndividual","toIndividual","morphConfigList","delayOption","srcPath","tarPath","willClone","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","doUpdateProps","updatePointerEl","updateLabelEl","createPointerEl","createLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","payloadInfo","cursorPoint","tooltipOption","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","seriesDataIndices","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","records","initGlobalListeners","useHandler","dis","makeDispatchAction","dispatchTooltipFinally","pendings","initialized","doEnter","onLeave","actuallyPayload","showLen","showTip","hideLen","hideTip","currTrigger","unregister","AxisPointerView","findPointFromSeries","isStacked","axisTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","outputAxesInfo","valItem","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","PolarAxisPointer","coordValue","getLabelPosition","axisAngle","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","RadiusAxis","radiusToData","AngleAxis","angleToData","Polar","_radiusAxis","_angleAxis","maxAngle","RADIAN","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","RadiusAxisView","newAxisGroup","layoutAxis","prevRadius","barLayoutPolar","calRadialBar","clampLayout","radiusSpan","angleSpan","angleAxisExtraOption","radiusAxisExtraOption","PolarView","positionMap","directionMap","SingleAxisView","SingleAxisModel","SingleAxis","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","singleModel","singles","singleCreator","XY","WH","SingleAxisPointer","getPointDimIndex","SingleView","CalendarModel","mergeAndNormalizeLayoutParams","getCellSize","cellSize","firstDay","cellSizeArr","MONTH_TEXT","EN","CN","WEEK_TEXT","CalendarView","calendarModel","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","getNextNDay","tl","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","formatedDate","getDateInfo","setMonth","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","getFirstDayOfWeek","lweek","fweek","weekText","PROXIMATE_ONE_DAY","Calendar","_rangeInfo","_sw","_sh","_orient","_firstDayOfWeek","mStr","dStr","getDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","normalizedRange","rangeStr","reversed","parsedRange","startDateNum","endDateNum","dateNum","nthDay","calendarList","calendarSeries","_nonShapeGraphicElements","preprocessor","graphicOption","graphic","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elExisting","parentId","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","removeEl","textContentExisting","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","existItem","existingGroupOpt","newGroupOpt","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","foundNewLink","axisRecords","effectedModels","effectedModelMap","dataZoomModel","addToEffected","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","getPercentRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","SelectDataZoomModel","DataZoomView","SelectDataZoomView","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","hasPropModeValue","_dataExtent","percentExtent","percentWindow","valueWindow","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","dataZoomProcessor","eachAxisModel","proxyList","seriesModelMap","percentRange","valueRange","installDataZoomAction","installed","installCommon","SelectZoomModel","SelectZoomView","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","viewportSize","makeBackground","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","titleText","__title","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconsMap","titlesMap","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","hoverStyle","defaultTextPosition","SaveAsImage","MouseEvent","msSaveOrOpenBlob","base64Encoded","bstr","decodeURIComponent","atob","filename","u8arr","Uint8Array","blob","Blob","body","cw","contentWindow","doc","write","execCommand","tab","$a","download","evt","bubbles","cancelable","dispatchEvent","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","columns","assembleOtherSeries","getContentFromModel","isTSVFormat","firstLine","itemSplitRegex","RegExp","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","clientHeight","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","snapshots","RestoreOption","Restore","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","DATA_ZOOM_ID_BASE","DataZoomFeature","updateZoomBtnStatus","updateBackBtnStatus","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","_isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","newOpt","$fromToolbox","DataZoom","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","tooltipModel","confineOption","testStyle","styleProps","TRANSFORM_VENDOR","TRANSITION_VENDOR","toCSSVendorPrefix","styleVendor","styleProp","currentStyle","CSS_TRANSITION_VENDOR","CSS_TRANSFORM_VENDOR","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","borderStyle","styleCss","assembleTransition","onlyFade","transitionCurve","transitionOption","transitionText","assembleTransform","is3d","translate","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","setContent","setEnterable","clientWidth","transforms","ratioX","ratioY","willChange","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","_ticket","cmptRef","findComponentReference","positionDefault","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","seriesDispatcher_1","cmptDispatcher_1","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","tooltipModelCascade","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","defaultTooltipOption","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","subEl","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","layoutCovers","brushModel","brushVisual","throttleDelay","brushSelected","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","BrushView","$from","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushFeature","isBrushed","_brushMode","command","Brush","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","TimelineModel","_initData","setCurrentIndex","currentIndex","isIndexMax","setPlayState","autoPlay","getPlayState","processedDataArr","dataArr","_names","controlPosition","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","parsedLabelPos","labelPosOpt","playPosition","prevBtnPosition","nextBtnPosition","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","playState","makeBtn","willRotate","iconSize","btn","makeControlIcon","_handlePlayClick","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","installTimelineAction","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","itemStyleEmphasis","labelNormal","excludeLabelAttr","checkMarkerInSeries","seriesOpts","seriesOptArr","fillLabel","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","sum_1","count_1","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList","coordDimsInfos","dataOpt","MarkLineModel","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","fromData","toData","updateDataVisualAndLayout","fromSymbolKeepAspect","fromSymbolOffset","fromSymbolRotate","fromSymbolSize","toSymbolKeepAspect","toSymbolOffset","toSymbolRotate","toSymbolSize","optData","MarkAreaModel","markAreaTransform","maModel","rb","ltCoord","rbCoord","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","xPointExtent","yPointExtent","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","allSelect","inverseSelect","inactiveColor","inactiveBorderColor","inactiveBorderWidth","borderCap","borderJoin","borderMiterLimit","inactiveWidth","cap","dashOffset","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","legendModel","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendItemModel","lineVisualStyle","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","selectorItem","emphasisLabelModel","itemVisualStyle","drawType","legendIconType","legendLineStyle","getLegendStyle","getDefaultLegendIcon","hitRect","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","itemProperties","startsWith","legendLineModel","lineProperties","visualHasBorder","symboType","isUseHoverLayer","legendFilter","legendSelectActionHandler","isToggleSelect","isItemSelected","installLegendAction","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","installScrollableLegendAction","InsideZoomModel","disabled","zoomLock","setViewInfoToCoordSysRecord","getRange","coordSysRecordMap","coordSysRecord","dzInfo","dataZoomInfoMap","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","disposeCoordSysRecord","createCoordSysRecord","containsPoint","dzReferCoordSysInfo","mergeControllerParams","typePriority","dataZoomInfo","oneType","installDataZoomRoamProcessor","apiInner","dzReferCoordSysWrap","dzCoordSysInfo","firstDzInfo","firstDzKey","controllerParams","InsideZoomView","pan","getRangeHandlers","scrollMove","lastRange","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","brushSelect","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","otherDataExtent","otherOffset","lastIsEmpty","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","visualDefault","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getItemSymbol","getTargetSeriesIndices","optionSeriesIndex","isTargetSeries","is","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","getDataDimension","optDim","listDimensions","completeSingle","completeInactive","stateExist","stateAbsent","optExist","optAbsent","defa","completeController","symbolExists","symbolSizeExists","itemSymbol","max_1","setSelected","getSelected","getVisualMeta","getColorVisual","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","calculable","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","hoverLinkDataSize","hoverLinkOnHandle","visualMapActionInfo","visualMapActionHander","visualMapEncodingHandlers","concreteDim","resultVisual","visualMapPreprocessor","pieces","splitList","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","PiecewiseView","DEFAULT_OPTION","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","ariaLabel","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","resultData","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_2","comparator","item0","item1","orderDef","DatasetModel","_sourceManager","DatasetView","isAxiosError","toJSON","description","number","fileName","lineNumber","columnNumber","isStandardBrowserEnv","originURL","msie","urlParsingNode","resolveURL","protocol","search","hash","hostname","port","pathname","requestURL","arch","execPath","pid","argv","binding","cwd","chdir","kill","umask","dlopen","uptime","memoryUsage","uvCounters","createError","reject","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","isPlainObject","mergeDeepProperties","axiosKeys","otherKeys","transformData","isCancel","throwIfCancellationRequested","cancelToken","throwIfRequested","reason","storeKey","devtoolHook","__VUE_DEVTOOLS_GLOBAL_HOOK__","devtoolPlugin","_devtoolHook","emit","targetState","subscribe","mutation","subscribeAction","forEachValue","isPromise","partial","Module","rawModule","runtime","_rawModule","rawState","prototypeAccessors","namespaced","getChild","hasChild","mutations","forEachChild","forEachGetter","forEachAction","forEachMutation","defineProperties","ModuleCollection","rawRootModule","targetModule","newModule","assertRawModule","modules","getNamespace","namespace","this$1","rawChildModule","isRegistered","functionAssert","expected","objectAssert","assertTypes","assertOptions","makeAssertionMessage","buf","createStore","Store","plugins","strict","_committing","_actions","_actionSubscribers","_mutations","_wrappedGetters","_modules","_modulesNamespaceMap","_subscribers","_makeLocalGettersCache","ref","commit","installModule","resetStoreState","plugin","useDevtools","devtools","prototypeAccessors$1","genericSubscribe","subs","resetStore","hot","wrappedGetters","computedObj","enableStrictMode","_withCommit","rootState","parentState","getNestedState","moduleName","makeLocalContext","namespacedType","registerMutation","registerGetter","noNamespace","_options","unifyObjectStyle","makeLocalGetters","gettersProxy","splitPos","localType","rootGetters","catch","rawGetter","deep","app","injectKey","provide","globalProperties","$store","before","after","watch","registerModule","preserveState","unregisterModule","hasModule","hotUpdate","newOptions","committing","normalizeNamespace","isValidMap","normalizeMap","getModuleByNamespace","vuex","helper","targetMap","effectStack","activeEffect","ITERATE_KEY","MAP_KEY_ITERATE_KEY","isEffect","_isEffect","createReactiveEffect","lazy","onStop","enableTracking","resetTracking","allowRecurse","delete","shouldTrack","trackStack","pauseTracking","depsMap","Map","Set","oldValue","oldTarget","effects","effectsToAdd","run","isNonTrackableKeys","builtInSymbols","createGetter","shallowGet","readonlyGet","shallowReadonlyGet","arrayInstrumentations","isReadonly","shallow","receiver","shallowReadonlyMap","readonlyMap","shallowReactiveMap","reactiveMap","targetIsArray","Reflect","isRef","shouldUnwrap","readonly","reactive","toRaw","createSetter","shallowSet","hadKey","deleteProperty","ownKeys","mutableHandlers","readonlyHandlers","shallowReactiveHandlers","toReactive","toReadonly","toShallow","getProto","getPrototypeOf","get$1","isShallow","rawTarget","rawKey","has$1","set$1","deleteEntry","hadItems","createForEach","observed","createIterableMethod","targetIsMap","isPair","isKeyOnly","innerIterator","createReadonlyMethod","mutableInstrumentations","shallowInstrumentations","readonlyInstrumentations","shallowReadonlyInstrumentations","iteratorMethods","createInstrumentationGetter","instrumentations","mutableCollectionHandlers","shallowCollectionHandlers","readonlyCollectionHandlers","targetTypeMap","rawType","getTargetType","isExtensible","createReactiveObject","shallowReactive","baseHandlers","collectionHandlers","proxyMap","existingProxy","Proxy","isReactive","isProxy","Boolean","__v_isRef","unref","shallowUnwrapHandlers","proxyRefs","objectWithRefs","ObjectRefImpl","_object","_key","toRef","object","ComputedRefImpl","_setter","_value","getterOrOptions","callWithErrorHandling","handleError","callWithAsyncErrorHandling","throwInDev","contextVNode","vnode","cur","exposedInstance","errorInfo","errorCapturedHooks","ec","appErrorHandler","appContext","errorHandler","isFlushing","isFlushPending","flushIndex","pendingPreFlushCbs","activePreFlushCbs","preFlushIndex","pendingPostFlushCbs","activePostFlushCbs","postFlushIndex","resolvedPromise","currentFlushPromise","currentPreFlushParentJob","findInsertionIndex","job","jobId","middleJobId","queueJob","queueFlush","flushJobs","invalidateJob","queueCb","activeQueue","pendingQueue","queuePreFlushCb","queuePostFlushCb","flushPreFlushCbs","seen","parentJob","flushPostFlushCbs","deduped","rawArgs","isModelListener","modelArg","modifiersKey","handlerName","onceHandler","emitted","normalizeEmitsOptions","comp","asMixin","deopt","__emits","emits","hasExtends","extendEmits","normalizedFromExtend","mixins","extends","isEmitListener","isRenderingCompiledSlot","setCompiledSlotRendering","renderSlot","slots","fallback","noSlotted","slot","openBlock","validSlotContent","ensureValidVNode","rendered","createBlock","Fragment","_","scopeId","slotScopeIds","vnodes","some","isVNode","Comment","currentRenderingInstance","currentScopeId","setCurrentRenderingInstance","__scopeId","pushScopeId","popScopeId","withScopeId","withCtx","renderFnWithContext","prevInstance","closeBlock","renderComponentRoot","withProxy","propsOptions","attrs","renderCache","setupState","fallthroughAttrs","shapeFlag","proxyToUse","normalizeVNode","getFunctionalFallthrough","inheritAttrs","filterModelListeners","cloneVNode","dirs","blockStack","createVNode","filterSingleRoot","singleRoot","shouldUpdateComponent","prevVNode","nextVNode","optimized","prevProps","prevChildren","nextProps","nextChildren","patchFlag","emitsOptions","$stable","hasPropsChanged","dynamicProps","nextKeys","updateHOCHostEl","subTree","isSuspense","__isSuspense","normalizeSuspenseChildren","normalizeSuspenseSlot","default","singleChild","queueEffectWithSuspense","suspense","pendingBranch","rawProps","isStateful","isSSR","InternalObjectKey","propsDefaults","setFullProps","rawPrevProps","rawCurrentProps","kebabKey","resolvePropValue","propsToUpdate","camelizedKey","needCastKeys","camelKey","hasDefault","setCurrentInstance","normalizePropsOptions","__props","extendProps","normalizedKey","validatePropName","booleanIndex","getTypeIndex","stringIndex","String","isSameType","expectedTypes","findIndex","injectHook","hook","currentInstance","hooks","wrappedHook","__weh","isUnmounted","createHook","lifecycle","isInSSRComponentSetup","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onRenderTriggered","onRenderTracked","onErrorCaptured","INITIAL_WATCHER_VALUE","doWatch","immediate","onTrack","onTrigger","cleanup","forceTrigger","_shallow","onInvalidate","baseGetter","runner","queuePostRenderEffect","isMounted","recordInstanceBoundEffect","instanceWatch","publicThis","useTransitionState","isLeaving","isUnmounting","leavingVNodes","TransitionHookValidator","BaseTransitionImpl","appear","persisted","onBeforeEnter","onEnter","onAfterEnter","onEnterCancelled","onBeforeLeave","onAfterLeave","onLeaveCancelled","onBeforeAppear","onAppear","onAfterAppear","onAppearCancelled","getCurrentInstance","prevTransitionKey","getTransitionRawChildren","emptyPlaceholder","innerChild","getKeepAliveChild","enterHooks","resolveTransitionHooks","setTransitionHooks","oldChild","oldInnerChild","transitionKeyChanged","getTransitionKey","isSameVNodeType","leavingHooks","afterLeave","delayLeave","earlyRemove","delayedLeave","leavingVNodesCache","getLeavingNodesForType","_leaveCb","BaseTransition","callHook","leavingVNode","afterHook","cancelHook","called","_enterCb","cancelled","isKeepAlive","ssContent","ssFallback","keepComment","keyedFragmentCount","__isKeepAlive","matches","onActivated","registerKeepAliveHook","onDeactivated","__wdc","isDeactivated","injectToKeepAliveRoot","keepAliveRoot","injected","resetShapeFlag","getInnerChild","isInternalKey","normalizeSlotValue","normalizeSlot","rawSlot","normalizeObjectSlots","rawSlots","normalizeVNodeSlots","initSlots","updateSlots","needDeletionCheck","deletionComparisonTarget","invokeDirectiveHook","bindings","oldBindings","createAppContext","isNativeTag","performance","optionMergeStrategies","isCustomElement","warnHandler","directives","provides","createAppAPI","hydrate","rootComponent","rootProps","installedPlugins","_component","_props","_context","directive","rootContainer","isHydrate","__vue_app__","initFeatureFlags","isAsyncWrapper","__asyncLoader","prodEffectOptions","setRef","rawRef","oldRawRef","parentSuspense","exposed","owner","oldRef","refs","doSet","createRenderer","baseCreateRenderer","createHydrationFns","hostInsert","hostRemove","patchProp","hostPatchProp","forcePatchProp","hostForcePatchProp","hostCreateElement","createText","hostCreateText","createComment","hostCreateComment","setText","hostSetText","setElementText","hostSetElementText","hostParentNode","hostNextSibling","setScopeId","hostSetScopeId","cloneNode","hostCloneNode","insertStaticContent","hostInsertStaticContent","patch","parentComponent","getNextHostNode","dynamicChildren","Text","processText","processCommentNode","Static","mountStaticNode","processFragment","processElement","processComponent","internals","moveStaticNode","removeStaticNode","mountElement","patchElement","vnodeHook","mountChildren","unmountChildren","onVnodeBeforeMount","invokeVNodeHook","needCallTransitionHooks","beforeEnter","onVnodeMounted","enter","parentVNode","cloneIfMounted","oldProps","onVnodeBeforeUpdate","patchProps","class","areChildrenSVG","patchBlockChildren","patchChildren","onVnodeUpdated","fallbackContainer","oldVNode","newVNode","fragmentStartAnchor","fragmentEndAnchor","fragmentSlotScopeIds","traverseStaticChildren","activate","mountComponent","updateComponent","initialVNode","createComponentInstance","setupComponent","asyncDep","registerDep","setupRenderEffect","asyncResolved","updateComponentPreRender","bu","originNext","nextTree","prevTree","bm","hydrateNode","scopedInitialVNode","prevShapeFlag","patchKeyedChildren","patchUnkeyedChildren","oldLength","newLength","commonLength","parentAnchor","l2","e1","e2","nextPos","keyToNewIndexMap","patched","toBePatched","moved","maxNewIndexSoFar","newIndexToOldIndexMap","prevChild","increasingNewIndexSequence","getSequence","move","moveType","needTransition","leave","performLeave","deactivate","shouldInvokeDirs","onVnodeBeforeUnmount","unmountComponent","onVnodeUnmounted","removeFragment","performRemove","bum","um","suspenseId","pendingId","_vnode","mc","pc","pbc","createApp","ch1","ch2","arrI","isTeleport","__isTeleport","COMPONENTS","resolveComponent","maybeSelfReference","resolveAsset","NULL_DYNAMIC_COMPONENT","resolveDynamicComponent","warnMissing","selfName","getComponentName","registry","currentBlock","disableTracking","__v_isVNode","normalizeKey","normalizeRef","_createVNode","isBlockNode","normalizeChildren","isClassComponent","__vccOpts","klass","targetAnchor","staticCount","extraProps","mergeRef","mergedProps","mergeProps","createTextVNode","createCommentVNode","asBlock","slotFlag","toMerge","incoming","parentProvides","inject","treatDefaultAsFactory","shouldCacheAccess","applyOptions","deferredData","deferredWatch","deferredProvide","extendsOptions","dataOptions","computed","computedOptions","watchOptions","provideOptions","injectOptions","beforeMount","updated","activated","deactivated","beforeDestroy","beforeUnmount","destroyed","unmounted","renderTracked","renderTriggered","errorCaptured","expose","globalMixins","callSyncHook","applyMixins","methodHandler","dataFn","resolveData","createWatcher","callHookWithMixinAndExtends","selfHook","createPathGetter","segments","resolveMergedOptions","__merged","mergeOptions","strats","getPublicInstance","isStatefulComponent","publicPropertiesMap","$","$el","$data","$props","$attrs","$slots","$refs","$parent","$root","$emit","$options","$forceUpdate","$nextTick","$watch","PublicInstanceProxyHandlers","accessCache","normalizedProps","publicGetter","cssModule","__cssModules","RuntimeCompiledPublicInstanceProxyHandlers","unscopables","emptyAppContext","uid$1","setupContext","bc","da","rtg","rtc","compile","setupResult","setupStatefulComponent","setup","createSetupContext","resolvedResult","handleSetupResult","finishComponentSetup","delimiters","_rc","propsOrChildren","svgNS","tempContainer","tempSVGContainer","nodeOps","createTextNode","querySelector","patchClass","transitionClasses","_vtc","patchStyle","removeAttribute","importantRE","setProperty","prefixed","autoPrefix","prefixes","prefixCache","rawName","xlinkNS","patchAttr","removeAttributeNS","isBoolean","patchDOMProp","_getNow","skipTimestampCheck","createEvent","timeStamp","ffMatch","cachedNow","getNow","patchEvent","nextValue","invokers","_vei","existingInvoker","parseName","invoker","createInvoker","optionsModifierRE","attached","patchStopImmediatePropagation","originalStop","_stopped","nativeOnRE","shouldSetAsProp","_trueValue","_falseValue","TRANSITION","ANIMATION","Transition","resolveTransitionProps","DOMTransitionPropsValidators","css","enterFromClass","enterActiveClass","enterToClass","appearFromClass","appearActiveClass","appearToClass","leaveFromClass","leaveActiveClass","leaveToClass","baseProps","durations","normalizeDuration","enterDuration","leaveDuration","finishEnter","isAppear","removeTransitionClass","finishLeave","makeEnterHook","addTransitionClass","whenTransitionEnds","forceReflow","NumberOf","cls","classList","endId","expectedType","explicitTimeout","_endId","resolveIfNotStale","propCount","getTransitionInfo","endEvent","ended","onEnd","getStyleProperties","transitionDelays","transitionDurations","transitionTimeout","getTimeout","animationDelays","animationDurations","animationTimeout","hasTransform","delays","toMs","offsetHeight","rendererOptions","ensureRenderer","containerOrSelector","normalizeContainer","Cancel","expires","secure","cookie","toGMTString","read","isAbsoluteURL","combineURLs","baseURL","requestedURL","CancelToken","executor","resolvePromise","cancel","expectsLowerCase","GLOBALS_WHITE_LISTED","isGloballyWhitelisted","specialBooleanAttrs","isSpecialBooleanAttr","parseStringStyle","listDelimiterRE","propertyDelimiterRE","normalizeClass","HTML_TAGS","SVG_TAGS","isHTMLTag","isSVGTag","looseCompareArrays","looseEqual","aValidType","bValidType","aKeysCount","bKeysCount","aHasKey","bHasKey","looseIndexOf","toDisplayString","replacer","isMap","entries","EMPTY_ARR","NOOP","NO","onRE","isOn","toTypeString","isSymbol","objectToString","toRawType","isIntegerKey","isReservedProp","cacheStringFunction","hit","camelizeRE","camelize","hyphenateRE","hyphenate","capitalize","toHandlerKey","hasChanged","invokeArrayFns","fns","toNumber","settle","cookies","buildFullPath","parseHeaders","isURLSameOrigin","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","onreadystatechange","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onabort","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","setRequestHeader","onDownloadProgress","onUploadProgress","upload","abort","send","ignoreDuplicateOf","FormData","ArrayBuffer","isView","URLSearchParams","product","assignValue","stripBOM","normalizedName","createInstance","defaultConfig","axios","promises","spread","normalizeArray","allowAboveRoot","up","basename","matchedSlash","xs","resolvedPath","resolvedAbsolute","isAbsolute","trailingSlash","relative","fromParts","toParts","samePartsLength","outputParts","sep","delimiter","dirname","hasRoot","extname","startDot","startPart","preDotState","relativeURL","eject"],"mappings":"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AAOiE,EAAI8c,OAAO2G,EAAO1nB,IACtD,SAAUiE,EAAKyjB,EAAO1nB,GAEpB,OADI0nB,EAAQ,IAAGA,EAAQzjB,EAAIhO,OAASyxB,GAC7BzjB,EAAI8c,OAAO2G,EAAO1nB,M,wDClSjCvJ,EAAOC,QAAU,SAAqBm7W,EAAS8H,GAC7C,OAAOA,EACH9H,EAAQt7W,QAAQ,OAAQ,IAAM,IAAMojX,EAAYpjX,QAAQ,OAAQ,IAChEs7W,I,kCCVN,IAAIz9W,EAAQ,EAAQ,QAEpB,SAASE,IACPK,KAAK+qP,SAAW,GAWlBprP,EAAmBU,UAAU4sJ,IAAM,SAAa9rJ,EAAWC,GAKzD,OAJApB,KAAK+qP,SAAS1pP,KAAK,CACjBF,UAAWA,EACXC,SAAUA,IAELpB,KAAK+qP,SAASzpP,OAAS,GAQhC3B,EAAmBU,UAAU4kX,MAAQ,SAAehpV,GAC9Cj8B,KAAK+qP,SAAS9uN,KAChBj8B,KAAK+qP,SAAS9uN,GAAM,OAYxBt8B,EAAmBU,UAAUW,QAAU,SAAiBmB,GACtD1C,EAAMuB,QAAQhB,KAAK+qP,UAAU,SAAwBj3O,GACzC,OAANA,GACF3R,EAAG2R,OAKThS,EAAOC,QAAUpC","file":"js/chunk-vendors.c10bd1dd.js","sourcesContent":["'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","var Browser = (function () {\n function Browser() {\n this.firefox = false;\n this.ie = false;\n this.edge = false;\n this.newEdge = false;\n this.weChat = false;\n }\n return Browser;\n}());\nvar Env = (function () {\n function Env() {\n this.browser = new Browser();\n this.node = false;\n this.wxa = false;\n this.worker = false;\n this.canvasSupported = false;\n this.svgSupported = false;\n this.touchEventsSupported = false;\n this.pointerEventsSupported = false;\n this.domSupported = false;\n this.transformSupported = false;\n this.transform3dSupported = false;\n }\n return Env;\n}());\nvar env = new Env();\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n env.wxa = true;\n env.canvasSupported = true;\n env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n env.worker = true;\n env.canvasSupported = true;\n}\nelse if (typeof navigator === 'undefined') {\n env.node = true;\n env.canvasSupported = true;\n env.svgSupported = true;\n}\nelse {\n detect(navigator.userAgent, env);\n}\nfunction detect(ua, env) {\n var browser = env.browser;\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge?\\/([\\d.]+)/);\n var weChat = (/micromessenger/i).test(ua);\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n browser.newEdge = +edge[1].split('.')[0] > 18;\n }\n if (weChat) {\n browser.weChat = true;\n }\n env.canvasSupported = !!document.createElement('canvas').getContext;\n env.svgSupported = typeof SVGRect !== 'undefined';\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n env.pointerEventsSupported = 'onpointerdown' in window\n && (browser.edge || (browser.ie && +browser.version >= 11));\n env.domSupported = typeof document !== 'undefined';\n var style = document.documentElement.style;\n env.transform3dSupported = ((browser.ie && 'transition' in style)\n || browser.edge\n || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n || 'MozPerspective' in style)\n && !('OTransition' in style);\n env.transformSupported = env.transform3dSupported\n || (browser.ie && +browser.version >= 9);\n}\nexport default env;\n","var BUILTIN_OBJECT = {\n '[object Function]': true,\n '[object RegExp]': true,\n '[object Date]': true,\n '[object Error]': true,\n '[object CanvasGradient]': true,\n '[object CanvasPattern]': true,\n '[object Image]': true,\n '[object Canvas]': true\n};\nvar TYPED_ARRAY = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true\n};\nvar objToString = Object.prototype.toString;\nvar arrayProto = Array.prototype;\nvar nativeForEach = arrayProto.forEach;\nvar nativeFilter = arrayProto.filter;\nvar nativeSlice = arrayProto.slice;\nvar nativeMap = arrayProto.map;\nvar ctorFunction = function () { }.constructor;\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\nvar methods = {};\nexport function $override(name, fn) {\n methods[name] = fn;\n}\nvar idStart = 0x0907;\nexport function guid() {\n return idStart++;\n}\nexport function logError() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (typeof console !== 'undefined') {\n console.error.apply(console, args);\n }\n}\nexport function clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n var result = source;\n var typeStr = objToString.call(source);\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n if (Ctor.from) {\n result = Ctor.from(source);\n }\n else {\n result = new Ctor(source.length);\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n }\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n result[key] = clone(source[key]);\n }\n }\n }\n return result;\n}\nexport function merge(target, source, overwrite) {\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var targetProp = target[key];\n var sourceProp = source[key];\n if (isObject(sourceProp)\n && isObject(targetProp)\n && !isArray(sourceProp)\n && !isArray(targetProp)\n && !isDom(sourceProp)\n && !isDom(targetProp)\n && !isBuiltInObject(sourceProp)\n && !isBuiltInObject(targetProp)\n && !isPrimitive(sourceProp)\n && !isPrimitive(targetProp)) {\n merge(targetProp, sourceProp, overwrite);\n }\n else if (overwrite || !(key in target)) {\n target[key] = clone(source[key]);\n }\n }\n }\n return target;\n}\nexport function mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n return result;\n}\nexport function extend(target, source) {\n if (Object.assign) {\n Object.assign(target, source);\n }\n else {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\nexport function defaults(target, source, overlay) {\n var keysArr = keys(source);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if ((overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport var createCanvas = function () {\n return methods.createCanvas();\n};\nmethods.createCanvas = function () {\n return document.createElement('canvas');\n};\nexport function indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n return -1;\n}\nexport function inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n function F() { }\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n for (var prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\nexport function mixin(target, source, override) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n if (Object.getOwnPropertyNames) {\n var keyList = Object.getOwnPropertyNames(source);\n for (var i = 0; i < keyList.length; i++) {\n var key = keyList[i];\n if (key !== 'constructor') {\n if ((override ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n }\n }\n else {\n defaults(target, source, override);\n }\n}\nexport function isArrayLike(data) {\n if (!data) {\n return false;\n }\n if (typeof data === 'string') {\n return false;\n }\n return typeof data.length === 'number';\n}\nexport function each(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n if (arr.forEach && arr.forEach === nativeForEach) {\n arr.forEach(cb, context);\n }\n else if (arr.length === +arr.length) {\n for (var i = 0, len = arr.length; i < len; i++) {\n cb.call(context, arr[i], i, arr);\n }\n }\n else {\n for (var key in arr) {\n if (arr.hasOwnProperty(key)) {\n cb.call(context, arr[key], key, arr);\n }\n }\n }\n}\nexport function map(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.map && arr.map === nativeMap) {\n return arr.map(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n result.push(cb.call(context, arr[i], i, arr));\n }\n return result;\n }\n}\nexport function reduce(arr, cb, memo, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n memo = cb.call(context, memo, arr[i], i, arr);\n }\n return memo;\n}\nexport function filter(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.filter && arr.filter === nativeFilter) {\n return arr.filter(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n}\nexport function find(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n return arr[i];\n }\n }\n}\nexport function keys(obj) {\n if (!obj) {\n return [];\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keyList = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyList.push(key);\n }\n }\n return keyList;\n}\nfunction bindPolyfill(func, context) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport var bind = (protoFunction && isFunction(protoFunction.bind))\n ? protoFunction.call.bind(protoFunction.bind)\n : bindPolyfill;\nfunction curry(func) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport { curry };\nexport function isArray(value) {\n if (Array.isArray) {\n return Array.isArray(value);\n }\n return objToString.call(value) === '[object Array]';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isString(value) {\n return typeof value === 'string';\n}\nexport function isStringSafe(value) {\n return objToString.call(value) === '[object String]';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isObject(value) {\n var type = typeof value;\n return type === 'function' || (!!value && type === 'object');\n}\nexport function isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\nexport function isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\nexport function isDom(value) {\n return typeof value === 'object'\n && typeof value.nodeType === 'number'\n && typeof value.ownerDocument === 'object';\n}\nexport function isGradientObject(value) {\n return value.colorStops != null;\n}\nexport function isPatternObject(value) {\n return value.image != null;\n}\nexport function isRegExp(value) {\n return objToString.call(value) === '[object RegExp]';\n}\nexport function eqNaN(value) {\n return value !== value;\n}\nexport function retrieve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0, len = args.length; i < len; i++) {\n if (args[i] != null) {\n return args[i];\n }\n }\n}\nexport function retrieve2(value0, value1) {\n return value0 != null\n ? value0\n : value1;\n}\nexport function retrieve3(value0, value1, value2) {\n return value0 != null\n ? value0\n : value1 != null\n ? value1\n : value2;\n}\nexport function slice(arr) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return nativeSlice.apply(arr, args);\n}\nexport function normalizeCssArray(val) {\n if (typeof (val) === 'number') {\n return [val, val, val, val];\n }\n var len = val.length;\n if (len === 2) {\n return [val[0], val[1], val[0], val[1]];\n }\n else if (len === 3) {\n return [val[0], val[1], val[2], val[1]];\n }\n return val;\n}\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\nexport function trim(str) {\n if (str == null) {\n return null;\n }\n else if (typeof str.trim === 'function') {\n return str.trim();\n }\n else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\nvar primitiveKey = '__ec_primitive__';\nexport function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\nexport function isPrimitive(obj) {\n return obj[primitiveKey];\n}\nvar HashMap = (function () {\n function HashMap(obj) {\n this.data = {};\n var isArr = isArray(obj);\n this.data = {};\n var thisMap = this;\n (obj instanceof HashMap)\n ? obj.each(visit)\n : (obj && each(obj, visit));\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n }\n HashMap.prototype.get = function (key) {\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\n };\n HashMap.prototype.set = function (key, value) {\n return (this.data[key] = value);\n };\n HashMap.prototype.each = function (cb, context) {\n for (var key in this.data) {\n if (this.data.hasOwnProperty(key)) {\n cb.call(context, this.data[key], key);\n }\n }\n };\n HashMap.prototype.keys = function () {\n return keys(this.data);\n };\n HashMap.prototype.removeKey = function (key) {\n delete this.data[key];\n };\n return HashMap;\n}());\nexport { HashMap };\nexport function createHashMap(obj) {\n return new HashMap(obj);\n}\nexport function concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n var offset = a.length;\n for (var i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n return newArray;\n}\nexport function createObject(proto, properties) {\n var obj;\n if (Object.create) {\n obj = Object.create(proto);\n }\n else {\n var StyleCtor = function () { };\n StyleCtor.prototype = proto;\n obj = new StyleCtor();\n }\n if (properties) {\n extend(obj, properties);\n }\n return obj;\n}\nexport function hasOwn(own, prop) {\n return own.hasOwnProperty(prop);\n}\nexport function noop() { }\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export function create(x, y) {\n if (x == null) {\n x = 0;\n }\n if (y == null) {\n y = 0;\n }\n return [x, y];\n}\nexport function copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\nexport function clone(v) {\n return [v[0], v[1]];\n}\nexport function set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\nexport function add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\nexport function scaleAndAdd(out, v1, v2, a) {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\nexport function sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\nexport function len(v) {\n return Math.sqrt(lenSquare(v));\n}\nexport var length = len;\nexport function lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\nexport var lengthSquare = lenSquare;\nexport function mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\nexport function div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\nexport function dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\nexport function scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\nexport function normalize(out, v) {\n var d = len(v);\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n }\n else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n return out;\n}\nexport function distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\nexport var dist = distance;\nexport function distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport var distSquare = distanceSquare;\nexport function negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\nexport function lerp(out, v1, v2, t) {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\nexport function applyTransform(out, v, m) {\n var x = v[0];\n var y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\nexport function min(out, v1, v2) {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\nexport function max(out, v1, v2) {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n","var Param = (function () {\n function Param(target, e) {\n this.target = target;\n this.topTarget = e && e.topTarget;\n }\n return Param;\n}());\nvar Draggable = (function () {\n function Draggable(handler) {\n this.handler = handler;\n handler.on('mousedown', this._dragStart, this);\n handler.on('mousemove', this._drag, this);\n handler.on('mouseup', this._dragEnd, this);\n }\n Draggable.prototype._dragStart = function (e) {\n var draggingTarget = e.target;\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent;\n }\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\n }\n };\n Draggable.prototype._drag = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\n }\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n };\n Draggable.prototype._dragEnd = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n if (this._dropTarget) {\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n }\n this._draggingTarget = null;\n this._dropTarget = null;\n };\n return Draggable;\n}());\nexport default Draggable;\n","var Eventful = (function () {\n function Eventful(eventProcessors) {\n if (eventProcessors) {\n this._$eventProcessor = eventProcessors;\n }\n }\n Eventful.prototype.on = function (event, query, handler, context) {\n if (!this._$handlers) {\n this._$handlers = {};\n }\n var _h = this._$handlers;\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n if (!handler || !event) {\n return this;\n }\n var eventProcessor = this._$eventProcessor;\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n if (!_h[event]) {\n _h[event] = [];\n }\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return this;\n }\n }\n var wrap = {\n h: handler,\n query: query,\n ctx: (context || this),\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n (lastWrap && lastWrap.callAtLast)\n ? _h[event].splice(lastIndex, 0, wrap)\n : _h[event].push(wrap);\n return this;\n };\n Eventful.prototype.isSilent = function (eventName) {\n var _h = this._$handlers;\n return !_h || !_h[eventName] || !_h[eventName].length;\n };\n Eventful.prototype.off = function (eventType, handler) {\n var _h = this._$handlers;\n if (!_h) {\n return this;\n }\n if (!eventType) {\n this._$handlers = {};\n return this;\n }\n if (handler) {\n if (_h[eventType]) {\n var newList = [];\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\n if (_h[eventType][i].h !== handler) {\n newList.push(_h[eventType][i]);\n }\n }\n _h[eventType] = newList;\n }\n if (_h[eventType] && _h[eventType].length === 0) {\n delete _h[eventType];\n }\n }\n else {\n delete _h[eventType];\n }\n return this;\n };\n Eventful.prototype.trigger = function (eventType) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[eventType];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(eventType, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(hItem.ctx);\n break;\n case 1:\n hItem.h.call(hItem.ctx, args[0]);\n break;\n case 2:\n hItem.h.call(hItem.ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(eventType);\n return this;\n };\n Eventful.prototype.triggerWithContext = function (type) {\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n var ctx = args[argLen - 1];\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(type, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(ctx);\n break;\n case 1:\n hItem.h.call(ctx, args[0]);\n break;\n case 2:\n hItem.h.call(ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(type);\n return this;\n };\n return Eventful;\n}());\nexport default Eventful;\n","var LN2 = Math.log(2);\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n var cacheKey = rowMask + '-' + colMask;\n var fullRank = rows.length;\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n if (rank === 1) {\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n var subRowMask = rowMask | (1 << rowStart);\n var subRowStart = rowStart + 1;\n while (rowMask & (1 << subRowStart)) {\n subRowStart++;\n }\n var sum = 0;\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n var colTag = 1 << j;\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n detCache[cacheKey] = sum;\n return sum;\n}\nexport function buildTransformer(src, dest) {\n var mA = [\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n ];\n var detCache = {};\n var det = determinant(mA, 8, 0, 0, 0, detCache);\n if (det === 0) {\n return;\n }\n var vh = [];\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1)\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n / det * dest[i];\n }\n }\n return function (out, srcPointX, srcPointY) {\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n","import env from './env';\nimport { buildTransformer } from './fourPointsTransform';\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\nexport function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\nexport function transformCoordWithViewport(out, el, inX, inY, inverse) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n var markers = prepareCoordMarkers(el, saved);\n var transformer = preparePointerTransformer(markers, saved, inverse);\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n return false;\n}\nfunction prepareCoordMarkers(el, saved) {\n var markers = saved.markers;\n if (markers) {\n return markers;\n }\n markers = saved.markers = [];\n var propLR = ['left', 'right'];\n var propTB = ['top', 'bottom'];\n for (var i = 0; i < 4; i++) {\n var marker = document.createElement('div');\n var stl = marker.style;\n var idxLR = i % 2;\n var idxTB = (i >> 1) % 2;\n stl.cssText = [\n 'position: absolute',\n 'visibility: hidden',\n 'padding: 0',\n 'margin: 0',\n 'border-width: 0',\n 'user-select: none',\n 'width:0',\n 'height:0',\n propLR[idxLR] + ':0',\n propTB[idxTB] + ':0',\n propLR[1 - idxLR] + ':auto',\n propTB[1 - idxTB] + ':auto',\n ''\n ].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n return markers;\n}\nfunction preparePointerTransformer(markers, saved, inverse) {\n var transformerName = inverse ? 'invTrans' : 'trans';\n var transformer = saved[transformerName];\n var oldSrcCoords = saved.srcCoords;\n var srcCoords = [];\n var destCoords = [];\n var oldCoordTheSame = true;\n for (var i = 0; i < 4; i++) {\n var rect = markers[i].getBoundingClientRect();\n var ii = 2 * i;\n var x = rect.left;\n var y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n }\n return (oldCoordTheSame && transformer)\n ? transformer\n : (saved.srcCoords = srcCoords,\n saved[transformerName] = inverse\n ? buildTransformer(destCoords, srcCoords)\n : buildTransformer(srcCoords, destCoords));\n}\nexport function isCanvasEl(el) {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\n","import Eventful from './Eventful';\nimport env from './env';\nimport { isCanvasEl, transformCoordWithViewport } from './dom';\nvar isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\nexport function clientToLocal(el, e, out, calculate) {\n out = out || {};\n if (calculate || !env.canvasSupported) {\n calculateZrXY(el, e, out);\n }\n else if (env.browser.firefox\n && e.layerX != null\n && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n }\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n }\n else {\n calculateZrXY(el, e, out);\n }\n return out;\n}\nfunction calculateZrXY(el, e, out) {\n if (env.domSupported && el.getBoundingClientRect) {\n var ex = e.clientX;\n var ey = e.clientY;\n if (isCanvasEl(el)) {\n var box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n }\n else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n out.zrX = out.zrY = 0;\n}\nexport function getNativeEvent(e) {\n return e\n || window.event;\n}\nexport function normalizeEvent(el, e, calculate) {\n e = getNativeEvent(e);\n if (e.zrX != null) {\n return e;\n }\n var eventType = e.type;\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n var wheelDelta = getWheelDeltaMayPolyfill(e);\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n }\n else {\n var touch = eventType !== 'touchend'\n ? e.targetTouches[0]\n : e.changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n }\n var button = e.button;\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n }\n return e;\n}\nfunction getWheelDeltaMayPolyfill(e) {\n var rawWheelDelta = e.wheelDelta;\n if (rawWheelDelta) {\n return rawWheelDelta;\n }\n var deltaX = e.deltaX;\n var deltaY = e.deltaY;\n if (deltaX == null || deltaY == null) {\n return rawWheelDelta;\n }\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n var sign = deltaY > 0 ? -1\n : deltaY < 0 ? 1\n : deltaX > 0 ? -1\n : 1;\n return 3 * delta * sign;\n}\nexport function addEventListener(el, name, handler, opt) {\n if (isDomLevel2) {\n el.addEventListener(name, handler, opt);\n }\n else {\n el.attachEvent('on' + name, handler);\n }\n}\nexport function removeEventListener(el, name, handler, opt) {\n if (isDomLevel2) {\n el.removeEventListener(name, handler, opt);\n }\n else {\n el.detachEvent('on' + name, handler);\n }\n}\nexport var stop = isDomLevel2\n ? function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n }\n : function (e) {\n e.returnValue = false;\n e.cancelBubble = true;\n };\nexport function isMiddleOrRightButtonOnMouseUpDown(e) {\n return e.which === 2 || e.which === 3;\n}\nexport function notLeftMouse(e) {\n return e.which > 1;\n}\nexport { Eventful as Dispatcher };\n","import * as eventUtil from './event';\nvar GestureMgr = (function () {\n function GestureMgr() {\n this._track = [];\n }\n GestureMgr.prototype.recognize = function (event, target, root) {\n this._doTrack(event, target, root);\n return this._recognize(event);\n };\n GestureMgr.prototype.clear = function () {\n this._track.length = 0;\n return this;\n };\n GestureMgr.prototype._doTrack = function (event, target, root) {\n var touches = event.touches;\n if (!touches) {\n return;\n }\n var trackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n for (var i = 0, len = touches.length; i < len; i++) {\n var touch = touches[i];\n var pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n this._track.push(trackItem);\n };\n GestureMgr.prototype._recognize = function (event) {\n for (var eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n var gestureInfo = recognizers[eventName](this._track, event);\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n };\n return GestureMgr;\n}());\nexport { GestureMgr };\nfunction dist(pointPair) {\n var dx = pointPair[1][0] - pointPair[0][0];\n var dy = pointPair[1][1] - pointPair[0][1];\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction center(pointPair) {\n return [\n (pointPair[0][0] + pointPair[1][0]) / 2,\n (pointPair[0][1] + pointPair[1][1]) / 2\n ];\n}\nvar recognizers = {\n pinch: function (tracks, event) {\n var trackLen = tracks.length;\n if (!trackLen) {\n return;\n }\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n if (pinchPre\n && pinchPre.length > 1\n && pinchEnd\n && pinchEnd.length > 1) {\n var pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n event.pinchScale = pinchScale;\n var pinchCenter = center(pinchEnd);\n event.pinchX = pinchCenter[0];\n event.pinchY = pinchCenter[1];\n return {\n type: 'pinch',\n target: tracks[0].target,\n event: event\n };\n }\n }\n};\n","import { __extends } from \"tslib\";\nimport * as util from './core/util';\nimport * as vec2 from './core/vector';\nimport Draggable from './mixin/Draggable';\nimport Eventful from './core/Eventful';\nimport * as eventTool from './core/event';\nimport { GestureMgr } from './core/GestureMgr';\nvar SILENT = 'silent';\nfunction makeEventPacket(eveType, targetInfo, event) {\n return {\n type: eveType,\n event: event,\n target: targetInfo.target,\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: event.gestureEvent,\n pinchX: event.pinchX,\n pinchY: event.pinchY,\n pinchScale: event.pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\nfunction stopEvent() {\n eventTool.stop(this.event);\n}\nvar EmptyProxy = (function (_super) {\n __extends(EmptyProxy, _super);\n function EmptyProxy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handler = null;\n return _this;\n }\n EmptyProxy.prototype.dispose = function () { };\n EmptyProxy.prototype.setCursor = function () { };\n return EmptyProxy;\n}(Eventful));\nvar HoveredResult = (function () {\n function HoveredResult(x, y) {\n this.x = x;\n this.y = y;\n }\n return HoveredResult;\n}());\nvar handlerNames = [\n 'click', 'dblclick', 'mousewheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\nvar Handler = (function (_super) {\n __extends(Handler, _super);\n function Handler(storage, painter, proxy, painterRoot) {\n var _this = _super.call(this) || this;\n _this._hovered = new HoveredResult(0, 0);\n _this.storage = storage;\n _this.painter = painter;\n _this.painterRoot = painterRoot;\n proxy = proxy || new EmptyProxy();\n _this.proxy = null;\n _this.setHandlerProxy(proxy);\n _this._draggingMgr = new Draggable(_this);\n return _this;\n }\n Handler.prototype.setHandlerProxy = function (proxy) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name], this);\n }, this);\n proxy.handler = this;\n }\n this.proxy = proxy;\n };\n Handler.prototype.mousemove = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var lastHovered = this._hovered;\n var lastHoveredTarget = lastHovered.target;\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n var hoveredTarget = hovered.target;\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n }\n this.dispatchToElement(hovered, 'mousemove', event);\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n };\n Handler.prototype.mouseout = function (event) {\n var eventControl = event.zrEventControl;\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n if (eventControl !== 'no_globalout') {\n this.trigger('globalout', { type: 'globalout', event: event });\n }\n };\n Handler.prototype.resize = function () {\n this._hovered = new HoveredResult(0, 0);\n };\n Handler.prototype.dispatch = function (eventName, eventArgs) {\n var handler = this[eventName];\n handler && handler.call(this, eventArgs);\n };\n Handler.prototype.dispose = function () {\n this.proxy.dispose();\n this.storage = null;\n this.proxy = null;\n this.painter = null;\n };\n Handler.prototype.setCursorStyle = function (cursorStyle) {\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n };\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\n targetInfo = targetInfo || {};\n var el = targetInfo.target;\n if (el && el.silent) {\n return;\n }\n var eventKey = ('on' + eventName);\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\n while (el) {\n el[eventKey]\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n el.trigger(eventName, eventPacket);\n el = el.__hostTarget ? el.__hostTarget : el.parent;\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n if (!eventPacket.cancelBubble) {\n this.trigger(eventName, eventPacket);\n if (this.painter && this.painter.eachOtherLayer) {\n this.painter.eachOtherLayer(function (layer) {\n if (typeof (layer[eventKey]) === 'function') {\n layer[eventKey].call(layer, eventPacket);\n }\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n }\n };\n Handler.prototype.findHover = function (x, y, exclude) {\n var list = this.storage.getDisplayList();\n var out = new HoveredResult(x, y);\n for (var i = list.length - 1; i >= 0; i--) {\n var hoverCheckResult = void 0;\n if (list[i] !== exclude\n && !list[i].ignore\n && (hoverCheckResult = isHover(list[i], x, y))) {\n !out.topTarget && (out.topTarget = list[i]);\n if (hoverCheckResult !== SILENT) {\n out.target = list[i];\n break;\n }\n }\n }\n return out;\n };\n Handler.prototype.processGesture = function (event, stage) {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n var gestureMgr = this._gestureMgr;\n stage === 'start' && gestureMgr.clear();\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n stage === 'end' && gestureMgr.clear();\n if (gestureInfo) {\n var type = gestureInfo.type;\n event.gestureEvent = type;\n var res = new HoveredResult();\n res.target = gestureInfo.target;\n this.dispatchToElement(res, type, gestureInfo.event);\n }\n };\n return Handler;\n}(Eventful));\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n Handler.prototype[name] = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var hovered;\n var hoveredTarget;\n if (name !== 'mouseup' || !isOutside) {\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY];\n this._upEl = hoveredTarget;\n }\n else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n }\n else if (name === 'click') {\n if (this._downEl !== this._upEl\n || !this._downPoint\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n return;\n }\n this._downPoint = null;\n }\n this.dispatchToElement(hovered, name, event);\n };\n});\nfunction isHover(displayable, x, y) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n var el = displayable;\n var isSilent = void 0;\n var ignoreClip = false;\n while (el) {\n if (el.ignoreClip) {\n ignoreClip = true;\n }\n if (!ignoreClip) {\n var clipPath = el.getClipPath();\n if (clipPath && !clipPath.contain(x, y)) {\n return false;\n }\n if (el.silent) {\n isSilent = true;\n }\n }\n var hostEl = el.__hostTarget;\n el = hostEl ? hostEl : el.parent;\n }\n return isSilent ? SILENT : true;\n }\n return false;\n}\nfunction isOutsideBoundary(handlerInstance, x, y) {\n var painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\nexport default Handler;\n","export function create() {\n return [1, 0, 0, 1, 0, 0];\n}\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\nexport function copy(out, m) {\n out[0] = m[0];\n out[1] = m[1];\n out[2] = m[2];\n out[3] = m[3];\n out[4] = m[4];\n out[5] = m[5];\n return out;\n}\nexport function mul(out, m1, m2) {\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = out3;\n out[4] = out4;\n out[5] = out5;\n return out;\n}\nexport function translate(out, a, v) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4] + v[0];\n out[5] = a[5] + v[1];\n return out;\n}\nexport function rotate(out, a, rad) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var st = Math.sin(rad);\n var ct = Math.cos(rad);\n out[0] = aa * ct + ab * st;\n out[1] = -aa * st + ab * ct;\n out[2] = ac * ct + ad * st;\n out[3] = -ac * st + ct * ad;\n out[4] = ct * atx + st * aty;\n out[5] = ct * aty - st * atx;\n return out;\n}\nexport function scale(out, a, v) {\n var vx = v[0];\n var vy = v[1];\n out[0] = a[0] * vx;\n out[1] = a[1] * vy;\n out[2] = a[2] * vx;\n out[3] = a[3] * vy;\n out[4] = a[4] * vx;\n out[5] = a[5] * vy;\n return out;\n}\nexport function invert(out, a) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\nexport function clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n","import * as matrix from './matrix';\nimport * as vector from './vector';\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nvar scaleTmp = [];\nvar tmpTransform = [];\nvar originTransform = matrix.create();\nvar abs = Math.abs;\nvar Transformable = (function () {\n function Transformable() {\n }\n Transformable.prototype.setPosition = function (arr) {\n this.x = arr[0];\n this.y = arr[1];\n };\n Transformable.prototype.setScale = function (arr) {\n this.scaleX = arr[0];\n this.scaleY = arr[1];\n };\n Transformable.prototype.setOrigin = function (arr) {\n this.originX = arr[0];\n this.originY = arr[1];\n };\n Transformable.prototype.needLocalTransform = function () {\n return isNotAroundZero(this.rotation)\n || isNotAroundZero(this.x)\n || isNotAroundZero(this.y)\n || isNotAroundZero(this.scaleX - 1)\n || isNotAroundZero(this.scaleY - 1);\n };\n Transformable.prototype.updateTransform = function () {\n var parent = this.parent;\n var parentHasTransform = parent && parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n if (!(needLocalTransform || parentHasTransform)) {\n m && mIdentity(m);\n return;\n }\n m = m || matrix.create();\n if (needLocalTransform) {\n this.getLocalTransform(m);\n }\n else {\n mIdentity(m);\n }\n if (parentHasTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parent.transform, m);\n }\n else {\n matrix.copy(m, parent.transform);\n }\n }\n this.transform = m;\n this._resolveGlobalScaleRatio(m);\n };\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\n var globalScaleRatio = this.globalScaleRatio;\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n var relX = scaleTmp[0] < 0 ? -1 : 1;\n var relY = scaleTmp[1] < 0 ? -1 : 1;\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n };\n Transformable.prototype.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n };\n Transformable.prototype.getComputedTransform = function () {\n var transformNode = this;\n var ancestors = [];\n while (transformNode) {\n ancestors.push(transformNode);\n transformNode = transformNode.parent;\n }\n while (transformNode = ancestors.pop()) {\n transformNode.updateTransform();\n }\n return this.transform;\n };\n Transformable.prototype.setLocalTransform = function (m) {\n if (!m) {\n return;\n }\n var sx = m[0] * m[0] + m[1] * m[1];\n var sy = m[2] * m[2] + m[3] * m[3];\n if (isNotAroundZero(sx - 1)) {\n sx = Math.sqrt(sx);\n }\n if (isNotAroundZero(sy - 1)) {\n sy = Math.sqrt(sy);\n }\n if (m[0] < 0) {\n sx = -sx;\n }\n if (m[3] < 0) {\n sy = -sy;\n }\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\n if (sx < 0 && sy < 0) {\n this.rotation += Math.PI;\n sx = -sx;\n sy = -sy;\n }\n this.x = m[4];\n this.y = m[5];\n this.scaleX = sx;\n this.scaleY = sy;\n };\n Transformable.prototype.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n var parent = this.parent;\n var m = this.transform;\n if (parent && parent.transform) {\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n var ox = this.originX;\n var oy = this.originY;\n if (ox || oy) {\n originTransform[4] = ox;\n originTransform[5] = oy;\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= ox;\n tmpTransform[5] -= oy;\n m = tmpTransform;\n }\n this.setLocalTransform(m);\n };\n Transformable.prototype.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n return out;\n };\n Transformable.prototype.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n return v2;\n };\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n return v2;\n };\n Transformable.prototype.getLineScale = function () {\n var m = this.transform;\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n : 1;\n };\n Transformable.getLocalTransform = function (target, m) {\n m = m || [];\n mIdentity(m);\n var ox = target.originX || 0;\n var oy = target.originY || 0;\n var sx = target.scaleX;\n var sy = target.scaleY;\n var rotation = target.rotation || 0;\n var x = target.x;\n var y = target.y;\n m[4] -= ox;\n m[5] -= oy;\n m[0] *= sx;\n m[1] *= sy;\n m[2] *= sx;\n m[3] *= sy;\n m[4] *= sx;\n m[5] *= sy;\n if (rotation) {\n matrix.rotate(m, m, rotation);\n }\n m[4] += ox;\n m[5] += oy;\n m[4] += x;\n m[5] += y;\n return m;\n };\n Transformable.initDefaultProps = (function () {\n var proto = Transformable.prototype;\n proto.x = 0;\n proto.y = 0;\n proto.scaleX = 1;\n proto.scaleY = 1;\n proto.originX = 0;\n proto.originY = 0;\n proto.rotation = 0;\n proto.globalScaleRatio = 1;\n })();\n return Transformable;\n}());\n;\nexport default Transformable;\n","var easing = {\n linear: function (k) {\n return k;\n },\n quadraticIn: function (k) {\n return k * k;\n },\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * (--k * (k - 2) - 1);\n },\n cubicIn: function (k) {\n return k * k * k;\n },\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n quarticIn: function (k) {\n return k * k * k * k;\n },\n quarticOut: function (k) {\n return 1 - (--k * k * k * k);\n },\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n circularOut: function (k) {\n return Math.sqrt(1 - (--k * k));\n },\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return (a * Math.pow(2, -10 * k)\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n },\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n bounceIn: function (k) {\n return 1 - easing.bounceOut(1 - k);\n },\n bounceOut: function (k) {\n if (k < (1 / 2.75)) {\n return 7.5625 * k * k;\n }\n else if (k < (2 / 2.75)) {\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n }\n else if (k < (2.5 / 2.75)) {\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n }\n else {\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n }\n },\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easing.bounceIn(k * 2) * 0.5;\n }\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nexport default easing;\n","import easingFuncs from './easing';\nvar Clip = (function () {\n function Clip(opts) {\n this._initialized = false;\n this._startTime = 0;\n this._pausedTime = 0;\n this._paused = false;\n this._life = opts.life || 1000;\n this._delay = opts.delay || 0;\n this.loop = opts.loop == null ? false : opts.loop;\n this.gap = opts.gap || 0;\n this.easing = opts.easing || 'linear';\n this.onframe = opts.onframe;\n this.ondestroy = opts.ondestroy;\n this.onrestart = opts.onrestart;\n }\n Clip.prototype.step = function (globalTime, deltaTime) {\n if (!this._initialized) {\n this._startTime = globalTime + this._delay;\n this._initialized = true;\n }\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\n if (percent < 0) {\n percent = 0;\n }\n percent = Math.min(percent, 1);\n var easing = this.easing;\n var easingFunc = typeof easing === 'string'\n ? easingFuncs[easing] : easing;\n var schedule = typeof easingFunc === 'function'\n ? easingFunc(percent)\n : percent;\n this.onframe && this.onframe(schedule);\n if (percent === 1) {\n if (this.loop) {\n this._restart(globalTime);\n this.onrestart && this.onrestart();\n }\n else {\n return true;\n }\n }\n return false;\n };\n Clip.prototype._restart = function (globalTime) {\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\n this._startTime = globalTime - remainder + this.gap;\n this._pausedTime = 0;\n };\n Clip.prototype.pause = function () {\n this._paused = true;\n };\n Clip.prototype.resume = function () {\n this._paused = false;\n };\n return Clip;\n}());\nexport default Clip;\n","var Entry = (function () {\n function Entry(val) {\n this.value = val;\n }\n return Entry;\n}());\nexport { Entry };\nvar LinkedList = (function () {\n function LinkedList() {\n this._len = 0;\n }\n LinkedList.prototype.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n };\n LinkedList.prototype.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n }\n else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n this._len++;\n };\n LinkedList.prototype.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this.head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this.tail = prev;\n }\n entry.next = entry.prev = null;\n this._len--;\n };\n LinkedList.prototype.len = function () {\n return this._len;\n };\n LinkedList.prototype.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n };\n return LinkedList;\n}());\nexport { LinkedList };\nvar LRU = (function () {\n function LRU(maxSize) {\n this._list = new LinkedList();\n this._maxSize = 10;\n this._map = {};\n this._maxSize = maxSize;\n }\n LRU.prototype.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n if (map[key] == null) {\n var len = list.len();\n var entry = this._lastRemovedEntry;\n if (len >= this._maxSize && len > 0) {\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n if (entry) {\n entry.value = value;\n }\n else {\n entry = new Entry(value);\n }\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n return removed;\n };\n LRU.prototype.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n if (entry != null) {\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n return entry.value;\n }\n };\n LRU.prototype.clear = function () {\n this._list.clear();\n this._map = {};\n };\n LRU.prototype.len = function () {\n return this._list.len();\n };\n return LRU;\n}());\nexport default LRU;\n","import LRU from '../core/LRU';\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\nfunction clampCssByte(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\nfunction clampCssAngle(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\nfunction clampCssFloat(f) {\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\nfunction parseCssInt(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n return clampCssByte(parseInt(str, 10));\n}\nfunction parseCssFloat(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n return clampCssFloat(parseFloat(str));\n}\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n }\n else if (h > 1) {\n h -= 1;\n }\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\n}\nfunction setRgba(out, r, g, b, a) {\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n}\nfunction copyRgba(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\nfunction putToCache(colorStr, rgbaArr) {\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\nexport function parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n if (cached) {\n return copyRgba(rgbaArr, cached);\n }\n colorStr = colorStr + '';\n var str = colorStr.replace(/ /g, '').toLowerCase();\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n var strLen = str.length;\n if (str.charAt(0) === '#') {\n if (strLen === 4 || strLen === 5) {\n var iv = parseInt(str.slice(1, 4), 16);\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else if (strLen === 7 || strLen === 9) {\n var iv = parseInt(str.slice(1, 7), 16);\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n return;\n }\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === strLen) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1;\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n return params.length === 3\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n : setRgba(rgbaArr, 0, 0, 0, 1);\n }\n alpha = parseCssFloat(params.pop());\n case 'rgb':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n default:\n return;\n }\n }\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\nfunction hsla2rgba(hsla, rgba) {\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\n var s = parseCssFloat(hsla[1]);\n var l = parseCssFloat(hsla[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n rgba = rgba || [];\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\n if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n return rgba;\n}\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\n }\n var R = rgba[0] / 255;\n var G = rgba[1] / 255;\n var B = rgba[2] / 255;\n var vMin = Math.min(R, G, B);\n var vMax = Math.max(R, G, B);\n var delta = vMax - vMin;\n var L = (vMax + vMin) / 2;\n var H;\n var S;\n if (delta === 0) {\n H = 0;\n S = 0;\n }\n else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n }\n else {\n S = delta / (2 - vMax - vMin);\n }\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\n if (R === vMax) {\n H = deltaB - deltaG;\n }\n else if (G === vMax) {\n H = (1 / 3) + deltaR - deltaB;\n }\n else if (B === vMax) {\n H = (2 / 3) + deltaG - deltaR;\n }\n if (H < 0) {\n H += 1;\n }\n if (H > 1) {\n H -= 1;\n }\n }\n var hsla = [H * 360, S, L];\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n return hsla;\n}\nexport function lift(color, level) {\n var colorArr = parse(color);\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n }\n else {\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n }\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n }\n else if (colorArr[i] < 0) {\n colorArr[i] = 0;\n }\n }\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\nexport function toHex(color) {\n var colorArr = parse(color);\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n }\n}\nexport function fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n out = out || [];\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = colors[leftIndex];\n var rightColor = colors[rightIndex];\n var dv = value - leftIndex;\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n return out;\n}\nexport var fastMapToColor = fastLerp;\nexport function lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = parse(colors[leftIndex]);\n var rightColor = parse(colors[rightIndex]);\n var dv = value - leftIndex;\n var color = stringify([\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n ], 'rgba');\n return fullOutput\n ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n }\n : color;\n}\nexport var mapToColor = lerp;\nexport function modifyHSL(color, h, s, l) {\n var colorArr = parse(color);\n if (color) {\n colorArr = rgba2hsla(colorArr);\n h != null && (colorArr[0] = clampCssAngle(h));\n s != null && (colorArr[1] = parseCssFloat(s));\n l != null && (colorArr[2] = parseCssFloat(l));\n return stringify(hsla2rgba(colorArr), 'rgba');\n }\n}\nexport function modifyAlpha(color, alpha) {\n var colorArr = parse(color);\n if (colorArr && alpha != null) {\n colorArr[3] = clampCssFloat(alpha);\n return stringify(colorArr, 'rgba');\n }\n}\nexport function stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n return type + '(' + colorStr + ')';\n}\nexport function lum(color, backgroundLum) {\n var arr = parse(color);\n return arr\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n + (1 - arr[3]) * backgroundLum\n : 0;\n}\nexport function random() {\n var r = Math.round(Math.random() * 255);\n var g = Math.round(Math.random() * 255);\n var b = Math.round(Math.random() * 255);\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n}\n","import Clip from './Clip';\nimport * as color from '../tool/color';\nimport { isArrayLike, keys, logError } from '../core/util';\nvar arraySlice = Array.prototype.slice;\nexport function interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\nexport function step(p0, p1, percent) {\n return percent > 0.5 ? p1 : p0;\n}\nexport function interpolate1DArray(out, p0, p1, percent) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n}\nexport function interpolate2DArray(out, p0, p1, percent) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n}\nfunction add1DArray(out, p0, p1, sign) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = p0[i] + p1[i] * sign;\n }\n return out;\n}\nfunction add2DArray(out, p0, p1, sign) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = p0[i][j] + p1[i][j] * sign;\n }\n }\n return out;\n}\nfunction fillArray(val0, val1, arrDim) {\n var arr0 = val0;\n var arr1 = val1;\n if (!arr0.push || !arr1.push) {\n return;\n }\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n if (arr0Len !== arr1Len) {\n var isPreviousLarger = arr0Len > arr1Len;\n if (isPreviousLarger) {\n arr0.length = arr1Len;\n }\n else {\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n }\n var len2 = arr0[0] && arr0[0].length;\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n }\n else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\nfunction is1DArraySame(arr0, arr1) {\n var len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n return true;\n}\nfunction is2DArraySame(arr0, arr1) {\n var len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n var len2 = arr0[0].length;\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n if (arr0[i][j] !== arr1[i][j]) {\n return false;\n }\n }\n }\n return true;\n}\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\n + v0 * t + p1;\n}\nfunction catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\n }\n}\nfunction catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\n var len = p0.length;\n var len2 = p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[1] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\n }\n }\n}\nexport function cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n if (isArrayLike(value[0])) {\n var ret = [];\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n return ret;\n }\n return arraySlice.call(value);\n }\n return value;\n}\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]);\n rgba[1] = Math.floor(rgba[1]);\n rgba[2] = Math.floor(rgba[2]);\n return 'rgba(' + rgba.join(',') + ')';\n}\nfunction guessArrayDim(value) {\n return isArrayLike(value && value[0]) ? 2 : 1;\n}\nvar tmpRgba = [0, 0, 0, 0];\nvar Track = (function () {\n function Track(propName) {\n this.keyframes = [];\n this.maxTime = 0;\n this.arrDim = 0;\n this.interpolable = true;\n this._needsSort = false;\n this._isAllValueEqual = true;\n this._lastFrame = 0;\n this._lastFramePercent = 0;\n this.propName = propName;\n }\n Track.prototype.isFinished = function () {\n return this._finished;\n };\n Track.prototype.setFinished = function () {\n this._finished = true;\n if (this._additiveTrack) {\n this._additiveTrack.setFinished();\n }\n };\n Track.prototype.needsAnimate = function () {\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\n };\n Track.prototype.getAdditiveTrack = function () {\n return this._additiveTrack;\n };\n Track.prototype.addKeyframe = function (time, value) {\n if (time >= this.maxTime) {\n this.maxTime = time;\n }\n else {\n this._needsSort = true;\n }\n var keyframes = this.keyframes;\n var len = keyframes.length;\n if (this.interpolable) {\n if (isArrayLike(value)) {\n var arrayDim = guessArrayDim(value);\n if (len > 0 && this.arrDim !== arrayDim) {\n this.interpolable = false;\n return;\n }\n if (arrayDim === 1 && typeof value[0] !== 'number'\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\n this.interpolable = false;\n return;\n }\n if (len > 0) {\n var lastFrame = keyframes[len - 1];\n if (this._isAllValueEqual) {\n if (arrayDim === 1) {\n if (!is1DArraySame(value, lastFrame.value)) {\n this._isAllValueEqual = false;\n }\n }\n else {\n this._isAllValueEqual = false;\n }\n }\n }\n this.arrDim = arrayDim;\n }\n else {\n if (this.arrDim > 0) {\n this.interpolable = false;\n return;\n }\n if (typeof value === 'string') {\n var colorArray = color.parse(value);\n if (colorArray) {\n value = colorArray;\n this.isValueColor = true;\n }\n else {\n this.interpolable = false;\n }\n }\n else if (typeof value !== 'number' || isNaN(value)) {\n this.interpolable = false;\n return;\n }\n if (this._isAllValueEqual && len > 0) {\n var lastFrame = keyframes[len - 1];\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\n this._isAllValueEqual = false;\n }\n else if (lastFrame.value !== value) {\n this._isAllValueEqual = false;\n }\n }\n }\n }\n var kf = {\n time: time,\n value: value,\n percent: 0\n };\n this.keyframes.push(kf);\n return kf;\n };\n Track.prototype.prepare = function (additiveTrack) {\n var kfs = this.keyframes;\n if (this._needsSort) {\n kfs.sort(function (a, b) {\n return a.time - b.time;\n });\n }\n var arrDim = this.arrDim;\n var kfsLen = kfs.length;\n var lastKf = kfs[kfsLen - 1];\n for (var i = 0; i < kfsLen; i++) {\n kfs[i].percent = kfs[i].time / this.maxTime;\n if (arrDim > 0 && i !== kfsLen - 1) {\n fillArray(kfs[i].value, lastKf.value, arrDim);\n }\n }\n if (additiveTrack\n && this.needsAnimate()\n && additiveTrack.needsAnimate()\n && arrDim === additiveTrack.arrDim\n && this.isValueColor === additiveTrack.isValueColor\n && !additiveTrack._finished) {\n this._additiveTrack = additiveTrack;\n var startValue = kfs[0].value;\n for (var i = 0; i < kfsLen; i++) {\n if (arrDim === 0) {\n if (this.isValueColor) {\n kfs[i].additiveValue\n = add1DArray([], kfs[i].value, startValue, -1);\n }\n else {\n kfs[i].additiveValue = kfs[i].value - startValue;\n }\n }\n else if (arrDim === 1) {\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\n }\n else if (arrDim === 2) {\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\n }\n }\n }\n };\n Track.prototype.step = function (target, percent) {\n if (this._finished) {\n return;\n }\n if (this._additiveTrack && this._additiveTrack._finished) {\n this._additiveTrack = null;\n }\n var isAdditive = this._additiveTrack != null;\n var valueKey = isAdditive ? 'additiveValue' : 'value';\n var keyframes = this.keyframes;\n var kfsNum = this.keyframes.length;\n var propName = this.propName;\n var arrDim = this.arrDim;\n var isValueColor = this.isValueColor;\n var frameIdx;\n if (percent < 0) {\n frameIdx = 0;\n }\n else if (percent < this._lastFramePercent) {\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n if (keyframes[frameIdx].percent <= percent) {\n break;\n }\n }\n frameIdx = Math.min(frameIdx, kfsNum - 2);\n }\n else {\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\n if (keyframes[frameIdx].percent > percent) {\n break;\n }\n }\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\n }\n var nextFrame = keyframes[frameIdx + 1];\n var frame = keyframes[frameIdx];\n if (!(frame && nextFrame)) {\n return;\n }\n this._lastFrame = frameIdx;\n this._lastFramePercent = percent;\n var range = (nextFrame.percent - frame.percent);\n if (range === 0) {\n return;\n }\n var w = (percent - frame.percent) / range;\n var targetArr = isAdditive ? this._additiveValue\n : (isValueColor ? tmpRgba : target[propName]);\n if ((arrDim > 0 || isValueColor) && !targetArr) {\n targetArr = this._additiveValue = [];\n }\n if (this.useSpline) {\n var p1 = keyframes[frameIdx][valueKey];\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\n if (arrDim > 0) {\n arrDim === 1\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\n }\n else if (isValueColor) {\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\n if (!isAdditive) {\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n var value = void 0;\n if (!this.interpolable) {\n value = p2;\n }\n else {\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\n }\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n }\n else {\n if (arrDim > 0) {\n arrDim === 1\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n }\n else if (isValueColor) {\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n if (!isAdditive) {\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n var value = void 0;\n if (!this.interpolable) {\n value = step(frame[valueKey], nextFrame[valueKey], w);\n }\n else {\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\n }\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n }\n if (isAdditive) {\n this._addToTarget(target);\n }\n };\n Track.prototype._addToTarget = function (target) {\n var arrDim = this.arrDim;\n var propName = this.propName;\n var additiveValue = this._additiveValue;\n if (arrDim === 0) {\n if (this.isValueColor) {\n color.parse(target[propName], tmpRgba);\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\n target[propName] = rgba2String(tmpRgba);\n }\n else {\n target[propName] = target[propName] + additiveValue;\n }\n }\n else if (arrDim === 1) {\n add1DArray(target[propName], target[propName], additiveValue, 1);\n }\n else if (arrDim === 2) {\n add2DArray(target[propName], target[propName], additiveValue, 1);\n }\n };\n return Track;\n}());\nvar Animator = (function () {\n function Animator(target, loop, additiveTo) {\n this._tracks = {};\n this._trackKeys = [];\n this._delay = 0;\n this._maxTime = 0;\n this._paused = false;\n this._started = 0;\n this._clip = null;\n this._target = target;\n this._loop = loop;\n if (loop && additiveTo) {\n logError('Can\\' use additive animation on looped animation.');\n return;\n }\n this._additiveAnimators = additiveTo;\n }\n Animator.prototype.getTarget = function () {\n return this._target;\n };\n Animator.prototype.changeTarget = function (target) {\n this._target = target;\n };\n Animator.prototype.when = function (time, props) {\n return this.whenWithKeys(time, props, keys(props));\n };\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\n var tracks = this._tracks;\n for (var i = 0; i < propNames.length; i++) {\n var propName = propNames[i];\n var track = tracks[propName];\n if (!track) {\n track = tracks[propName] = new Track(propName);\n var initialValue = void 0;\n var additiveTrack = this._getAdditiveTrack(propName);\n if (additiveTrack) {\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\n initialValue = lastFinalKf && lastFinalKf.value;\n if (additiveTrack.isValueColor && initialValue) {\n initialValue = rgba2String(initialValue);\n }\n }\n else {\n initialValue = this._target[propName];\n }\n if (initialValue == null) {\n continue;\n }\n if (time !== 0) {\n track.addKeyframe(0, cloneValue(initialValue));\n }\n this._trackKeys.push(propName);\n }\n track.addKeyframe(time, cloneValue(props[propName]));\n }\n this._maxTime = Math.max(this._maxTime, time);\n return this;\n };\n Animator.prototype.pause = function () {\n this._clip.pause();\n this._paused = true;\n };\n Animator.prototype.resume = function () {\n this._clip.resume();\n this._paused = false;\n };\n Animator.prototype.isPaused = function () {\n return !!this._paused;\n };\n Animator.prototype._doneCallback = function () {\n this._setTracksFinished();\n this._clip = null;\n var doneList = this._doneList;\n if (doneList) {\n var len = doneList.length;\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n }\n };\n Animator.prototype._abortedCallback = function () {\n this._setTracksFinished();\n var animation = this.animation;\n var abortedList = this._abortedList;\n if (animation) {\n animation.removeClip(this._clip);\n }\n this._clip = null;\n if (abortedList) {\n for (var i = 0; i < abortedList.length; i++) {\n abortedList[i].call(this);\n }\n }\n };\n Animator.prototype._setTracksFinished = function () {\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < tracksKeys.length; i++) {\n tracks[tracksKeys[i]].setFinished();\n }\n };\n Animator.prototype._getAdditiveTrack = function (trackName) {\n var additiveTrack;\n var additiveAnimators = this._additiveAnimators;\n if (additiveAnimators) {\n for (var i = 0; i < additiveAnimators.length; i++) {\n var track = additiveAnimators[i].getTrack(trackName);\n if (track) {\n additiveTrack = track;\n }\n }\n }\n return additiveTrack;\n };\n Animator.prototype.start = function (easing, forceAnimate) {\n if (this._started > 0) {\n return;\n }\n this._started = 1;\n var self = this;\n var tracks = [];\n for (var i = 0; i < this._trackKeys.length; i++) {\n var propName = this._trackKeys[i];\n var track = this._tracks[propName];\n var additiveTrack = this._getAdditiveTrack(propName);\n var kfs = track.keyframes;\n track.prepare(additiveTrack);\n if (track.needsAnimate()) {\n tracks.push(track);\n }\n else if (!track.interpolable) {\n var lastKf = kfs[kfs.length - 1];\n if (lastKf) {\n self._target[track.propName] = lastKf.value;\n }\n }\n }\n if (tracks.length || forceAnimate) {\n var clip = new Clip({\n life: this._maxTime,\n loop: this._loop,\n delay: this._delay,\n onframe: function (percent) {\n self._started = 2;\n var additiveAnimators = self._additiveAnimators;\n if (additiveAnimators) {\n var stillHasAdditiveAnimator = false;\n for (var i = 0; i < additiveAnimators.length; i++) {\n if (additiveAnimators[i]._clip) {\n stillHasAdditiveAnimator = true;\n break;\n }\n }\n if (!stillHasAdditiveAnimator) {\n self._additiveAnimators = null;\n }\n }\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].step(self._target, percent);\n }\n var onframeList = self._onframeList;\n if (onframeList) {\n for (var i = 0; i < onframeList.length; i++) {\n onframeList[i](self._target, percent);\n }\n }\n },\n ondestroy: function () {\n self._doneCallback();\n }\n });\n this._clip = clip;\n if (this.animation) {\n this.animation.addClip(clip);\n }\n if (easing && easing !== 'spline') {\n clip.easing = easing;\n }\n }\n else {\n this._doneCallback();\n }\n return this;\n };\n Animator.prototype.stop = function (forwardToLast) {\n if (!this._clip) {\n return;\n }\n var clip = this._clip;\n if (forwardToLast) {\n clip.onframe(1);\n }\n this._abortedCallback();\n };\n Animator.prototype.delay = function (time) {\n this._delay = time;\n return this;\n };\n Animator.prototype.during = function (cb) {\n if (cb) {\n if (!this._onframeList) {\n this._onframeList = [];\n }\n this._onframeList.push(cb);\n }\n return this;\n };\n Animator.prototype.done = function (cb) {\n if (cb) {\n if (!this._doneList) {\n this._doneList = [];\n }\n this._doneList.push(cb);\n }\n return this;\n };\n Animator.prototype.aborted = function (cb) {\n if (cb) {\n if (!this._abortedList) {\n this._abortedList = [];\n }\n this._abortedList.push(cb);\n }\n return this;\n };\n Animator.prototype.getClip = function () {\n return this._clip;\n };\n Animator.prototype.getTrack = function (propName) {\n return this._tracks[propName];\n };\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\n if (!propNames.length || !this._clip) {\n return true;\n }\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < propNames.length; i++) {\n var track = tracks[propNames[i]];\n if (track) {\n if (forwardToLast) {\n track.step(this._target, 1);\n }\n else if (this._started === 1) {\n track.step(this._target, 0);\n }\n track.setFinished();\n }\n }\n var allAborted = true;\n for (var i = 0; i < tracksKeys.length; i++) {\n if (!tracks[tracksKeys[i]].isFinished()) {\n allAborted = false;\n break;\n }\n }\n if (allAborted) {\n this._abortedCallback();\n }\n return allAborted;\n };\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\n if (!target) {\n return;\n }\n trackKeys = trackKeys || this._trackKeys;\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track || track.isFinished()) {\n continue;\n }\n var kfs = track.keyframes;\n var lastKf = kfs[kfs.length - 1];\n if (lastKf) {\n var val = cloneValue(lastKf.value);\n if (track.isValueColor) {\n val = rgba2String(val);\n }\n target[propName] = val;\n }\n }\n };\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\n trackKeys = trackKeys || keys(finalProps);\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track) {\n continue;\n }\n var kfs = track.keyframes;\n if (kfs.length > 1) {\n var lastKf = kfs.pop();\n track.addKeyframe(lastKf.time, finalProps[propName]);\n track.prepare(track.getAdditiveTrack());\n }\n }\n };\n return Animator;\n}());\nexport default Animator;\n","import BoundingRect from '../core/BoundingRect';\nimport { createCanvas } from '../core/util';\nimport LRU from '../core/LRU';\nvar textWidthCache = {};\nexport var DEFAULT_FONT = '12px sans-serif';\nvar _ctx;\nvar _cachedFont;\nfunction defaultMeasureText(text, font) {\n if (!_ctx) {\n _ctx = createCanvas().getContext('2d');\n }\n if (_cachedFont !== font) {\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\n }\n return _ctx.measureText(text);\n}\nvar methods = {\n measureText: defaultMeasureText\n};\nexport function $override(name, fn) {\n methods[name] = fn;\n}\nexport function getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var cacheOfFont = textWidthCache[font];\n if (!cacheOfFont) {\n cacheOfFont = textWidthCache[font] = new LRU(500);\n }\n var width = cacheOfFont.get(text);\n if (width == null) {\n width = methods.measureText(text, font).width;\n cacheOfFont.put(text, width);\n }\n return width;\n}\nexport function innerGetBoundingRect(text, font, textAlign, textBaseline) {\n var width = getWidth(text, font);\n var height = getLineHeight(font);\n var x = adjustTextX(0, width, textAlign);\n var y = adjustTextY(0, height, textBaseline);\n var rect = new BoundingRect(x, y, width, height);\n return rect;\n}\nexport function getBoundingRect(text, font, textAlign, textBaseline) {\n var textLines = ((text || '') + '').split('\\n');\n var len = textLines.length;\n if (len === 1) {\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n }\n else {\n var uniondRect = new BoundingRect(0, 0, 0, 0);\n for (var i = 0; i < textLines.length; i++) {\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n }\n return uniondRect;\n }\n}\nexport function adjustTextX(x, width, textAlign) {\n if (textAlign === 'right') {\n x -= width;\n }\n else if (textAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nexport function adjustTextY(y, height, verticalAlign) {\n if (verticalAlign === 'middle') {\n y -= height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y -= height;\n }\n return y;\n}\nexport function getLineHeight(font) {\n return getWidth('国', font);\n}\nexport function measureText(text, font) {\n return methods.measureText(text, font);\n}\nexport function parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n return parseFloat(value);\n }\n return value;\n}\nexport function calculateTextPosition(out, opts, rect) {\n var textPosition = opts.position || 'inside';\n var distance = opts.distance != null ? opts.distance : 5;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var x = rect.x;\n var y = rect.y;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n if (textPosition instanceof Array) {\n x += parsePercent(textPosition[0], rect.width);\n y += parsePercent(textPosition[1], rect.height);\n textAlign = null;\n textVerticalAlign = null;\n }\n else {\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n }\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n}\n","var Point = (function () {\n function Point(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n Point.prototype.copy = function (other) {\n this.x = other.x;\n this.y = other.y;\n return this;\n };\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n Point.prototype.set = function (x, y) {\n this.x = x;\n this.y = y;\n return this;\n };\n Point.prototype.equal = function (other) {\n return other.x === this.x && other.y === this.y;\n };\n Point.prototype.add = function (other) {\n this.x += other.x;\n this.y += other.y;\n return this;\n };\n Point.prototype.scale = function (scalar) {\n this.x *= scalar;\n this.y *= scalar;\n };\n Point.prototype.scaleAndAdd = function (other, scalar) {\n this.x += other.x * scalar;\n this.y += other.y * scalar;\n };\n Point.prototype.sub = function (other) {\n this.x -= other.x;\n this.y -= other.y;\n return this;\n };\n Point.prototype.dot = function (other) {\n return this.x * other.x + this.y * other.y;\n };\n Point.prototype.len = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n };\n Point.prototype.lenSquare = function () {\n return this.x * this.x + this.y * this.y;\n };\n Point.prototype.normalize = function () {\n var len = this.len();\n this.x /= len;\n this.y /= len;\n return this;\n };\n Point.prototype.distance = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n Point.prototype.distanceSquare = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return dx * dx + dy * dy;\n };\n Point.prototype.negate = function () {\n this.x = -this.x;\n this.y = -this.y;\n return this;\n };\n Point.prototype.transform = function (m) {\n if (!m) {\n return;\n }\n var x = this.x;\n var y = this.y;\n this.x = m[0] * x + m[2] * y + m[4];\n this.y = m[1] * x + m[3] * y + m[5];\n return this;\n };\n Point.prototype.toArray = function (out) {\n out[0] = this.x;\n out[1] = this.y;\n return out;\n };\n Point.prototype.fromArray = function (input) {\n this.x = input[0];\n this.y = input[1];\n };\n Point.set = function (p, x, y) {\n p.x = x;\n p.y = y;\n };\n Point.copy = function (p, p2) {\n p.x = p2.x;\n p.y = p2.y;\n };\n Point.len = function (p) {\n return Math.sqrt(p.x * p.x + p.y * p.y);\n };\n Point.lenSquare = function (p) {\n return p.x * p.x + p.y * p.y;\n };\n Point.dot = function (p0, p1) {\n return p0.x * p1.x + p0.y * p1.y;\n };\n Point.add = function (out, p0, p1) {\n out.x = p0.x + p1.x;\n out.y = p0.y + p1.y;\n };\n Point.sub = function (out, p0, p1) {\n out.x = p0.x - p1.x;\n out.y = p0.y - p1.y;\n };\n Point.scale = function (out, p0, scalar) {\n out.x = p0.x * scalar;\n out.y = p0.y * scalar;\n };\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\n out.x = p0.x + p1.x * scalar;\n out.y = p0.y + p1.y * scalar;\n };\n Point.lerp = function (out, p0, p1, t) {\n var onet = 1 - t;\n out.x = onet * p0.x + t * p1.x;\n out.y = onet * p0.y + t * p1.y;\n };\n return Point;\n}());\nexport default Point;\n","import * as matrix from './matrix';\nimport Point from './Point';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar lt = new Point();\nvar rb = new Point();\nvar lb = new Point();\nvar rt = new Point();\nvar minTv = new Point();\nvar maxTv = new Point();\nvar BoundingRect = (function () {\n function BoundingRect(x, y, width, height) {\n if (width < 0 && isFinite(width)) {\n x = x + width;\n width = -width;\n }\n if (height < 0 && isFinite(height)) {\n y = y + height;\n height = -height;\n }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BoundingRect.prototype.union = function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n if (isFinite(this.x) && isFinite(this.width)) {\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n }\n else {\n this.width = other.width;\n }\n if (isFinite(this.y) && isFinite(this.height)) {\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n }\n else {\n this.height = other.height;\n }\n this.x = x;\n this.y = y;\n };\n BoundingRect.prototype.applyTransform = function (m) {\n BoundingRect.applyTransform(this, this, m);\n };\n BoundingRect.prototype.calculateTransform = function (b) {\n var a = this;\n var sx = b.width / a.width;\n var sy = b.height / a.height;\n var m = matrix.create();\n matrix.translate(m, m, [-a.x, -a.y]);\n matrix.scale(m, m, [sx, sy]);\n matrix.translate(m, m, [b.x, b.y]);\n return m;\n };\n BoundingRect.prototype.intersect = function (b, mtv) {\n if (!b) {\n return false;\n }\n if (!(b instanceof BoundingRect)) {\n b = BoundingRect.create(b);\n }\n var a = this;\n var ax0 = a.x;\n var ax1 = a.x + a.width;\n var ay0 = a.y;\n var ay1 = a.y + a.height;\n var bx0 = b.x;\n var bx1 = b.x + b.width;\n var by0 = b.y;\n var by1 = b.y + b.height;\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n if (mtv) {\n var dMin = Infinity;\n var dMax = 0;\n var d0 = Math.abs(ax1 - bx0);\n var d1 = Math.abs(bx1 - ax0);\n var d2 = Math.abs(ay1 - by0);\n var d3 = Math.abs(by1 - ay0);\n var dx = Math.min(d0, d1);\n var dy = Math.min(d2, d3);\n if (ax1 < bx0 || bx1 < ax0) {\n if (dx > dMax) {\n dMax = dx;\n if (d0 < d1) {\n Point.set(maxTv, -d0, 0);\n }\n else {\n Point.set(maxTv, d1, 0);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d0 < d1) {\n Point.set(minTv, d0, 0);\n }\n else {\n Point.set(minTv, -d1, 0);\n }\n }\n }\n if (ay1 < by0 || by1 < ay0) {\n if (dy > dMax) {\n dMax = dy;\n if (d2 < d3) {\n Point.set(maxTv, 0, -d2);\n }\n else {\n Point.set(maxTv, 0, d3);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d2 < d3) {\n Point.set(minTv, 0, d2);\n }\n else {\n Point.set(minTv, 0, -d3);\n }\n }\n }\n }\n if (mtv) {\n Point.copy(mtv, overlap ? minTv : maxTv);\n }\n return overlap;\n };\n BoundingRect.prototype.contain = function (x, y) {\n var rect = this;\n return x >= rect.x\n && x <= (rect.x + rect.width)\n && y >= rect.y\n && y <= (rect.y + rect.height);\n };\n BoundingRect.prototype.clone = function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n };\n BoundingRect.prototype.copy = function (other) {\n BoundingRect.copy(this, other);\n };\n BoundingRect.prototype.plain = function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n };\n BoundingRect.prototype.isFinite = function () {\n return isFinite(this.x)\n && isFinite(this.y)\n && isFinite(this.width)\n && isFinite(this.height);\n };\n BoundingRect.prototype.isZero = function () {\n return this.width === 0 || this.height === 0;\n };\n BoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n };\n BoundingRect.copy = function (target, source) {\n target.x = source.x;\n target.y = source.y;\n target.width = source.width;\n target.height = source.height;\n };\n BoundingRect.applyTransform = function (target, source, m) {\n if (!m) {\n if (target !== source) {\n BoundingRect.copy(target, source);\n }\n return;\n }\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n var sx = m[0];\n var sy = m[3];\n var tx = m[4];\n var ty = m[5];\n target.x = source.x * sx + tx;\n target.y = source.y * sy + ty;\n target.width = source.width * sx;\n target.height = source.height * sy;\n if (target.width < 0) {\n target.x += target.width;\n target.width = -target.width;\n }\n if (target.height < 0) {\n target.y += target.height;\n target.height = -target.height;\n }\n return;\n }\n lt.x = lb.x = source.x;\n lt.y = rt.y = source.y;\n rb.x = rt.x = source.x + source.width;\n rb.y = lb.y = source.y + source.height;\n lt.transform(m);\n rt.transform(m);\n rb.transform(m);\n lb.transform(m);\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n target.width = maxX - target.x;\n target.height = maxY - target.y;\n };\n return BoundingRect;\n}());\nexport default BoundingRect;\n","var dpr = 1;\nif (typeof window !== 'undefined') {\n dpr = Math.max(window.devicePixelRatio\n || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI)\n || 1, 1);\n}\nexport var debugMode = 0;\nexport var devicePixelRatio = dpr;\nexport var DARK_MODE_THRESHOLD = 0.4;\nexport var DARK_LABEL_COLOR = '#333';\nexport var LIGHT_LABEL_COLOR = '#ccc';\nexport var LIGHTER_LABEL_COLOR = '#eee';\n","import Transformable from './core/Transformable';\nimport Animator, { cloneValue } from './animation/Animator';\nimport BoundingRect from './core/BoundingRect';\nimport Eventful from './core/Eventful';\nimport { calculateTextPosition, parsePercent } from './contain/text';\nimport { guid, isObject, keys, extend, indexOf, logError, mixin, isArrayLike, isTypedArray } from './core/util';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config';\nimport { parse, stringify } from './tool/color';\nimport env from './core/env';\nexport var PRESERVED_NORMAL_STATE = '__zr_normal__';\nvar PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\nvar DEFAULT_ANIMATABLE_MAP = {\n x: true,\n y: true,\n scaleX: true,\n scaleY: true,\n originX: true,\n originY: true,\n rotation: true,\n ignore: false\n};\nvar tmpTextPosCalcRes = {};\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\nvar Element = (function () {\n function Element(props) {\n this.id = guid();\n this.animators = [];\n this.currentStates = [];\n this.states = {};\n this._init(props);\n }\n Element.prototype._init = function (props) {\n this.attr(props);\n };\n Element.prototype.drift = function (dx, dy, e) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n case 'vertical':\n dx = 0;\n break;\n }\n var m = this.transform;\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.markRedraw();\n };\n Element.prototype.beforeUpdate = function () { };\n Element.prototype.afterUpdate = function () { };\n Element.prototype.update = function () {\n this.updateTransform();\n if (this.__dirty) {\n this.updateInnerText();\n }\n };\n Element.prototype.updateInnerText = function (forceUpdate) {\n var textEl = this._textContent;\n if (textEl && (!textEl.ignore || forceUpdate)) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n var textConfig = this.textConfig;\n var isLocal = textConfig.local;\n var attachedTransform = textEl.attachedTransform;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var textStyleChanged = false;\n if (isLocal) {\n attachedTransform.parent = this;\n }\n else {\n attachedTransform.parent = null;\n }\n var innerOrigin = false;\n attachedTransform.x = textEl.x;\n attachedTransform.y = textEl.y;\n attachedTransform.originX = textEl.originX;\n attachedTransform.originY = textEl.originY;\n attachedTransform.rotation = textEl.rotation;\n attachedTransform.scaleX = textEl.scaleX;\n attachedTransform.scaleY = textEl.scaleY;\n if (textConfig.position != null) {\n var layoutRect = tmpBoundingRect;\n if (textConfig.layoutRect) {\n layoutRect.copy(textConfig.layoutRect);\n }\n else {\n layoutRect.copy(this.getBoundingRect());\n }\n if (!isLocal) {\n layoutRect.applyTransform(this.transform);\n }\n if (this.calculateTextPosition) {\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n else {\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n attachedTransform.x = tmpTextPosCalcRes.x;\n attachedTransform.y = tmpTextPosCalcRes.y;\n textAlign = tmpTextPosCalcRes.align;\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n var textOrigin = textConfig.origin;\n if (textOrigin && textConfig.rotation != null) {\n var relOriginX = void 0;\n var relOriginY = void 0;\n if (textOrigin === 'center') {\n relOriginX = layoutRect.width * 0.5;\n relOriginY = layoutRect.height * 0.5;\n }\n else {\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n }\n innerOrigin = true;\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n }\n }\n if (textConfig.rotation != null) {\n attachedTransform.rotation = textConfig.rotation;\n }\n var textOffset = textConfig.offset;\n if (textOffset) {\n attachedTransform.x += textOffset[0];\n attachedTransform.y += textOffset[1];\n if (!innerOrigin) {\n attachedTransform.originX = -textOffset[0];\n attachedTransform.originY = -textOffset[1];\n }\n }\n var isInside = textConfig.inside == null\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n : textConfig.inside;\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n var textFill = void 0;\n var textStroke = void 0;\n var autoStroke = void 0;\n if (isInside && this.canBeInsideText()) {\n textFill = textConfig.insideFill;\n textStroke = textConfig.insideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getInsideTextFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getInsideTextStroke(textFill);\n autoStroke = true;\n }\n }\n else {\n textFill = textConfig.outsideFill;\n textStroke = textConfig.outsideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getOutsideFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getOutsideStroke(textFill);\n autoStroke = true;\n }\n }\n textFill = textFill || '#000';\n if (textFill !== innerTextDefaultStyle.fill\n || textStroke !== innerTextDefaultStyle.stroke\n || autoStroke !== innerTextDefaultStyle.autoStroke\n || textAlign !== innerTextDefaultStyle.align\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\n textStyleChanged = true;\n innerTextDefaultStyle.fill = textFill;\n innerTextDefaultStyle.stroke = textStroke;\n innerTextDefaultStyle.autoStroke = autoStroke;\n innerTextDefaultStyle.align = textAlign;\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\n }\n if (textStyleChanged) {\n textEl.dirtyStyle();\n }\n textEl.markRedraw();\n }\n };\n Element.prototype.canBeInsideText = function () {\n return true;\n };\n Element.prototype.getInsideTextFill = function () {\n return '#fff';\n };\n Element.prototype.getInsideTextStroke = function (textFill) {\n return '#000';\n };\n Element.prototype.getOutsideFill = function () {\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n };\n Element.prototype.getOutsideStroke = function (textFill) {\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\n if (!colorArr) {\n colorArr = [255, 255, 255, 1];\n }\n var alpha = colorArr[3];\n var isDark = this.__zr.isDarkMode();\n for (var i = 0; i < 3; i++) {\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n }\n colorArr[3] = 1;\n return stringify(colorArr, 'rgba');\n };\n Element.prototype.traverse = function (cb, context) { };\n Element.prototype.attrKV = function (key, value) {\n if (key === 'textConfig') {\n this.setTextConfig(value);\n }\n else if (key === 'textContent') {\n this.setTextContent(value);\n }\n else if (key === 'clipPath') {\n this.setClipPath(value);\n }\n else if (key === 'extra') {\n this.extra = this.extra || {};\n extend(this.extra, value);\n }\n else {\n this[key] = value;\n }\n };\n Element.prototype.hide = function () {\n this.ignore = true;\n this.markRedraw();\n };\n Element.prototype.show = function () {\n this.ignore = false;\n this.markRedraw();\n };\n Element.prototype.attr = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.attrKV(keyOrObj, value);\n }\n else if (isObject(keyOrObj)) {\n var obj = keyOrObj;\n var keysArr = keys(obj);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n this.attrKV(key, keyOrObj[key]);\n }\n }\n this.markRedraw();\n return this;\n };\n Element.prototype.saveCurrentToNormalState = function (toState) {\n this._innerSaveToNormal(toState);\n var normalState = this._normalState;\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var fromStateTransition = animator.__fromStateTransition;\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n continue;\n }\n var targetName = animator.targetName;\n var target = targetName\n ? normalState[targetName] : normalState;\n animator.saveFinalToTarget(target);\n }\n };\n Element.prototype._innerSaveToNormal = function (toState) {\n var normalState = this._normalState;\n if (!normalState) {\n normalState = this._normalState = {};\n }\n if (toState.textConfig && !normalState.textConfig) {\n normalState.textConfig = this.textConfig;\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\n for (var i = 0; i < primaryKeys.length; i++) {\n var key = primaryKeys[i];\n if (toState[key] != null && !(key in normalState)) {\n normalState[key] = this[key];\n }\n }\n };\n Element.prototype.hasState = function () {\n return this.currentStates.length > 0;\n };\n Element.prototype.getState = function (name) {\n return this.states[name];\n };\n Element.prototype.ensureState = function (name) {\n var states = this.states;\n if (!states[name]) {\n states[name] = {};\n }\n return states[name];\n };\n Element.prototype.clearStates = function (noAnimation) {\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n };\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\n var hasStates = this.hasState();\n if (!hasStates && toNormalState) {\n return;\n }\n var currentStates = this.currentStates;\n var animationCfg = this.stateTransition;\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n return;\n }\n var state;\n if (this.stateProxy && !toNormalState) {\n state = this.stateProxy(stateName);\n }\n if (!state) {\n state = (this.states && this.states[stateName]);\n }\n if (!state && !toNormalState) {\n logError(\"State \" + stateName + \" not exists.\");\n return;\n }\n if (!toNormalState) {\n this.saveCurrentToNormalState(state);\n }\n var useHoverLayer = !!(state && state.hoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n if (this._textContent) {\n this._textContent.useState(stateName, keepCurrentStates);\n }\n if (this._textGuide) {\n this._textGuide.useState(stateName, keepCurrentStates);\n }\n if (toNormalState) {\n this.currentStates = [];\n this._normalState = {};\n }\n else {\n if (!keepCurrentStates) {\n this.currentStates = [stateName];\n }\n else {\n this.currentStates.push(stateName);\n }\n }\n this._updateAnimationTargets();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~Element.REDARAW_BIT;\n }\n return state;\n };\n Element.prototype.useStates = function (states, noAnimation) {\n if (!states.length) {\n this.clearStates();\n }\n else {\n var stateObjects = [];\n var currentStates = this.currentStates;\n var len = states.length;\n var notChange = len === currentStates.length;\n if (notChange) {\n for (var i = 0; i < len; i++) {\n if (states[i] !== currentStates[i]) {\n notChange = false;\n break;\n }\n }\n }\n if (notChange) {\n return;\n }\n for (var i = 0; i < len; i++) {\n var stateName = states[i];\n var stateObj = void 0;\n if (this.stateProxy) {\n stateObj = this.stateProxy(stateName, states);\n }\n if (!stateObj) {\n stateObj = this.states[stateName];\n }\n if (stateObj) {\n stateObjects.push(stateObj);\n }\n }\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n var mergedState = this._mergeStates(stateObjects);\n var animationCfg = this.stateTransition;\n this.saveCurrentToNormalState(mergedState);\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n if (this._textContent) {\n this._textContent.useStates(states);\n }\n if (this._textGuide) {\n this._textGuide.useStates(states);\n }\n this._updateAnimationTargets();\n this.currentStates = states.slice();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~Element.REDARAW_BIT;\n }\n }\n };\n Element.prototype._updateAnimationTargets = function () {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n if (animator.targetName) {\n animator.changeTarget(this[animator.targetName]);\n }\n }\n };\n Element.prototype.removeState = function (state) {\n var idx = indexOf(this.currentStates, state);\n if (idx >= 0) {\n var currentStates = this.currentStates.slice();\n currentStates.splice(idx, 1);\n this.useStates(currentStates);\n }\n };\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\n var currentStates = this.currentStates.slice();\n var idx = indexOf(currentStates, oldState);\n var newStateExists = indexOf(currentStates, newState) >= 0;\n if (idx >= 0) {\n if (!newStateExists) {\n currentStates[idx] = newState;\n }\n else {\n currentStates.splice(idx, 1);\n }\n }\n else if (forceAdd && !newStateExists) {\n currentStates.push(newState);\n }\n this.useStates(currentStates);\n };\n Element.prototype.toggleState = function (state, enable) {\n if (enable) {\n this.useState(state, true);\n }\n else {\n this.removeState(state);\n }\n };\n Element.prototype._mergeStates = function (states) {\n var mergedState = {};\n var mergedTextConfig;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n extend(mergedState, state);\n if (state.textConfig) {\n mergedTextConfig = mergedTextConfig || {};\n extend(mergedTextConfig, state.textConfig);\n }\n }\n if (mergedTextConfig) {\n mergedState.textConfig = mergedTextConfig;\n }\n return mergedState;\n };\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n var needsRestoreToNormal = !(state && keepCurrentStates);\n if (state && state.textConfig) {\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\n extend(this.textConfig, state.textConfig);\n }\n else if (needsRestoreToNormal) {\n if (normalState.textConfig) {\n this.textConfig = normalState.textConfig;\n }\n }\n var transitionTarget = {};\n var hasTransition = false;\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n var key = PRIMARY_STATES_KEYS[i];\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n if (state && state[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = state[key];\n }\n else {\n this[key] = state[key];\n }\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = normalState[key];\n }\n else {\n this[key] = normalState[key];\n }\n }\n }\n }\n if (!transition) {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var targetName = animator.targetName;\n animator.__changeFinalValue(targetName\n ? (state || normalState)[targetName]\n : (state || normalState));\n }\n }\n if (hasTransition) {\n this._transitionState(stateName, transitionTarget, animationCfg);\n }\n };\n Element.prototype._attachComponent = function (componentEl) {\n if (componentEl.__zr && !componentEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n if (componentEl === this) {\n throw new Error('Recursive component attachment.');\n }\n var zr = this.__zr;\n if (zr) {\n componentEl.addSelfToZr(zr);\n }\n componentEl.__zr = zr;\n componentEl.__hostTarget = this;\n };\n Element.prototype._detachComponent = function (componentEl) {\n if (componentEl.__zr) {\n componentEl.removeSelfFromZr(componentEl.__zr);\n }\n componentEl.__zr = null;\n componentEl.__hostTarget = null;\n };\n Element.prototype.getClipPath = function () {\n return this._clipPath;\n };\n Element.prototype.setClipPath = function (clipPath) {\n if (this._clipPath && this._clipPath !== clipPath) {\n this.removeClipPath();\n }\n this._attachComponent(clipPath);\n this._clipPath = clipPath;\n this.markRedraw();\n };\n Element.prototype.removeClipPath = function () {\n var clipPath = this._clipPath;\n if (clipPath) {\n this._detachComponent(clipPath);\n this._clipPath = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextContent = function () {\n return this._textContent;\n };\n Element.prototype.setTextContent = function (textEl) {\n var previousTextContent = this._textContent;\n if (previousTextContent === textEl) {\n return;\n }\n if (previousTextContent && previousTextContent !== textEl) {\n this.removeTextContent();\n }\n if (textEl.__zr && !textEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n textEl.attachedTransform = new Transformable();\n this._attachComponent(textEl);\n this._textContent = textEl;\n this.markRedraw();\n };\n Element.prototype.setTextConfig = function (cfg) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n extend(this.textConfig, cfg);\n this.markRedraw();\n };\n Element.prototype.removeTextConfig = function () {\n this.textConfig = null;\n this.markRedraw();\n };\n Element.prototype.removeTextContent = function () {\n var textEl = this._textContent;\n if (textEl) {\n textEl.attachedTransform = null;\n this._detachComponent(textEl);\n this._textContent = null;\n this._innerTextDefaultStyle = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextGuideLine = function () {\n return this._textGuide;\n };\n Element.prototype.setTextGuideLine = function (guideLine) {\n if (this._textGuide && this._textGuide !== guideLine) {\n this.removeTextGuideLine();\n }\n this._attachComponent(guideLine);\n this._textGuide = guideLine;\n this.markRedraw();\n };\n Element.prototype.removeTextGuideLine = function () {\n var textGuide = this._textGuide;\n if (textGuide) {\n this._detachComponent(textGuide);\n this._textGuide = null;\n this.markRedraw();\n }\n };\n Element.prototype.markRedraw = function () {\n this.__dirty |= Element.REDARAW_BIT;\n var zr = this.__zr;\n if (zr) {\n if (this.__inHover) {\n zr.refreshHover();\n }\n else {\n zr.refresh();\n }\n }\n if (this.__hostTarget) {\n this.__hostTarget.markRedraw();\n }\n };\n Element.prototype.dirty = function () {\n this.markRedraw();\n };\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\n this.__inHover = inHover;\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.__inHover = inHover;\n }\n if (textGuide) {\n textGuide.__inHover = inHover;\n }\n };\n Element.prototype.addSelfToZr = function (zr) {\n this.__zr = zr;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.addSelfToZr(zr);\n }\n if (this._textContent) {\n this._textContent.addSelfToZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.addSelfToZr(zr);\n }\n };\n Element.prototype.removeSelfFromZr = function (zr) {\n this.__zr = null;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.removeSelfFromZr(zr);\n }\n if (this._textContent) {\n this._textContent.removeSelfFromZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.removeSelfFromZr(zr);\n }\n };\n Element.prototype.animate = function (key, loop) {\n var target = key ? this[key] : this;\n if (!target) {\n logError('Property \"'\n + key\n + '\" is not existed in element '\n + this.id);\n return;\n }\n var animator = new Animator(target, loop);\n this.addAnimator(animator, key);\n return animator;\n };\n Element.prototype.addAnimator = function (animator, key) {\n var zr = this.__zr;\n var el = this;\n animator.during(function () {\n el.updateDuringAnimation(key);\n }).done(function () {\n var animators = el.animators;\n var idx = indexOf(animators, animator);\n if (idx >= 0) {\n animators.splice(idx, 1);\n }\n });\n this.animators.push(animator);\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n zr && zr.wakeUp();\n };\n Element.prototype.updateDuringAnimation = function (key) {\n this.markRedraw();\n };\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n var leftAnimators = [];\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n if (!scope || scope === animator.scope) {\n animator.stop(forwardToLast);\n }\n else {\n leftAnimators.push(animator);\n }\n }\n this.animators = leftAnimators;\n return this;\n };\n Element.prototype.animateTo = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps);\n };\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps, true);\n };\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\n var animators = animateTo(this, target, cfg, animationProps);\n for (var i = 0; i < animators.length; i++) {\n animators[i].__fromStateTransition = stateName;\n }\n };\n Element.prototype.getBoundingRect = function () {\n return null;\n };\n Element.prototype.getPaintRect = function () {\n return null;\n };\n Element.REDARAW_BIT = 1;\n Element.initDefaultProps = (function () {\n var elProto = Element.prototype;\n elProto.type = 'element';\n elProto.name = '';\n elProto.ignore = false;\n elProto.silent = false;\n elProto.isGroup = false;\n elProto.draggable = false;\n elProto.dragging = false;\n elProto.ignoreClip = false;\n elProto.__inHover = false;\n elProto.__dirty = Element.REDARAW_BIT;\n var logs = {};\n function logDeprecatedError(key, xKey, yKey) {\n if (!logs[key + xKey + yKey]) {\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\n logs[key + xKey + yKey] = true;\n }\n }\n function createLegacyProperty(key, privateKey, xKey, yKey) {\n Object.defineProperty(elProto, key, {\n get: function () {\n logDeprecatedError(key, xKey, yKey);\n if (!this[privateKey]) {\n var pos = this[privateKey] = [];\n enhanceArray(this, pos);\n }\n return this[privateKey];\n },\n set: function (pos) {\n logDeprecatedError(key, xKey, yKey);\n this[xKey] = pos[0];\n this[yKey] = pos[1];\n this[privateKey] = pos;\n enhanceArray(this, pos);\n }\n });\n function enhanceArray(self, pos) {\n Object.defineProperty(pos, 0, {\n get: function () {\n return self[xKey];\n },\n set: function (val) {\n self[xKey] = val;\n }\n });\n Object.defineProperty(pos, 1, {\n get: function () {\n return self[yKey];\n },\n set: function (val) {\n self[yKey] = val;\n }\n });\n }\n }\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n }\n })();\n return Element;\n}());\nmixin(Element, Eventful);\nmixin(Element, Transformable);\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\n cfg = cfg || {};\n var animators = [];\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\n var finishCount = animators.length;\n var doneHappened = false;\n var cfgDone = cfg.done;\n var cfgAborted = cfg.aborted;\n var doneCb = function () {\n doneHappened = true;\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n var abortedCb = function () {\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n if (!finishCount) {\n cfgDone && cfgDone();\n }\n if (animators.length > 0 && cfg.during) {\n animators[0].during(function (target, percent) {\n cfg.during(percent);\n });\n }\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i];\n if (doneCb) {\n animator.done(doneCb);\n }\n if (abortedCb) {\n animator.aborted(abortedCb);\n }\n animator.start(cfg.easing, cfg.force);\n }\n return animators;\n}\nfunction copyArrShallow(source, target, len) {\n for (var i = 0; i < len; i++) {\n source[i] = target[i];\n }\n}\nfunction is2DArray(value) {\n return isArrayLike(value[0]);\n}\nfunction copyValue(target, source, key) {\n if (isArrayLike(source[key])) {\n if (!isArrayLike(target[key])) {\n target[key] = [];\n }\n if (isTypedArray(source[key])) {\n var len = source[key].length;\n if (target[key].length !== len) {\n target[key] = new (source[key].constructor)(len);\n copyArrShallow(target[key], source[key], len);\n }\n }\n else {\n var sourceArr = source[key];\n var targetArr = target[key];\n var len0 = sourceArr.length;\n if (is2DArray(sourceArr)) {\n var len1 = sourceArr[0].length;\n for (var i = 0; i < len0; i++) {\n if (!targetArr[i]) {\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n }\n else {\n copyArrShallow(targetArr[i], sourceArr[i], len1);\n }\n }\n }\n else {\n copyArrShallow(targetArr, sourceArr, len0);\n }\n targetArr.length = sourceArr.length;\n }\n }\n else {\n target[key] = source[key];\n }\n}\nfunction animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\n var animatableKeys = [];\n var changedKeys = [];\n var targetKeys = keys(target);\n var duration = cfg.duration;\n var delay = cfg.delay;\n var additive = cfg.additive;\n var setToFinal = cfg.setToFinal;\n var animateAll = !isObject(animationProps);\n for (var k = 0; k < targetKeys.length; k++) {\n var innerKey = targetKeys[k];\n if (source[innerKey] != null\n && target[innerKey] != null\n && (animateAll || animationProps[innerKey])) {\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\n if (topKey) {\n if (!reverse) {\n source[innerKey] = target[innerKey];\n animatable.updateDuringAnimation(topKey);\n }\n continue;\n }\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\n }\n else {\n animatableKeys.push(innerKey);\n changedKeys.push(innerKey);\n }\n }\n else if (!reverse) {\n source[innerKey] = target[innerKey];\n animatable.updateDuringAnimation(topKey);\n changedKeys.push(innerKey);\n }\n }\n var keyLen = animatableKeys.length;\n if (keyLen > 0\n || (cfg.force && !animators.length)) {\n var existsAnimators = animatable.animators;\n var existsAnimatorsOnSameTarget = [];\n for (var i = 0; i < existsAnimators.length; i++) {\n if (existsAnimators[i].targetName === topKey) {\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\n }\n }\n if (!additive && existsAnimatorsOnSameTarget.length) {\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\n if (allAborted) {\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\n existsAnimators.splice(idx, 1);\n }\n }\n }\n var revertedSource = void 0;\n var reversedTarget = void 0;\n var sourceClone = void 0;\n if (reverse) {\n reversedTarget = {};\n if (setToFinal) {\n revertedSource = {};\n }\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animatableKeys[i];\n reversedTarget[innerKey] = source[innerKey];\n if (setToFinal) {\n revertedSource[innerKey] = target[innerKey];\n }\n else {\n source[innerKey] = target[innerKey];\n }\n }\n }\n else if (setToFinal) {\n sourceClone = {};\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animatableKeys[i];\n sourceClone[innerKey] = cloneValue(source[innerKey]);\n copyValue(source, target, innerKey);\n }\n }\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\n animator.targetName = topKey;\n if (cfg.scope) {\n animator.scope = cfg.scope;\n }\n if (setToFinal && revertedSource) {\n animator.whenWithKeys(0, revertedSource, animatableKeys);\n }\n if (sourceClone) {\n animator.whenWithKeys(0, sourceClone, animatableKeys);\n }\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\n animatable.addAnimator(animator, topKey);\n animators.push(animator);\n }\n}\nexport default Element;\n","var DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nvar DEFAULT_TMP_STORAGE_LENGTH = 256;\nfunction minRunLength(n) {\n var r = 0;\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n return n + r;\n}\nfunction makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n if (runHi === hi) {\n return 1;\n }\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n reverseRun(array, lo, runHi);\n }\n else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n return runHi - lo;\n}\nfunction reverseRun(array, lo, hi) {\n hi--;\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n for (; start < hi; start++) {\n var pivot = array[start];\n var left = lo;\n var right = start;\n var mid;\n while (left < right) {\n mid = left + right >>> 1;\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n }\n else {\n left = mid + 1;\n }\n }\n var n = start - left;\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n case 2:\n array[left + 2] = array[left + 1];\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n array[left] = pivot;\n }\n}\nfunction gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n }\n else {\n offset = m;\n }\n }\n return offset;\n}\nfunction gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n else {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n }\n else {\n lastOffset = m + 1;\n }\n }\n return offset;\n}\nfunction TimSort(array, compare) {\n var minGallop = DEFAULT_MIN_GALLOPING;\n var length = 0;\n var tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;\n var stackLength = 0;\n var runStart;\n var runLength;\n var stackSize = 0;\n length = array.length;\n if (length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {\n tmpStorageLength = length >>> 1;\n }\n var tmp = [];\n stackLength = length < 120 ? 5 : length < 1542 ? 10 : length < 119151 ? 19 : 40;\n runStart = [];\n runLength = [];\n function pushRun(_runStart, _runLength) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n }\n else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n mergeAt(n);\n }\n }\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n mergeAt(n);\n }\n }\n function mergeAt(i) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n runLength[i] = length1 + length2;\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n stackSize--;\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n if (length1 === 0) {\n return;\n }\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n if (length2 === 0) {\n return;\n }\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n }\n else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n function mergeLow(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n if (--length2 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n exit = true;\n break;\n }\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n if (--length1 === 1) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n minGallop < 1 && (minGallop = 1);\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n }\n else if (length1 === 0) {\n throw new Error();\n }\n else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n function mergeHigh(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n return;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n return;\n }\n var _minGallop = minGallop;\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n array[dest--] = tmp[cursor2--];\n if (--length2 === 1) {\n exit = true;\n break;\n }\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n if (minGallop < 1) {\n minGallop = 1;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n }\n else if (length2 === 0) {\n throw new Error();\n }\n else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n return {\n mergeRuns: mergeRuns,\n forceMergeRuns: forceMergeRuns,\n pushRun: pushRun\n };\n}\nexport default function sort(array, compare, lo, hi) {\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n var remaining = hi - lo;\n if (remaining < 2) {\n return;\n }\n var runLength = 0;\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n var ts = TimSort(array, compare);\n var minRun = minRunLength(remaining);\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n ts.forceMergeRuns();\n}\n","import * as util from './core/util';\nimport env from './core/env';\nimport Element from './Element';\nimport timsort from './core/timsort';\nvar invalidZErrorLogged = false;\nfunction logInvalidZError() {\n if (invalidZErrorLogged) {\n return;\n }\n invalidZErrorLogged = true;\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\nfunction shapeCompareFunc(a, b) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n return a.z2 - b.z2;\n }\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n}\nvar Storage = (function () {\n function Storage() {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n this.displayableSortFunc = shapeCompareFunc;\n }\n Storage.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n };\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\n includeIgnore = includeIgnore || false;\n var displayList = this._displayList;\n if (update || !displayList.length) {\n this.updateDisplayList(includeIgnore);\n }\n return displayList;\n };\n Storage.prototype.updateDisplayList = function (includeIgnore) {\n this._displayListLen = 0;\n var roots = this._roots;\n var displayList = this._displayList;\n for (var i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n displayList.length = this._displayListLen;\n env.canvasSupported && timsort(displayList, shapeCompareFunc);\n };\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n el.beforeUpdate();\n el.update();\n el.afterUpdate();\n var userSetClipPath = el.getClipPath();\n if (el.ignoreClip) {\n clipPaths = null;\n }\n else if (userSetClipPath) {\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n }\n else {\n clipPaths = [];\n }\n var currentClipPath = userSetClipPath;\n var parentClipPath = el;\n while (currentClipPath) {\n currentClipPath.parent = parentClipPath;\n currentClipPath.updateTransform();\n clipPaths.push(currentClipPath);\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.getClipPath();\n }\n }\n if (el.childrenRef) {\n var children = el.childrenRef();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (el.__dirty) {\n child.__dirty |= Element.REDARAW_BIT;\n }\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n }\n el.__dirty = 0;\n }\n else {\n var disp = el;\n if (clipPaths && clipPaths.length) {\n disp.__clipPaths = clipPaths;\n }\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\n disp.__clipPaths = [];\n }\n if (isNaN(disp.z)) {\n logInvalidZError();\n disp.z = 0;\n }\n if (isNaN(disp.z2)) {\n logInvalidZError();\n disp.z2 = 0;\n }\n if (isNaN(disp.zlevel)) {\n logInvalidZError();\n disp.zlevel = 0;\n }\n this._displayList[this._displayListLen++] = disp;\n }\n var decalEl = el.getDecalElement && el.getDecalElement();\n if (decalEl) {\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\n }\n var textGuide = el.getTextGuideLine();\n if (textGuide) {\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\n }\n var textEl = el.getTextContent();\n if (textEl) {\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\n }\n };\n Storage.prototype.addRoot = function (el) {\n if (el.__zr && el.__zr.storage === this) {\n return;\n }\n this._roots.push(el);\n };\n Storage.prototype.delRoot = function (el) {\n if (el instanceof Array) {\n for (var i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n return;\n }\n var idx = util.indexOf(this._roots, el);\n if (idx >= 0) {\n this._roots.splice(idx, 1);\n }\n };\n Storage.prototype.delAllRoots = function () {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n return;\n };\n Storage.prototype.getRoots = function () {\n return this._roots;\n };\n Storage.prototype.dispose = function () {\n this._displayList = null;\n this._roots = null;\n };\n return Storage;\n}());\nexport default Storage;\n","var requestAnimationFrame;\nrequestAnimationFrame = (typeof window !== 'undefined'\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame)) || function (func) {\n return setTimeout(func, 16);\n};\nexport default requestAnimationFrame;\n","import { __extends } from \"tslib\";\nimport Eventful from '../core/Eventful';\nimport requestAnimationFrame from './requestAnimationFrame';\nimport Animator from './Animator';\nvar Animation = (function (_super) {\n __extends(Animation, _super);\n function Animation(opts) {\n var _this = _super.call(this) || this;\n _this._running = false;\n _this._time = 0;\n _this._pausedTime = 0;\n _this._pauseStart = 0;\n _this._paused = false;\n opts = opts || {};\n _this.stage = opts.stage || {};\n _this.onframe = opts.onframe || function () { };\n return _this;\n }\n Animation.prototype.addClip = function (clip) {\n if (clip.animation) {\n this.removeClip(clip);\n }\n if (!this._clipsHead) {\n this._clipsHead = this._clipsTail = clip;\n }\n else {\n this._clipsTail.next = clip;\n clip.prev = this._clipsTail;\n clip.next = null;\n this._clipsTail = clip;\n }\n clip.animation = this;\n };\n Animation.prototype.addAnimator = function (animator) {\n animator.animation = this;\n var clip = animator.getClip();\n if (clip) {\n this.addClip(clip);\n }\n };\n Animation.prototype.removeClip = function (clip) {\n if (!clip.animation) {\n return;\n }\n var prev = clip.prev;\n var next = clip.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this._clipsHead = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this._clipsTail = prev;\n }\n clip.next = clip.prev = clip.animation = null;\n };\n Animation.prototype.removeAnimator = function (animator) {\n var clip = animator.getClip();\n if (clip) {\n this.removeClip(clip);\n }\n animator.animation = null;\n };\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\n var time = new Date().getTime() - this._pausedTime;\n var delta = time - this._time;\n var clip = this._clipsHead;\n while (clip) {\n var nextClip = clip.next;\n var finished = clip.step(time, delta);\n if (finished) {\n clip.ondestroy && clip.ondestroy();\n this.removeClip(clip);\n clip = nextClip;\n }\n else {\n clip = nextClip;\n }\n }\n this._time = time;\n if (!notTriggerFrameAndStageUpdate) {\n this.onframe(delta);\n this.trigger('frame', delta);\n this.stage.update && this.stage.update();\n }\n };\n Animation.prototype._startLoop = function () {\n var self = this;\n this._running = true;\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self.update();\n }\n }\n requestAnimationFrame(step);\n };\n Animation.prototype.start = function () {\n if (this._running) {\n return;\n }\n this._time = new Date().getTime();\n this._pausedTime = 0;\n this._startLoop();\n };\n Animation.prototype.stop = function () {\n this._running = false;\n };\n Animation.prototype.pause = function () {\n if (!this._paused) {\n this._pauseStart = new Date().getTime();\n this._paused = true;\n }\n };\n Animation.prototype.resume = function () {\n if (this._paused) {\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\n this._paused = false;\n }\n };\n Animation.prototype.clear = function () {\n var clip = this._clipsHead;\n while (clip) {\n var nextClip = clip.next;\n clip.prev = clip.next = clip.animation = null;\n clip = nextClip;\n }\n this._clipsHead = this._clipsTail = null;\n };\n Animation.prototype.isFinished = function () {\n return this._clipsHead == null;\n };\n Animation.prototype.animate = function (target, options) {\n options = options || {};\n this.start();\n var animator = new Animator(target, options.loop);\n this.addAnimator(animator);\n return animator;\n };\n return Animation;\n}(Eventful));\nexport default Animation;\n","import { __extends } from \"tslib\";\nimport { addEventListener, removeEventListener, normalizeEvent, getNativeEvent } from '../core/event';\nimport * as zrUtil from '../core/util';\nimport Eventful from '../core/Eventful';\nimport env from '../core/env';\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\nvar localNativeListenerNames = (function () {\n var mouseHandlerNames = [\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n ];\n var touchHandlerNames = [\n 'touchstart', 'touchend', 'touchmove'\n ];\n var pointerEventNameMap = {\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n})();\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\nvar wheelEventSupported = false;\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n}\nfunction setTouchTimer(scope) {\n scope.touching = true;\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n}\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n}\nfunction normalizeGlobalEvent(instance, event) {\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n while (elTmp && elTmp.nodeType !== 9\n && !(isLocal = elTmp.domBelongToZr\n || (elTmp !== el && elTmp === instance.painterRoot))) {\n elTmp = elTmp.parentNode;\n }\n return isLocal;\n}\nvar FakeGlobalEvent = (function () {\n function FakeGlobalEvent(instance, event) {\n this.stopPropagation = zrUtil.noop;\n this.stopImmediatePropagation = zrUtil.noop;\n this.preventDefault = zrUtil.noop;\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType;\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n }\n return FakeGlobalEvent;\n}());\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this.__mayPointerCapture;\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n this.__togglePointerCapture(true);\n }\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event);\n var element = event.toElement || event.relatedTarget;\n if (!isLocalEl(this, element)) {\n if (this.__pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n }\n this.trigger('mouseout', event);\n }\n },\n wheel: function (event) {\n wheelEventSupported = true;\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n mousewheel: function (event) {\n if (wheelEventSupported) {\n return;\n }\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n touchstart: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.__lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start');\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change');\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event);\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event);\n },\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\nvar globalDOMHandlers = {\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this.__pointerCapturing;\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n if (env.pointerEventsSupported) {\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n });\n });\n }\n else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n });\n }\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n if (!scope.touching) {\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\nfunction mountGlobalDOMEventListeners(instance, scope) {\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n }\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event);\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\n }\n}\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n scope.mounted = {};\n}\nvar DOMHandlerScope = (function () {\n function DOMHandlerScope(domTarget, domHandlers) {\n this.mounted = {};\n this.listenerOpts = {};\n this.touching = false;\n this.domTarget = domTarget;\n this.domHandlers = domHandlers;\n }\n return DOMHandlerScope;\n}());\nvar HandlerDomProxy = (function (_super) {\n __extends(HandlerDomProxy, _super);\n function HandlerDomProxy(dom, painterRoot) {\n var _this = _super.call(this) || this;\n _this.__pointerCapturing = false;\n _this.dom = dom;\n _this.painterRoot = painterRoot;\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n if (globalEventSupported) {\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\n return _this;\n }\n HandlerDomProxy.prototype.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n };\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n };\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\n this.__mayPointerCapture = null;\n if (globalEventSupported\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\n this.__pointerCapturing = isPointerCapturing;\n var globalHandlerScope = this._globalHandlerScope;\n isPointerCapturing\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n : unmountDOMEventListeners(globalHandlerScope);\n }\n };\n return HandlerDomProxy;\n}(Eventful));\nexport default HandlerDomProxy;\n","import { __extends } from \"tslib\";\nimport * as zrUtil from '../core/util';\nimport Element from '../Element';\nimport BoundingRect from '../core/BoundingRect';\nvar Group = (function (_super) {\n __extends(Group, _super);\n function Group(opts) {\n var _this = _super.call(this) || this;\n _this.isGroup = true;\n _this._children = [];\n _this.attr(opts);\n return _this;\n }\n Group.prototype.childrenRef = function () {\n return this._children;\n };\n Group.prototype.children = function () {\n return this._children.slice();\n };\n Group.prototype.childAt = function (idx) {\n return this._children[idx];\n };\n Group.prototype.childOfName = function (name) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n };\n Group.prototype.childCount = function () {\n return this._children.length;\n };\n Group.prototype.add = function (child) {\n if (child) {\n if (child !== this && child.parent !== this) {\n this._children.push(child);\n this._doAdd(child);\n }\n if (child.__hostTarget) {\n throw 'This elemenet has been used as an attachment';\n }\n }\n return this;\n };\n Group.prototype.addBefore = function (child, nextSibling) {\n if (child && child !== this && child.parent !== this\n && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n if (idx >= 0) {\n children.splice(idx, 0, child);\n this._doAdd(child);\n }\n }\n return this;\n };\n Group.prototype.replaceAt = function (child, index) {\n var children = this._children;\n var old = children[index];\n if (child && child !== this && child.parent !== this && child !== old) {\n children[index] = child;\n old.parent = null;\n var zr = this.__zr;\n if (zr) {\n old.removeSelfFromZr(zr);\n }\n this._doAdd(child);\n }\n return this;\n };\n Group.prototype._doAdd = function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n child.parent = this;\n var zr = this.__zr;\n if (zr && zr !== child.__zr) {\n child.addSelfToZr(zr);\n }\n zr && zr.refresh();\n };\n Group.prototype.remove = function (child) {\n var zr = this.__zr;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n if (idx < 0) {\n return this;\n }\n children.splice(idx, 1);\n child.parent = null;\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n zr && zr.refresh();\n return this;\n };\n Group.prototype.removeAll = function () {\n var children = this._children;\n var zr = this.__zr;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n child.parent = null;\n }\n children.length = 0;\n return this;\n };\n Group.prototype.eachChild = function (cb, context) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n return this;\n };\n Group.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n var stopped = cb.call(context, child);\n if (child.isGroup && !stopped) {\n child.traverse(cb, context);\n }\n }\n return this;\n };\n Group.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.addSelfToZr(zr);\n }\n };\n Group.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.removeSelfFromZr(zr);\n }\n };\n Group.prototype.getBoundingRect = function (includeChildren) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.ignore || child.invisible) {\n continue;\n }\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n BoundingRect.applyTransform(tmpRect, childRect, transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n return rect || tmpRect;\n };\n return Group;\n}(Element));\nGroup.prototype.type = 'group';\nexport default Group;\n","/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nimport env from './core/env';\nimport * as zrUtil from './core/util';\nimport Handler from './Handler';\nimport Storage from './Storage';\nimport Animation from './animation/Animation';\nimport HandlerProxy from './dom/HandlerProxy';\nimport { lum } from './tool/color';\nimport { DARK_MODE_THRESHOLD } from './config';\nimport Group from './graphic/Group';\nvar useVML = !env.canvasSupported;\nvar painterCtors = {};\nvar instances = {};\nfunction delInstance(id) {\n delete instances[id];\n}\nfunction isDarkMode(backgroundColor) {\n if (!backgroundColor) {\n return false;\n }\n if (typeof backgroundColor === 'string') {\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n }\n else if (backgroundColor.colorStops) {\n var colorStops = backgroundColor.colorStops;\n var totalLum = 0;\n var len = colorStops.length;\n for (var i = 0; i < len; i++) {\n totalLum += lum(colorStops[i].color, 1);\n }\n totalLum /= len;\n return totalLum < DARK_MODE_THRESHOLD;\n }\n return false;\n}\nvar ZRender = (function () {\n function ZRender(id, dom, opts) {\n var _this = this;\n this._sleepAfterStill = 10;\n this._stillFrameAccum = 0;\n this._needsRefresh = true;\n this._needsRefreshHover = true;\n this._darkMode = false;\n opts = opts || {};\n this.dom = dom;\n this.id = id;\n var storage = new Storage();\n var rendererType = opts.renderer || 'canvas';\n if (useVML) {\n throw new Error('IE8 support has been dropped since 5.0');\n }\n if (!painterCtors[rendererType]) {\n rendererType = zrUtil.keys(painterCtors)[0];\n }\n if (!painterCtors[rendererType]) {\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\n }\n opts.useDirtyRect = opts.useDirtyRect == null\n ? false\n : opts.useDirtyRect;\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\n this.storage = storage;\n this.painter = painter;\n var handerProxy = (!env.node && !env.worker)\n ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n : null;\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\n this.animation = new Animation({\n stage: {\n update: function () { return _this._flush(true); }\n }\n });\n this.animation.start();\n }\n ZRender.prototype.add = function (el) {\n if (!el) {\n return;\n }\n this.storage.addRoot(el);\n el.addSelfToZr(this);\n this.refresh();\n };\n ZRender.prototype.remove = function (el) {\n if (!el) {\n return;\n }\n this.storage.delRoot(el);\n el.removeSelfFromZr(this);\n this.refresh();\n };\n ZRender.prototype.configLayer = function (zLevel, config) {\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n this.refresh();\n };\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n this.refresh();\n this._backgroundColor = backgroundColor;\n this._darkMode = isDarkMode(backgroundColor);\n };\n ZRender.prototype.getBackgroundColor = function () {\n return this._backgroundColor;\n };\n ZRender.prototype.setDarkMode = function (darkMode) {\n this._darkMode = darkMode;\n };\n ZRender.prototype.isDarkMode = function () {\n return this._darkMode;\n };\n ZRender.prototype.refreshImmediately = function (fromInside) {\n if (!fromInside) {\n this.animation.update(true);\n }\n this._needsRefresh = false;\n this.painter.refresh();\n this._needsRefresh = false;\n };\n ZRender.prototype.refresh = function () {\n this._needsRefresh = true;\n this.animation.start();\n };\n ZRender.prototype.flush = function () {\n this._flush(false);\n };\n ZRender.prototype._flush = function (fromInside) {\n var triggerRendered;\n var start = new Date().getTime();\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately(fromInside);\n }\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n var end = new Date().getTime();\n if (triggerRendered) {\n this._stillFrameAccum = 0;\n this.trigger('rendered', {\n elapsedTime: end - start\n });\n }\n else if (this._sleepAfterStill > 0) {\n this._stillFrameAccum++;\n if (this._stillFrameAccum > this._sleepAfterStill) {\n this.animation.stop();\n }\n }\n };\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\n this._sleepAfterStill = stillFramesCount;\n };\n ZRender.prototype.wakeUp = function () {\n this.animation.start();\n this._stillFrameAccum = 0;\n };\n ZRender.prototype.addHover = function (el) {\n };\n ZRender.prototype.removeHover = function (el) {\n };\n ZRender.prototype.clearHover = function () {\n };\n ZRender.prototype.refreshHover = function () {\n this._needsRefreshHover = true;\n };\n ZRender.prototype.refreshHoverImmediately = function () {\n this._needsRefreshHover = false;\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n this.painter.refreshHover();\n }\n };\n ZRender.prototype.resize = function (opts) {\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n };\n ZRender.prototype.clearAnimation = function () {\n this.animation.clear();\n };\n ZRender.prototype.getWidth = function () {\n return this.painter.getWidth();\n };\n ZRender.prototype.getHeight = function () {\n return this.painter.getHeight();\n };\n ZRender.prototype.pathToImage = function (e, dpr) {\n if (this.painter.pathToImage) {\n return this.painter.pathToImage(e, dpr);\n }\n };\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\n this.handler.setCursorStyle(cursorStyle);\n };\n ZRender.prototype.findHover = function (x, y) {\n return this.handler.findHover(x, y);\n };\n ZRender.prototype.on = function (eventName, eventHandler, context) {\n this.handler.on(eventName, eventHandler, context);\n return this;\n };\n ZRender.prototype.off = function (eventName, eventHandler) {\n this.handler.off(eventName, eventHandler);\n };\n ZRender.prototype.trigger = function (eventName, event) {\n this.handler.trigger(eventName, event);\n };\n ZRender.prototype.clear = function () {\n var roots = this.storage.getRoots();\n for (var i = 0; i < roots.length; i++) {\n if (roots[i] instanceof Group) {\n roots[i].removeSelfFromZr(this);\n }\n }\n this.storage.delAllRoots();\n this.painter.clear();\n };\n ZRender.prototype.dispose = function () {\n this.animation.stop();\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n this.animation =\n this.storage =\n this.painter =\n this.handler = null;\n delInstance(this.id);\n };\n return ZRender;\n}());\nexport function init(dom, opts) {\n var zr = new ZRender(zrUtil.guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\nexport function dispose(zr) {\n zr.dispose();\n}\nexport function disposeAll() {\n for (var key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n instances = {};\n}\nexport function getInstance(id) {\n return instances[id];\n}\nexport function registerPainter(name, Ctor) {\n painterCtors[name] = Ctor;\n}\nexport var version = '5.1.0';\n;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The method \"quantile\" was copied from \"d3.js\".\n* (See more details in the comment of the method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar RADIAN_EPSILON = 1e-4;\n\nfunction _trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n/**\n * Linear mapping a value from domain to range\n * @param val\n * @param domain Domain extent domain[0] can be bigger than domain[1]\n * @param range Range extent range[0] can be bigger than range[1]\n * @param clamp Default to be false\n */\n\n\nexport function linearMap(val, domain, range, clamp) {\n var subDomain = domain[1] - domain[0];\n var subRange = range[1] - range[0];\n\n if (subDomain === 0) {\n return subRange === 0 ? range[0] : (range[0] + range[1]) / 2;\n } // Avoid accuracy problem in edge, such as\n // 146.39 - 62.83 === 83.55999999999999.\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n // It is a little verbose for efficiency considering this method\n // is a hotspot.\n\n\n if (clamp) {\n if (subDomain > 0) {\n if (val <= domain[0]) {\n return range[0];\n } else if (val >= domain[1]) {\n return range[1];\n }\n } else {\n if (val >= domain[0]) {\n return range[0];\n } else if (val <= domain[1]) {\n return range[1];\n }\n }\n } else {\n if (val === domain[0]) {\n return range[0];\n }\n\n if (val === domain[1]) {\n return range[1];\n }\n }\n\n return (val - domain[0]) / subDomain * subRange + range[0];\n}\n/**\n * Convert a percent string to absolute number.\n * Returns NaN if percent is not a valid string or number\n */\n\nexport function parsePercent(percent, all) {\n switch (percent) {\n case 'center':\n case 'middle':\n percent = '50%';\n break;\n\n case 'left':\n case 'top':\n percent = '0%';\n break;\n\n case 'right':\n case 'bottom':\n percent = '100%';\n break;\n }\n\n if (typeof percent === 'string') {\n if (_trim(percent).match(/%$/)) {\n return parseFloat(percent) / 100 * all;\n }\n\n return parseFloat(percent);\n }\n\n return percent == null ? NaN : +percent;\n}\nexport function round(x, precision, returnStr) {\n if (precision == null) {\n precision = 10;\n } // Avoid range error\n\n\n precision = Math.min(Math.max(0, precision), 20);\n x = (+x).toFixed(precision);\n return returnStr ? x : +x;\n}\n/**\n * Inplacd asc sort arr.\n * The input arr will be modified.\n */\n\nexport function asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}\n/**\n * Get precision\n */\n\nexport function getPrecision(val) {\n val = +val;\n\n if (isNaN(val)) {\n return 0;\n } // It is much faster than methods converting number to string as follows\n // let tmp = val.toString();\n // return tmp.length - 1 - tmp.indexOf('.');\n // especially when precision is low\n\n\n var e = 1;\n var count = 0;\n\n while (Math.round(val * e) / e !== val) {\n e *= 10;\n count++;\n }\n\n return count;\n}\n/**\n * Get precision with slow but safe method\n */\n\nexport function getPrecisionSafe(val) {\n var str = val.toString(); // Consider scientific notation: '3.4e-12' '3.4e+12'\n\n var eIndex = str.indexOf('e');\n\n if (eIndex > 0) {\n var precision = +str.slice(eIndex + 1);\n return precision < 0 ? -precision : 0;\n } else {\n var dotIndex = str.indexOf('.');\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\n }\n}\n/**\n * Minimal dicernible data precisioin according to a single pixel.\n */\n\nexport function getPixelPrecision(dataExtent, pixelExtent) {\n var log = Math.log;\n var LN10 = Math.LN10;\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20.\n\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n return !isFinite(precision) ? 20 : precision;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainer method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param valueList a list of all data\n * @param idx index of the data to be processed in valueList\n * @param precision integer number showing digits of precision\n * @return percent ranging from 0 to 100\n */\n\nexport function getPercentWithPrecision(valueList, idx, precision) {\n if (!valueList[idx]) {\n return 0;\n }\n\n var sum = zrUtil.reduce(valueList, function (acc, val) {\n return acc + (isNaN(val) ? 0 : val);\n }, 0);\n\n if (sum === 0) {\n return 0;\n }\n\n var digits = Math.pow(10, precision);\n var votesPerQuota = zrUtil.map(valueList, function (val) {\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\n });\n var targetSeats = digits * 100;\n var seats = zrUtil.map(votesPerQuota, function (votes) {\n // Assign automatic seats.\n return Math.floor(votes);\n });\n var currentSum = zrUtil.reduce(seats, function (acc, val) {\n return acc + val;\n }, 0);\n var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n return votes - seats[idx];\n }); // Has remainding votes.\n\n while (currentSum < targetSeats) {\n // Find next largest remainder.\n var max = Number.NEGATIVE_INFINITY;\n var maxId = null;\n\n for (var i = 0, len = remainder.length; i < len; ++i) {\n if (remainder[i] > max) {\n max = remainder[i];\n maxId = i;\n }\n } // Add a vote to max remainder.\n\n\n ++seats[maxId];\n remainder[maxId] = 0;\n ++currentSum;\n }\n\n return seats[idx] / digits;\n} // Number.MAX_SAFE_INTEGER, ie do not support.\n\nexport var MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * To 0 - 2 * PI, considering negative radian.\n */\n\nexport function remRadian(radian) {\n var pi2 = Math.PI * 2;\n return (radian % pi2 + pi2) % pi2;\n}\n/**\n * @param {type} radian\n * @return {boolean}\n */\n\nexport function isRadianAroundZero(val) {\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n} // eslint-disable-next-line\n\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n\n/**\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\n * These values can be accepted:\n * + An instance of Date, represent a time in its own time zone.\n * + Or string in a subset of ISO 8601, only including:\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\n * all of which will be treated as local time if time zone is not specified\n * (see <https://momentjs.com/>).\n * + Or other string format, including (all of which will be treated as loacal time):\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\n * + a timestamp, which represent a time in UTC.\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\n */\n\nexport function parseDate(value) {\n if (value instanceof Date) {\n return value;\n } else if (typeof value === 'string') {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n var match = TIME_REG.exec(value);\n\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n } // Use local time when no timezone offset specifed.\n\n\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\n } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n else {\n var hour = +match[4] || 0;\n\n if (match[8].toUpperCase() !== 'Z') {\n hour -= +match[8].slice(0, 3);\n }\n\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\n }\n } else if (value == null) {\n return new Date(NaN);\n }\n\n return new Date(Math.round(value));\n}\n/**\n * Quantity of a number. e.g. 0.1, 1, 10, 100\n *\n * @param val\n * @return\n */\n\nexport function quantity(val) {\n return Math.pow(10, quantityExponent(val));\n}\n/**\n * Exponent of the quantity of a number\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\n *\n * @param val non-negative value\n * @return\n */\n\nexport function quantityExponent(val) {\n if (val === 0) {\n return 0;\n }\n\n var exp = Math.floor(Math.log(val) / Math.LN10);\n /**\n * exp is expected to be the rounded-down result of the base-10 log of val.\n * But due to the precision loss with Math.log(val), we need to restore it\n * using 10^exp to make sure we can get val back from exp. #11249\n */\n\n if (val / Math.pow(10, exp) >= 10) {\n exp++;\n }\n\n return exp;\n}\n/**\n * find a “nice” number approximately equal to x. Round the number if round = true,\n * take ceiling if round = false. The primary observation is that the “nicest”\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\n *\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\n *\n * @param val Non-negative value.\n * @param round\n * @return Niced number\n */\n\nexport function nice(val, round) {\n var exponent = quantityExponent(val);\n var exp10 = Math.pow(10, exponent);\n var f = val / exp10; // 1 <= f < 10\n\n var nf;\n\n if (round) {\n if (f < 1.5) {\n nf = 1;\n } else if (f < 2.5) {\n nf = 2;\n } else if (f < 4) {\n nf = 3;\n } else if (f < 7) {\n nf = 5;\n } else {\n nf = 10;\n }\n } else {\n if (f < 1) {\n nf = 1;\n } else if (f < 2) {\n nf = 2;\n } else if (f < 3) {\n nf = 3;\n } else if (f < 5) {\n nf = 5;\n } else {\n nf = 10;\n }\n }\n\n val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n // 20 is the uppper bound of toFixed.\n\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\n * This code was copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.\n * See the license statement at the head of this file.\n * @param ascArr\n */\n\nexport function quantile(ascArr, p) {\n var H = (ascArr.length - 1) * p + 1;\n var h = Math.floor(H);\n var v = +ascArr[h - 1];\n var e = H - h;\n return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\n * Order intervals asc, and split them when overlap.\n * expect(numberUtil.reformIntervals([\n * {interval: [18, 62], close: [1, 1]},\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [1, 1]},\n * {interval: [62, 150], close: [1, 1]},\n * {interval: [106, 150], close: [1, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ])).toEqual([\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [0, 1]},\n * {interval: [18, 62], close: [0, 1]},\n * {interval: [62, 150], close: [0, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ]);\n * @param list, where `close` mean open or close\n * of the interval, and Infinity can be used.\n * @return The origin list, which has been reformed.\n */\n\nexport function reformIntervals(list) {\n list.sort(function (a, b) {\n return littleThan(a, b, 0) ? -1 : 1;\n });\n var curr = -Infinity;\n var currClose = 1;\n\n for (var i = 0; i < list.length;) {\n var interval = list[i].interval;\n var close_1 = list[i].close;\n\n for (var lg = 0; lg < 2; lg++) {\n if (interval[lg] <= curr) {\n interval[lg] = curr;\n close_1[lg] = !lg ? 1 - currClose : 1;\n }\n\n curr = interval[lg];\n currClose = close_1[lg];\n }\n\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\n list.splice(i, 1);\n } else {\n i++;\n }\n }\n\n return list;\n\n function littleThan(a, b, lg) {\n return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1));\n }\n}\n/**\n * [Numberic is defined as]:\n * `parseFloat(val) == val`\n * For example:\n * numeric:\n * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\n * and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\n * not-numeric:\n * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\n * empty string, string with only white-spaces or line-terminal (see es spec),\n * 0x12, '0x12', '-0x12', 012, '012', '-012',\n * non-string, ...\n *\n * @test See full test cases in `test/ut/spec/util/number.js`.\n * @return Must be a typeof number. If not numeric, return NaN.\n */\n\nexport function numericToNumber(val) {\n var valFloat = parseFloat(val);\n return valFloat == val // eslint-disable-line eqeqeq\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0) // For case ' 0x0 '.\n ? valFloat : NaN;\n}\n/**\n * Definition of \"numeric\": see `numericToNumber`.\n */\n\nexport function isNumeric(val) {\n return !isNaN(numericToNumber(val));\n}\n/**\n * Use random base to prevent users hard code depending on\n * this auto generated marker id.\n * @return An positive integer.\n */\n\nexport function getRandomIdBase() {\n return Math.round(Math.random() * 9);\n}\n/**\n * Get the greatest common dividor\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\n\nexport function getGreatestCommonDividor(a, b) {\n if (b === 0) {\n return a;\n }\n\n return getGreatestCommonDividor(b, a % b);\n}\n/**\n * Get the least common multiple\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\n\nexport function getLeastCommonMultiple(a, b) {\n if (a == null) {\n return b;\n }\n\n if (b == null) {\n return a;\n }\n\n return a * b / getGreatestCommonDividor(a, b);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isObject, isArray, createHashMap, map, assert, isString, indexOf, isStringSafe } from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport { isNumeric, getRandomIdBase, getPrecisionSafe, round } from './number';\nimport { interpolateNumber } from 'zrender/lib/animation/Animator';\nimport { warn } from './log';\n/**\n * Make the name displayable. But we should\n * make sure it is not duplicated with user\n * specified name, so use '\\0';\n */\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\n/**\n * If value is not array, then translate it to array.\n * @param {*} value\n * @return {Array} [value] or value\n */\n\nexport function normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\n * Sync default option between normal and emphasis like `position` and `show`\n * In case some one will write code like\n * label: {\n * show: false,\n * position: 'outside',\n * fontSize: 18\n * },\n * emphasis: {\n * label: { show: true }\n * }\n */\n\nexport function defaultEmphasis(opt, key, subOpts) {\n // Caution: performance sensitive.\n if (opt) {\n opt[key] = opt[key] || {};\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal\n\n for (var i = 0, len = subOpts.length; i < len; i++) {\n var subOptName = subOpts[i];\n\n if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {\n opt.emphasis[key][subOptName] = opt[key][subOptName];\n }\n }\n }\n}\nexport var TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding']; // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\n// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\n// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\n// // FIXME: deprecated, check and remove it.\n// 'textStyle'\n// ]);\n\n/**\n * The method do not ensure performance.\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method retieves value from data.\n */\n\nexport function getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method determine if dataItem has extra option besides value\n */\n\nexport function isDataItemOption(dataItem) {\n return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array\n // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\n}\n;\n/**\n * Mapping to existings for merge.\n *\n * Mode \"normalMege\":\n * The mapping result (merge result) will keep the order of the existing\n * component, rather than the order of new option. Because we should ensure\n * some specified index reference (like xAxisIndex) keep work.\n * And in most cases, \"merge option\" is used to update partial option but not\n * be expected to change the order.\n *\n * Mode \"replaceMege\":\n * (1) Only the id mapped components will be merged.\n * (2) Other existing components (except internal compoonets) will be removed.\n * (3) Other new options will be used to create new component.\n * (4) The index of the existing compoents will not be modified.\n * That means their might be \"hole\" after the removal.\n * The new components are created first at those available index.\n *\n * Mode \"replaceAll\":\n * This mode try to support that reproduce an echarts instance from another\n * echarts instance (via `getOption`) in some simple cases.\n * In this senario, the `result` index are exactly the consistent with the `newCmptOptions`,\n * which ensures the compoennt index referring (like `xAxisIndex: ?`) corrent. That is,\n * the \"hole\" in `newCmptOptions` will also be kept.\n * On the contrary, other modes try best to eliminate holes.\n * PENDING: This is an experimental mode yet.\n *\n * @return See the comment of <MappingResult>.\n */\n\nexport function mappingToExists(existings, newCmptOptions, mode) {\n var isNormalMergeMode = mode === 'normalMerge';\n var isReplaceMergeMode = mode === 'replaceMerge';\n var isReplaceAllMode = mode === 'replaceAll';\n existings = existings || [];\n newCmptOptions = (newCmptOptions || []).slice();\n var existingIdIdxMap = createHashMap(); // Validate id and name on user input option.\n\n each(newCmptOptions, function (cmptOption, index) {\n if (!isObject(cmptOption)) {\n newCmptOptions[index] = null;\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // There is some legacy case that name is set as `false`.\n // But should work normally rather than throw error.\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\n warnInvalidateIdOrName(cmptOption.id);\n }\n\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\n warnInvalidateIdOrName(cmptOption.name);\n }\n }\n });\n var result = prepareResult(existings, existingIdIdxMap, mode);\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\n }\n\n if (isNormalMergeMode) {\n mappingByName(result, newCmptOptions);\n }\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\n } else if (isReplaceAllMode) {\n mappingInReplaceAllMode(result, newCmptOptions);\n }\n\n makeIdAndName(result); // The array `result` MUST NOT contain elided items, otherwise the\n // forEach will ommit those items and result in incorrect result.\n\n return result;\n}\n\nfunction prepareResult(existings, existingIdIdxMap, mode) {\n var result = [];\n\n if (mode === 'replaceAll') {\n return result;\n } // Do not use native `map` to in case that the array `existings`\n // contains elided items, which will be ommited.\n\n\n for (var index = 0; index < existings.length; index++) {\n var existing = existings[index]; // Because of replaceMerge, `existing` may be null/undefined.\n\n if (existing && existing.id != null) {\n existingIdIdxMap.set(existing.id, index);\n } // For non-internal-componnets:\n // Mode \"normalMerge\": all existings kept.\n // Mode \"replaceMerge\": all existing removed unless mapped by id.\n // For internal-components:\n // go with \"replaceMerge\" approach in both mode.\n\n\n result.push({\n existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing,\n newOption: null,\n keyInfo: null,\n brandNew: null\n });\n }\n\n return result;\n}\n\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\n // Mapping by id if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.id == null) {\n return;\n }\n\n var optionId = makeComparableKey(cmptOption.id);\n var existingIdx = existingIdIdxMap.get(optionId);\n\n if (existingIdx != null) {\n var resultItem = result[existingIdx];\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\n resultItem.newOption = cmptOption; // In both mode, if id matched, new option will be merged to\n // the existings rather than creating new component model.\n\n resultItem.existing = existings[existingIdx];\n newCmptOptions[index] = null;\n }\n });\n}\n\nfunction mappingByName(result, newCmptOptions) {\n // Mapping by name if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.name == null) {\n return;\n }\n\n for (var i = 0; i < result.length; i++) {\n var existing = result[i].existing;\n\n if (!result[i].newOption // Consider name: two map to one.\n // Can not match when both ids existing but different.\n && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) {\n result[i].newOption = cmptOption;\n newCmptOptions[index] = null;\n return;\n }\n }\n });\n}\n\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\n each(newCmptOptions, function (cmptOption) {\n if (!cmptOption) {\n return;\n } // Find the first place that not mapped by id and not internal component (consider the \"hole\").\n\n\n var resultItem;\n var nextIdx = 0;\n\n while ( // Be `!resultItem` only when `nextIdx >= result.length`.\n (resultItem = result[nextIdx]) && ( // (1) Existing models that already have id should be able to mapped to. Because\n // after mapping performed, model will always be assigned with an id if user not given.\n // After that all models have id.\n // (2) If new option has id, it can only set to a hole or append to the last. It should\n // not be merged to the existings with different id. Because id should not be overwritten.\n // (3) Name can be overwritten, because axis use name as 'show label text'.\n resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\n resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) {\n nextIdx++;\n }\n\n if (resultItem) {\n resultItem.newOption = cmptOption;\n resultItem.brandNew = brandNew;\n } else {\n result.push({\n newOption: cmptOption,\n brandNew: brandNew,\n existing: null,\n keyInfo: null\n });\n }\n\n nextIdx++;\n });\n}\n\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\n each(newCmptOptions, function (cmptOption) {\n // The feature \"reproduce\" requires \"hole\" will also reproduced\n // in case that compoennt index referring are broken.\n result.push({\n newOption: cmptOption,\n brandNew: true,\n existing: null,\n keyInfo: null\n });\n });\n}\n/**\n * Make id and name for mapping result (result of mappingToExists)\n * into `keyInfo` field.\n */\n\n\nfunction makeIdAndName(mapResult) {\n // We use this id to hash component models and view instances\n // in echarts. id can be specified by user, or auto generated.\n // The id generation rule ensures new view instance are able\n // to mapped to old instance when setOption are called in\n // no-merge mode. So we generate model id by name and plus\n // type in view id.\n // name can be duplicated among components, which is convenient\n // to specify multi components (like series) by one name.\n // Ensure that each id is distinct.\n var idMap = createHashMap();\n each(mapResult, function (item) {\n var existing = item.existing;\n existing && idMap.set(existing.id, item);\n });\n each(mapResult, function (item) {\n var opt = item.newOption; // Force ensure id not duplicated.\n\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\n opt && opt.id != null && idMap.set(opt.id, item);\n !item.keyInfo && (item.keyInfo = {});\n }); // Make name and id.\n\n each(mapResult, function (item, index) {\n var existing = item.existing;\n var opt = item.newOption;\n var keyInfo = item.keyInfo;\n\n if (!isObject(opt)) {\n return;\n } // name can be overwitten. Consider case: axis.name = '20km'.\n // But id generated by name will not be changed, which affect\n // only in that case: setOption with 'not merge mode' and view\n // instance will be recreated, which can be accepted.\n\n\n keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name // Avoid diffferent series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n\n if (existing) {\n keyInfo.id = makeComparableKey(existing.id);\n } else if (opt.id != null) {\n keyInfo.id = makeComparableKey(opt.id);\n } else {\n // Consider this situatoin:\n // optionA: [{name: 'a'}, {name: 'a'}, {..}]\n // optionB [{..}, {name: 'a'}, {name: 'a'}]\n // Series with the same name between optionA and optionB\n // should be mapped.\n var idNum = 0;\n\n do {\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\n } while (idMap.get(keyInfo.id));\n }\n\n idMap.set(keyInfo.id, item);\n });\n}\n\nfunction keyExistAndEqual(attr, obj1, obj2) {\n var key1 = convertOptionIdName(obj1[attr], null);\n var key2 = convertOptionIdName(obj2[attr], null); // See `MappingExistingItem`. `id` and `name` trade string equals to number.\n\n return key1 != null && key2 != null && key1 === key2;\n}\n/**\n * @return return null if not exist.\n */\n\n\nfunction makeComparableKey(val) {\n if (process.env.NODE_ENV !== 'production') {\n if (val == null) {\n throw new Error();\n }\n }\n\n return convertOptionIdName(val, '');\n}\n\nexport function convertOptionIdName(idOrName, defaultValue) {\n if (idOrName == null) {\n return defaultValue;\n }\n\n var type = typeof idOrName;\n return type === 'string' ? idOrName : type === 'number' || isStringSafe(idOrName) ? idOrName + '' : defaultValue;\n}\n\nfunction warnInvalidateIdOrName(idOrName) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\n }\n}\n\nfunction isValidIdOrName(idOrName) {\n return isStringSafe(idOrName) || isNumeric(idOrName);\n}\n\nexport function isNameSpecified(componentModel) {\n var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0.\n\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\n}\n/**\n * @public\n * @param {Object} cmptOption\n * @return {boolean}\n */\n\nexport function isComponentIdInternal(cmptOption) {\n return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\n}\nexport function makeInternalComponentId(idSuffix) {\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\n}\nexport function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\n // Set mainType and complete subType.\n each(mappingResult, function (item) {\n var newOption = item.newOption;\n\n if (isObject(newOption)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\n }\n });\n}\n\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\n var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : componentModelCtor.determineSubType(mainType, newCmptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\n * A helper for removing duplicate items between batchA and batchB,\n * and in themselves, and categorize by series.\n *\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @return result: [resultBatchA, resultBatchB]\n */\n\n\nexport function compressBatches(batchA, batchB) {\n var mapA = {};\n var mapB = {};\n makeMap(batchA || [], mapA);\n makeMap(batchB || [], mapB, mapA);\n return [mapToArray(mapA), mapToArray(mapB)];\n\n function makeMap(sourceBatch, map, otherMap) {\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\n\n if (seriesId == null) {\n return;\n }\n\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\n var otherDataIndices = otherMap && otherMap[seriesId];\n\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\n var dataIndex = dataIndices[j];\n\n if (otherDataIndices && otherDataIndices[dataIndex]) {\n otherDataIndices[dataIndex] = null;\n } else {\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\n }\n }\n }\n }\n\n function mapToArray(map, isData) {\n var result = [];\n\n for (var i in map) {\n if (map.hasOwnProperty(i) && map[i] != null) {\n if (isData) {\n result.push(+i);\n } else {\n var dataIndices = mapToArray(map[i], true);\n dataIndices.length && result.push({\n seriesId: i,\n dataIndex: dataIndices\n });\n }\n }\n }\n\n return result;\n }\n}\n/**\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\n * each of which can be Array or primary type.\n * @return dataIndex If not found, return undefined/null.\n */\n\nexport function queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return isArray(payload.name) ? map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\n * Enable property storage to any host object.\n * Notice: Serialization is not supported.\n *\n * For example:\n * let inner = zrUitl.makeInner();\n *\n * function some1(hostObj) {\n * inner(hostObj).someProperty = 1212;\n * ...\n * }\n * function some2() {\n * let fields = inner(this);\n * fields.someProperty1 = 1212;\n * fields.someProperty2 = 'xx';\n * ...\n * }\n *\n * @return {Function}\n */\n\nexport function makeInner() {\n var key = '__ec_inner_' + innerUniqueIndex++;\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\nvar innerUniqueIndex = getRandomIdBase();\n/**\n * The same behavior as `component.getReferringComponents`.\n */\n\nexport function parseFinder(ecModel, finderInput, opt) {\n var _a = preParseFinder(finderInput, opt),\n mainTypeSpecified = _a.mainTypeSpecified,\n queryOptionMap = _a.queryOptionMap,\n others = _a.others;\n\n var result = others;\n var defaultMainType = opt ? opt.defaultMainType : null;\n\n if (!mainTypeSpecified && defaultMainType) {\n queryOptionMap.set(defaultMainType, {});\n }\n\n queryOptionMap.each(function (queryOption, mainType) {\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\n useDefault: defaultMainType === mainType,\n enableAll: opt && opt.enableAll != null ? opt.enableAll : true,\n enableNone: opt && opt.enableNone != null ? opt.enableNone : true\n });\n result[mainType + 'Models'] = queryResult.models;\n result[mainType + 'Model'] = queryResult.models[0];\n });\n return result;\n}\nexport function preParseFinder(finderInput, opt) {\n var finder;\n\n if (isString(finderInput)) {\n var obj = {};\n obj[finderInput + 'Index'] = 0;\n finder = obj;\n } else {\n finder = finderInput;\n }\n\n var queryOptionMap = createHashMap();\n var others = {};\n var mainTypeSpecified = false;\n each(finder, function (value, key) {\n // Exclude 'dataIndex' and other illgal keys.\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n others[key] = value;\n return;\n }\n\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\n var mainType = parsedKey[1];\n var queryType = (parsedKey[2] || '').toLowerCase();\n\n if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n\n mainTypeSpecified = mainTypeSpecified || !!mainType;\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\n queryOption[queryType] = value;\n });\n return {\n mainTypeSpecified: mainTypeSpecified,\n queryOptionMap: queryOptionMap,\n others: others\n };\n}\nexport var SINGLE_REFERRING = {\n useDefault: true,\n enableAll: false,\n enableNone: false\n};\nexport var MULTIPLE_REFERRING = {\n useDefault: false,\n enableAll: true,\n enableNone: true\n};\nexport function queryReferringComponents(ecModel, mainType, userOption, opt) {\n opt = opt || SINGLE_REFERRING;\n var indexOption = userOption.index;\n var idOption = userOption.id;\n var nameOption = userOption.name;\n var result = {\n models: null,\n specified: indexOption != null || idOption != null || nameOption != null\n };\n\n if (!result.specified) {\n // Use the first as default if `useDefault`.\n var firstCmpt = void 0;\n result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];\n return result;\n }\n\n if (indexOption === 'none' || indexOption === false) {\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\n result.models = [];\n return result;\n } // `queryComponents` will return all components if\n // both all of index/id/name are null/undefined.\n\n\n if (indexOption === 'all') {\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\n indexOption = idOption = nameOption = null;\n }\n\n result.models = ecModel.queryComponents({\n mainType: mainType,\n index: indexOption,\n id: idOption,\n name: nameOption\n });\n return result;\n}\nexport function setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\nexport function getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\nexport function getTooltipRenderMode(renderModeOption) {\n if (renderModeOption === 'auto') {\n // Using html when `document` exists, use richText otherwise\n return env.domSupported ? 'html' : 'richText';\n } else {\n return renderModeOption || 'html';\n }\n}\n/**\n * Group a list by key.\n */\n\nexport function groupData(array, getKey // return key\n) {\n var buckets = createHashMap();\n var keys = [];\n each(array, function (item) {\n var key = getKey(item);\n (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item);\n });\n return {\n keys: keys,\n buckets: buckets\n };\n}\n/**\n * Interpolate raw values of a series with percent\n *\n * @param data data\n * @param labelModel label model of the text element\n * @param sourceValue start value. May be null/undefined when init.\n * @param targetValue end value\n * @param percent 0~1 percentage; 0 uses start value while 1 uses end value\n * @return interpolated values\n * If `sourceValue` and `targetValue` are `number`, return `number`.\n * If `sourceValue` and `targetValue` are `string`, return `string`.\n * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\n * Other cases do not supported.\n */\n\nexport function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\n var isAutoPrecision = precision == null || precision === 'auto';\n\n if (targetValue == null) {\n return targetValue;\n }\n\n if (typeof targetValue === 'number') {\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\n return round(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue)) : precision);\n } else if (typeof targetValue === 'string') {\n return percent < 1 ? sourceValue : targetValue;\n } else {\n var interpolated = [];\n var leftArr = sourceValue;\n var rightArr = targetValue;\n var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\n\n for (var i = 0; i < length_1; ++i) {\n var info = data.getDimensionInfo(i); // Don't interpolate ordinal dims\n\n if (info.type === 'ordinal') {\n // In init, there is no `sourceValue`, but should better not to get undefined result.\n interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i];\n } else {\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\n var rightVal = rightArr[i];\n var value = interpolateNumber(leftVal, rightVal, percent);\n interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal)) : precision);\n }\n }\n\n return interpolated;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __spreadArrays } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\n/**\n * Notice, parseClassType('') should returns {main: '', sub: ''}\n * @public\n */\n\nexport function parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n\n if (componentType) {\n var typeArr = componentType.split(TYPE_DELIMITER);\n ret.main = typeArr[0] || '';\n ret.sub = typeArr[1] || '';\n }\n\n return ret;\n}\n/**\n * @public\n */\n\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\n\nexport function isExtendedClass(clz) {\n return !!(clz && clz[IS_EXTENDED_CLASS]);\n}\n/**\n * Implements `ExtendableConstructor` for `rootClz`.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\n * enableClassExtend(Xxx as XxxConstructor);\n * ```\n */\n\nexport function enableClassExtend(rootClz, mandatoryMethods) {\n rootClz.$constructor = rootClz; // FIXME: not necessary?\n\n rootClz.extend = function (proto) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(mandatoryMethods, function (method) {\n if (!proto[method]) {\n console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');\n }\n });\n }\n\n var superClass = this; // For backward compat, we both support ts class inheritance and this\n // \"extend\" approach.\n // The constructor should keep the same behavior as ts class inheritance:\n // If this constructor/$constructor is not declared, auto invoke the super\n // constructor.\n // If this constructor/$constructor is declared, it is responsible for\n // calling the super constructor.\n\n function ExtendedClass() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!proto.$constructor) {\n if (!isESClass(superClass)) {\n // Will throw error if superClass is an es6 native class.\n superClass.apply(this, arguments);\n } else {\n var ins = zrUtil.createObject( // @ts-ignore\n ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\n return ins;\n }\n } else {\n proto.$constructor.apply(this, arguments);\n }\n }\n\n ExtendedClass[IS_EXTENDED_CLASS] = true;\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n zrUtil.inherits(ExtendedClass, this);\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\n\nfunction isESClass(fn) {\n return typeof fn === 'function' && /^class\\s/.test(Function.prototype.toString.call(fn));\n}\n/**\n * A work around to both support ts extend and this extend mechanism.\n * on sub-class.\n * @usage\n * ```ts\n * class Component { ... }\n * classUtil.enableClassExtend(Component);\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\n *\n * class Series extends Component { ... }\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\n * Component.markExtend(Series);\n * ```\n */\n\n\nexport function mountExtend(SubClz, SupperClz) {\n SubClz.extend = SupperClz.extend;\n} // A random offset.\n\nvar classBase = Math.round(Math.random() * 10);\n/**\n * Implements `CheckableConstructor` for `target`.\n * Can not use instanceof, consider different scope by\n * cross domain or es module import in ec extensions.\n * Mount a method \"isInstance()\" to Clz.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\n * enableClassCheck(Xxx as XxxConstructor)\n * ```\n */\n\nexport function enableClassCheck(target) {\n var classAttr = ['__\\0is_clz', classBase++].join('_');\n target.prototype[classAttr] = true;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\n }\n\n target.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n} // superCall should have class info, which can not be fetch from 'this'.\n// Consider this case:\n// class A has method f,\n// class B inherits class A, overrides method f, f call superApply('f'),\n// class C inherits class B, do not overrides method f,\n// then when method of class C is called, dead loop occured.\n\nfunction superCall(context, methodName) {\n var args = [];\n\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n\n return this.superClass.prototype[methodName].apply(context, args);\n}\n\nfunction superApply(context, methodName, args) {\n return this.superClass.prototype[methodName].apply(context, args);\n}\n/**\n * Implements `ClassManager` for `target`\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ClassManager\n * enableClassManagement(Xxx as XxxConstructor);\n * ```\n */\n\n\nexport function enableClassManagement(target) {\n /**\n * Component model classes\n * key: componentType,\n * value:\n * componentClass, when componentType is 'xxx'\n * or Object.<subKey, componentClass>, when componentType is 'xxx.yy'\n */\n var storage = {};\n\n target.registerClass = function (clz) {\n // `type` should not be a \"instance memeber\".\n // If using TS class, should better declared as `static type = 'series.pie'`.\n // otherwise users have to mount `type` on prototype manually.\n // For backward compat and enable instance visit type via `this.type`,\n // we stil support fetch `type` from prototype.\n var componentFullType = clz.type || clz.prototype.type;\n\n if (componentFullType) {\n checkClassType(componentFullType); // If only static type declared, we assign it to prototype mandatorily.\n\n clz.prototype.type = componentFullType;\n var componentTypeInfo = parseClassType(componentFullType);\n\n if (!componentTypeInfo.sub) {\n if (process.env.NODE_ENV !== 'production') {\n if (storage[componentTypeInfo.main]) {\n console.warn(componentTypeInfo.main + ' exists.');\n }\n }\n\n storage[componentTypeInfo.main] = clz;\n } else if (componentTypeInfo.sub !== IS_CONTAINER) {\n var container = makeContainer(componentTypeInfo);\n container[componentTypeInfo.sub] = clz;\n }\n }\n\n return clz;\n };\n\n target.getClass = function (mainType, subType, throwWhenNotFound) {\n var clz = storage[mainType];\n\n if (clz && clz[IS_CONTAINER]) {\n clz = subType ? clz[subType] : null;\n }\n\n if (throwWhenNotFound && !clz) {\n throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.');\n }\n\n return clz;\n };\n\n target.getClassesByMainType = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var result = [];\n var obj = storage[componentTypeInfo.main];\n\n if (obj && obj[IS_CONTAINER]) {\n zrUtil.each(obj, function (o, type) {\n type !== IS_CONTAINER && result.push(o);\n });\n } else {\n result.push(obj);\n }\n\n return result;\n };\n\n target.hasClass = function (componentType) {\n // Just consider componentType.main.\n var componentTypeInfo = parseClassType(componentType);\n return !!storage[componentTypeInfo.main];\n };\n /**\n * @return Like ['aa', 'bb'], but can not be ['aa.xx']\n */\n\n\n target.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\n * If a main type is container and has sub types\n */\n\n\n target.hasSubTypes = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var obj = storage[componentTypeInfo.main];\n return obj && obj[IS_CONTAINER];\n };\n\n function makeContainer(componentTypeInfo) {\n var container = storage[componentTypeInfo.main];\n\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentTypeInfo.main] = {};\n container[IS_CONTAINER] = true;\n }\n\n return container;\n }\n} // /**\n// * @param {string|Array.<string>} properties\n// */\n// export function setReadOnly(obj, properties) {\n// FIXME It seems broken in IE8 simulation of IE11\n// if (!zrUtil.isArray(properties)) {\n// properties = properties != null ? [properties] : [];\n// }\n// zrUtil.each(properties, function (prop) {\n// let value = obj[prop];\n// Object.defineProperty\n// && Object.defineProperty(obj, prop, {\n// value: value, writable: false\n// });\n// zrUtil.isArray(obj[prop])\n// && Object.freeze\n// && Object.freeze(obj[prop]);\n// });\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Parse shadow style\n// TODO Only shallow path support\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function makeStyleMapper(properties, ignoreParent) {\n // Normalize\n for (var i = 0; i < properties.length; i++) {\n if (!properties[i][1]) {\n properties[i][1] = properties[i][0];\n }\n }\n\n ignoreParent = ignoreParent || false;\n return function (model, excludes, includes) {\n var style = {};\n\n for (var i = 0; i < properties.length; i++) {\n var propName = properties[i][1];\n\n if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n continue;\n }\n\n var val = model.getShallow(propName, ignoreParent);\n\n if (val != null) {\n style[properties[i][0]] = val;\n }\n } // TODO Text or image?\n\n\n return style;\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper';\nexport var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\n\nvar AreaStyleMixin =\n/** @class */\nfunction () {\n function AreaStyleMixin() {}\n\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\n return getAreaStyle(this, excludes, includes);\n };\n\n return AreaStyleMixin;\n}();\n\n;\nexport { AreaStyleMixin };","import LRU from '../../core/LRU';\nvar globalImageCache = new LRU(50);\nexport function findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n }\n else {\n return newImageOrSrc;\n }\n}\nexport function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n }\n else if (typeof newImageOrSrc === 'string') {\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\n return image;\n }\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n }\n else {\n image = new Image();\n image.onload = image.onerror = imageOnLoad;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n image.src = image.__zrImageSrc = newImageOrSrc;\n }\n return image;\n }\n else {\n return newImageOrSrc;\n }\n}\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\n var pendingWrap = cachedImgObj.pending[i];\n var cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n cachedImgObj.pending.length = 0;\n}\nexport function isImageReady(image) {\n return image && image.width && image.height;\n}\n","import * as imageHelper from '../helper/image';\nimport { extend, retrieve2, retrieve3, reduce } from '../../core/util';\nimport { getLineHeight, getWidth, parsePercent } from '../../contain/text';\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nexport function truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n return textLines.join('\\n');\n}\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = options || {};\n var preparedOpts = extend({}, options);\n preparedOpts.font = font;\n ellipsis = retrieve2(ellipsis, '...');\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n preparedOpts.cnCharWidth = getWidth('国', font);\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n var ellipsisWidth = getWidth(ellipsis, font);\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n contentWidth = containerWidth - ellipsisWidth;\n preparedOpts.ellipsis = ellipsis;\n preparedOpts.ellipsisWidth = ellipsisWidth;\n preparedOpts.contentWidth = contentWidth;\n preparedOpts.containerWidth = containerWidth;\n return preparedOpts;\n}\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n if (!containerWidth) {\n return '';\n }\n var lineWidth = getWidth(textLine, font);\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n var subLength = j === 0\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\n : lineWidth > 0\n ? Math.floor(textLine.length * contentWidth / lineWidth)\n : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n if (textLine === '') {\n textLine = options.placeholder;\n }\n return textLine;\n}\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\n for (var len = text.length; i < len && width < contentWidth; i++) {\n var charCode = text.charCodeAt(i);\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\n }\n return i;\n}\nexport function parsePlainText(text, style) {\n text != null && (text += '');\n var overflow = style.overflow;\n var padding = style.padding;\n var font = style.font;\n var truncate = overflow === 'truncate';\n var calculatedLineHeight = getLineHeight(font);\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n var truncateLineOverflow = style.lineOverflow === 'truncate';\n var width = style.width;\n var lines;\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n }\n else {\n lines = text ? text.split('\\n') : [];\n }\n var contentHeight = lines.length * lineHeight;\n var height = retrieve2(style.height, contentHeight);\n if (contentHeight > height && truncateLineOverflow) {\n var lineCount = Math.floor(height / lineHeight);\n lines = lines.slice(0, lineCount);\n }\n var outerHeight = height;\n var outerWidth = width;\n if (padding) {\n outerHeight += padding[0] + padding[2];\n if (outerWidth != null) {\n outerWidth += padding[1] + padding[3];\n }\n }\n if (text && truncate && outerWidth != null) {\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\n minChar: style.truncateMinChar,\n placeholder: style.placeholder\n });\n for (var i = 0; i < lines.length; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n if (width == null) {\n var maxWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\n }\n width = maxWidth;\n }\n return {\n lines: lines,\n height: height,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n calculatedLineHeight: calculatedLineHeight,\n contentHeight: contentHeight,\n width: width\n };\n}\nvar RichTextToken = (function () {\n function RichTextToken() {\n }\n return RichTextToken;\n}());\nvar RichTextLine = (function () {\n function RichTextLine(tokens) {\n this.tokens = [];\n if (tokens) {\n this.tokens = tokens;\n }\n }\n return RichTextLine;\n}());\nvar RichTextContentBlock = (function () {\n function RichTextContentBlock() {\n this.width = 0;\n this.height = 0;\n this.contentWidth = 0;\n this.contentHeight = 0;\n this.outerWidth = 0;\n this.outerHeight = 0;\n this.lines = [];\n }\n return RichTextContentBlock;\n}());\nexport { RichTextContentBlock };\nexport function parseRichText(text, style) {\n var contentBlock = new RichTextContentBlock();\n text != null && (text += '');\n if (!text) {\n return contentBlock;\n }\n var topWidth = style.width;\n var topHeight = style.height;\n var overflow = style.overflow;\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\n : null;\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n }\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n }\n var pendingList = [];\n var calculatedHeight = 0;\n var calculatedWidth = 0;\n var stlPadding = style.padding;\n var truncate = overflow === 'truncate';\n var truncateLine = style.lineOverflow === 'truncate';\n function finishLine(line, lineWidth, lineHeight) {\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n calculatedHeight += lineHeight;\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\n }\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\n for (var j = 0; j < line.tokens.length; j++) {\n var token = line.tokens[j];\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\n var textPadding = token.textPadding = tokenStyle.padding;\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n var font = token.font = tokenStyle.font || style.font;\n token.contentHeight = getLineHeight(font);\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\n token.innerHeight = tokenHeight;\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\n token.align = tokenStyle && tokenStyle.align || style.align;\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n if (j > 0) {\n line.tokens = line.tokens.slice(0, j);\n finishLine(line, lineWidth, lineHeight);\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n }\n else {\n contentBlock.lines = contentBlock.lines.slice(0, i);\n }\n break outer;\n }\n var styleTokenWidth = tokenStyle.width;\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n token.percentWidth = styleTokenWidth;\n pendingList.push(token);\n token.contentWidth = getWidth(token.text, font);\n }\n else {\n if (tokenWidthNotSpecified) {\n var textBackgroundColor = tokenStyle.backgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image;\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n if (imageHelper.isImageReady(bgImg)) {\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n var remainTruncWidth = truncate && topWidth != null\n ? topWidth - lineWidth : null;\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n token.text = '';\n token.width = token.contentWidth = 0;\n }\n else {\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\n token.width = token.contentWidth = getWidth(token.text, font);\n }\n }\n else {\n token.contentWidth = getWidth(token.text, font);\n }\n }\n token.width += paddingH;\n lineWidth += token.width;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n finishLine(line, lineWidth, lineHeight);\n }\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n contentBlock.contentHeight = calculatedHeight;\n contentBlock.contentWidth = calculatedWidth;\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth;\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n }\n return contentBlock;\n}\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\n var isEmptyStr = str === '';\n var tokenStyle = styleName && style.rich[styleName] || {};\n var lines = block.lines;\n var font = tokenStyle.font || style.font;\n var newLine = false;\n var strLines;\n var linesWidths;\n if (wrapInfo) {\n var tokenPadding = tokenStyle.padding;\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n if (lines.length > 0) {\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\n strLines = str.split('\\n');\n newLine = true;\n }\n }\n wrapInfo.accumWidth = outerWidth_1;\n }\n else {\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n linesWidths = res.linesWidths;\n strLines = res.lines;\n }\n }\n else {\n strLines = str.split('\\n');\n }\n for (var i = 0; i < strLines.length; i++) {\n var text = strLines[i];\n var token = new RichTextToken();\n token.styleName = styleName;\n token.text = text;\n token.isLineHolder = !text && !isEmptyStr;\n if (typeof tokenStyle.width === 'number') {\n token.width = tokenStyle.width;\n }\n else {\n token.width = linesWidths\n ? linesWidths[i]\n : getWidth(text, font);\n }\n if (!i && !newLine) {\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n var tokensLen = tokens.length;\n (tokensLen === 1 && tokens[0].isLineHolder)\n ? (tokens[0] = token)\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n }\n else {\n lines.push(new RichTextLine([token]));\n }\n }\n}\nfunction isLatin(ch) {\n var code = ch.charCodeAt(0);\n return code >= 0x21 && code <= 0xFF;\n}\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n obj[ch] = true;\n return obj;\n}, {});\nfunction isWordBreakChar(ch) {\n if (isLatin(ch)) {\n if (breakCharMap[ch]) {\n return true;\n }\n return false;\n }\n return true;\n}\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\n var lines = [];\n var linesWidths = [];\n var line = '';\n var currentWord = '';\n var currentWordWidth = 0;\n var accumWidth = 0;\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch === '\\n') {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = '';\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = 0;\n continue;\n }\n var chWidth = getWidth(ch, font);\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\n if (!lines.length\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\n : accumWidth + chWidth > lineWidth) {\n if (!accumWidth) {\n if (inWord) {\n lines.push(currentWord);\n linesWidths.push(currentWordWidth);\n currentWord = ch;\n currentWordWidth = chWidth;\n }\n else {\n lines.push(ch);\n linesWidths.push(chWidth);\n }\n }\n else if (line || currentWord) {\n if (inWord) {\n if (!line) {\n line = currentWord;\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth - currentWordWidth);\n currentWord += ch;\n currentWordWidth += chWidth;\n line = '';\n accumWidth = currentWordWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n currentWord = '';\n currentWordWidth = 0;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = ch;\n accumWidth = chWidth;\n }\n }\n continue;\n }\n accumWidth += chWidth;\n if (inWord) {\n currentWord += ch;\n currentWordWidth += chWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n line += ch;\n }\n }\n if (!lines.length && !line) {\n line = text;\n currentWord = '';\n currentWordWidth = 0;\n }\n if (currentWord) {\n line += currentWord;\n }\n if (line) {\n lines.push(line);\n linesWidths.push(accumWidth);\n }\n if (lines.length === 1) {\n accumWidth += lastAccumWidth;\n }\n return {\n accumWidth: accumWidth,\n lines: lines,\n linesWidths: linesWidths\n };\n}\n","import { __extends } from \"tslib\";\nimport Element from '../Element';\nimport BoundingRect from '../core/BoundingRect';\nimport { keys, extend, createObject } from '../core/util';\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\nexport var DEFAULT_COMMON_STYLE = {\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: '#000',\n opacity: 1,\n blend: 'source-over'\n};\nexport var DEFAULT_COMMON_ANIMATION_PROPS = {\n style: {\n shadowBlur: true,\n shadowOffsetX: true,\n shadowOffsetY: true,\n shadowColor: true,\n opacity: true\n }\n};\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\nvar PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'];\nvar Displayable = (function (_super) {\n __extends(Displayable, _super);\n function Displayable(props) {\n return _super.call(this, props) || this;\n }\n Displayable.prototype._init = function (props) {\n var keysArr = keys(props);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if (key === 'style') {\n this.useStyle(props[key]);\n }\n else {\n _super.prototype.attrKV.call(this, key, props[key]);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Displayable.prototype.beforeBrush = function () { };\n Displayable.prototype.afterBrush = function () { };\n Displayable.prototype.innerBeforeBrush = function () { };\n Displayable.prototype.innerAfterBrush = function () { };\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\n var m = this.transform;\n if (this.ignore\n || this.invisible\n || this.style.opacity === 0\n || (this.culling\n && isDisplayableCulled(this, viewWidth, viewHeight))\n || (m && !m[0] && !m[3])) {\n return false;\n }\n if (considerClipPath && this.__clipPaths) {\n for (var i = 0; i < this.__clipPaths.length; ++i) {\n if (this.__clipPaths[i].isZeroArea()) {\n return false;\n }\n }\n }\n if (considerAncestors && this.parent) {\n var parent_1 = this.parent;\n while (parent_1) {\n if (parent_1.ignore) {\n return false;\n }\n parent_1 = parent_1.parent;\n }\n }\n return true;\n };\n Displayable.prototype.contain = function (x, y) {\n return this.rectContain(x, y);\n };\n Displayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n Displayable.prototype.rectContain = function (x, y) {\n var coord = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n };\n Displayable.prototype.getPaintRect = function () {\n var rect = this._paintRect;\n if (!this._paintRect || this.__dirty) {\n var transform = this.transform;\n var elRect = this.getBoundingRect();\n var style = this.style;\n var shadowSize = style.shadowBlur || 0;\n var shadowOffsetX = style.shadowOffsetX || 0;\n var shadowOffsetY = style.shadowOffsetY || 0;\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n if (transform) {\n BoundingRect.applyTransform(rect, elRect, transform);\n }\n else {\n rect.copy(elRect);\n }\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n }\n var tolerance = this.dirtyRectTolerance;\n if (!rect.isZero()) {\n rect.x = Math.floor(rect.x - tolerance);\n rect.y = Math.floor(rect.y - tolerance);\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n }\n }\n return rect;\n };\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\n if (paintRect) {\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n this._prevPaintRect.copy(paintRect);\n }\n else {\n this._prevPaintRect = null;\n }\n };\n Displayable.prototype.getPrevPaintRect = function () {\n return this._prevPaintRect;\n };\n Displayable.prototype.animateStyle = function (loop) {\n return this.animate('style', loop);\n };\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else {\n this.markRedraw();\n }\n };\n Displayable.prototype.attrKV = function (key, value) {\n if (key !== 'style') {\n _super.prototype.attrKV.call(this, key, value);\n }\n else {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n this.setStyle(value);\n }\n }\n };\n Displayable.prototype.setStyle = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.style[keyOrObj] = value;\n }\n else {\n extend(this.style, keyOrObj);\n }\n this.dirtyStyle();\n return this;\n };\n Displayable.prototype.dirtyStyle = function () {\n this.markRedraw();\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n };\n Displayable.prototype.dirty = function () {\n this.dirtyStyle();\n };\n Displayable.prototype.styleChanged = function () {\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\n };\n Displayable.prototype.styleUpdated = function () {\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\n };\n Displayable.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_COMMON_STYLE, obj);\n };\n Displayable.prototype.useStyle = function (obj) {\n if (!obj[STYLE_MAGIC_KEY]) {\n obj = this.createStyle(obj);\n }\n if (this.__inHover) {\n this.__hoverStyle = obj;\n }\n else {\n this.style = obj;\n }\n this.dirtyStyle();\n };\n Displayable.prototype.isStyleObject = function (obj) {\n return obj[STYLE_MAGIC_KEY];\n };\n Displayable.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.style && !normalState.style) {\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetStyle;\n if (state && state.style) {\n if (transition) {\n if (keepCurrentStates) {\n targetStyle = state.style;\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else if (needsRestoreToNormal) {\n targetStyle = normalState.style;\n }\n if (targetStyle) {\n if (transition) {\n var sourceStyle = this.style;\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n if (needsRestoreToNormal) {\n var changedKeys = keys(sourceStyle);\n for (var i = 0; i < changedKeys.length; i++) {\n var key = changedKeys[i];\n if (key in targetStyle) {\n targetStyle[key] = targetStyle[key];\n this.style[key] = sourceStyle[key];\n }\n }\n }\n var targetKeys = keys(targetStyle);\n for (var i = 0; i < targetKeys.length; i++) {\n var key = targetKeys[i];\n this.style[key] = this.style[key];\n }\n this._transitionState(stateName, {\n style: targetStyle\n }, animationCfg, this.getAnimationStyleProps());\n }\n else {\n this.useStyle(targetStyle);\n }\n }\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n var key = PRIMARY_STATES_KEYS[i];\n if (state && state[key] != null) {\n this[key] = state[key];\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n this[key] = normalState[key];\n }\n }\n }\n };\n Displayable.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedStyle;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.style) {\n mergedStyle = mergedStyle || {};\n this._mergeStyle(mergedStyle, state.style);\n }\n }\n if (mergedStyle) {\n mergedState.style = mergedStyle;\n }\n return mergedState;\n };\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n extend(targetStyle, sourceStyle);\n return targetStyle;\n };\n Displayable.prototype.getAnimationStyleProps = function () {\n return DEFAULT_COMMON_ANIMATION_PROPS;\n };\n Displayable.STYLE_CHANGED_BIT = 2;\n Displayable.initDefaultProps = (function () {\n var dispProto = Displayable.prototype;\n dispProto.type = 'displayable';\n dispProto.invisible = false;\n dispProto.z = 0;\n dispProto.z2 = 0;\n dispProto.zlevel = 0;\n dispProto.culling = false;\n dispProto.cursor = 'pointer';\n dispProto.rectHover = false;\n dispProto.incremental = false;\n dispProto._rect = null;\n dispProto.dirtyRectTolerance = 0;\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\n })();\n return Displayable;\n}(Element));\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el, width, height) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\nexport default Displayable;\n","import { create as v2Create, distSquare as v2DistSquare } from './vector';\nvar mathPow = Math.pow;\nvar mathSqrt = Math.sqrt;\nvar EPSILON = 1e-8;\nvar EPSILON_NUMERIC = 1e-4;\nvar THREE_SQRT = mathSqrt(3);\nvar ONE_THIRD = 1 / 3;\nvar _v0 = v2Create();\nvar _v1 = v2Create();\nvar _v2 = v2Create();\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nexport function cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1)\n + t * t * (t * p3 + 3 * onet * p2);\n}\nexport function cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n + (p3 - p2) * t * t);\n}\nexport function cubicRootAt(p0, p1, p2, p3, val, roots) {\n var a = p3 + 3 * (p1 - p2) - p0;\n var b = 3 * (p2 - p1 * 2 + p0);\n var c = 3 * (p1 - p0);\n var d = p0 - val;\n var A = b * b - 3 * a * c;\n var B = b * c - 9 * a * d;\n var C = c * c - 3 * b * d;\n var n = 0;\n if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n }\n else {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = B * B - 4 * A * C;\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K;\n var t2 = -K / 2;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\n if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n }\n else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n }\n else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else {\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n var theta = Math.acos(T) / 3;\n var ASqrt = mathSqrt(A);\n var tmp = Math.cos(theta);\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n return n;\n}\nexport function cubicExtrema(p0, p1, p2, p3, extrema) {\n var b = 6 * p2 - 12 * p1 + 6 * p0;\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n var c = 3 * p1 - 3 * p0;\n var n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function cubicSubdivide(p0, p1, p2, p3, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p23 = (p3 - p2) * t + p2;\n var p012 = (p12 - p01) * t + p01;\n var p123 = (p23 - p12) * t + p12;\n var p0123 = (p123 - p012) * t + p012;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123;\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\nexport function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n var prev;\n var next;\n var d1;\n var d2;\n _v0[0] = x;\n _v0[1] = y;\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n prev = t - interval;\n next = t + interval;\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n }\n return mathSqrt(d);\n}\nexport function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = cubicAt(x0, x1, x2, x3, t);\n var y = cubicAt(y0, y1, y2, y3, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\nexport function quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\nexport function quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\nexport function quadraticRootAt(p0, p1, p2, val, roots) {\n var a = p0 - 2 * p1 + p2;\n var b = 2 * (p1 - p0);\n var c = p0 - val;\n var n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n if (divider === 0) {\n return 0.5;\n }\n else {\n return (p0 - p1) / divider;\n }\n}\nexport function quadraticSubdivide(p0, p1, p2, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p012 = (p12 - p01) * t + p01;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\nexport function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y;\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = quadraticAt(x0, x1, x2, _t);\n _v1[1] = quadraticAt(y0, y1, y2, _t);\n var d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n var prev = t - interval;\n var next = t + interval;\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n }\n return mathSqrt(d);\n}\nexport function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = quadraticAt(x0, x1, x2, t);\n var y = quadraticAt(y0, y1, y2, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\n","import * as vec2 from './vector';\nimport * as curve from './curve';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI2 = Math.PI * 2;\nvar start = vec2.create();\nvar end = vec2.create();\nvar extremity = vec2.create();\nexport function fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\n }\n var p = points[0];\n var left = p[0];\n var right = p[0];\n var top = p[1];\n var bottom = p[1];\n for (var i = 1; i < points.length; i++) {\n p = points[i];\n left = mathMin(left, p[0]);\n right = mathMax(right, p[0]);\n top = mathMin(top, p[1]);\n bottom = mathMax(bottom, p[1]);\n }\n min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\nexport function fromLine(x0, y0, x1, y1, min, max) {\n min[0] = mathMin(x0, x1);\n min[1] = mathMin(y0, y1);\n max[0] = mathMax(x0, x1);\n max[1] = mathMax(y0, y1);\n}\nvar xDim = [];\nvar yDim = [];\nexport function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\n var n = cubicExtrema(x0, x1, x2, x3, xDim);\n min[0] = Infinity;\n min[1] = Infinity;\n max[0] = -Infinity;\n max[1] = -Infinity;\n for (var i = 0; i < n; i++) {\n var x = cubicAt(x0, x1, x2, x3, xDim[i]);\n min[0] = mathMin(x, min[0]);\n max[0] = mathMax(x, max[0]);\n }\n n = cubicExtrema(y0, y1, y2, y3, yDim);\n for (var i = 0; i < n; i++) {\n var y = cubicAt(y0, y1, y2, y3, yDim[i]);\n min[1] = mathMin(y, min[1]);\n max[1] = mathMax(y, max[1]);\n }\n min[0] = mathMin(x0, min[0]);\n max[0] = mathMax(x0, max[0]);\n min[0] = mathMin(x3, min[0]);\n max[0] = mathMax(x3, max[0]);\n min[1] = mathMin(y0, min[1]);\n max[1] = mathMax(y0, max[1]);\n min[1] = mathMin(y3, min[1]);\n max[1] = mathMax(y3, max[1]);\n}\nexport function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt;\n var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0);\n var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0);\n var x = quadraticAt(x0, x1, x2, tx);\n var y = quadraticAt(y0, y1, y2, ty);\n min[0] = mathMin(x0, x2, x);\n min[1] = mathMin(y0, y2, y);\n max[0] = mathMax(x0, x2, x);\n max[1] = mathMax(y0, y2, y);\n}\nexport function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) {\n var vec2Min = vec2.min;\n var vec2Max = vec2.max;\n var diff = Math.abs(startAngle - endAngle);\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\n }\n start[0] = mathCos(startAngle) * rx + x;\n start[1] = mathSin(startAngle) * ry + y;\n end[0] = mathCos(endAngle) * rx + x;\n end[1] = mathSin(endAngle) * ry + y;\n vec2Min(min, start, end);\n vec2Max(max, start, end);\n startAngle = startAngle % (PI2);\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n endAngle = endAngle % (PI2);\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n }\n else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\n }\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\n if (angle > startAngle) {\n extremity[0] = mathCos(angle) * rx + x;\n extremity[1] = mathSin(angle) * ry + y;\n vec2Min(min, extremity, min);\n vec2Max(max, extremity, max);\n }\n }\n}\n","import * as vec2 from './vector';\nimport BoundingRect from './BoundingRect';\nimport { devicePixelRatio as dpr } from '../config';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox';\nimport { cubicAt, cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve';\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n R: 7\n};\nvar tmpOutX = [];\nvar tmpOutY = [];\nvar min = [];\nvar max = [];\nvar min2 = [];\nvar max2 = [];\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathCos = Math.cos;\nvar mathSin = Math.sin;\nvar mathSqrt = Math.sqrt;\nvar mathAbs = Math.abs;\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\nvar tmpAngles = [];\nfunction modPI2(radian) {\n var n = Math.round(radian / PI * 1e8) / 1e8;\n return (n % 2) * PI;\n}\nexport function normalizeArcAngles(angles, anticlockwise) {\n var newStartAngle = modPI2(angles[0]);\n if (newStartAngle < 0) {\n newStartAngle += PI2;\n }\n var delta = newStartAngle - angles[0];\n var newEndAngle = angles[1];\n newEndAngle += delta;\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n newEndAngle = newStartAngle + PI2;\n }\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n newEndAngle = newStartAngle - PI2;\n }\n else if (!anticlockwise && newStartAngle > newEndAngle) {\n newEndAngle = newStartAngle +\n (PI2 - modPI2(newStartAngle - newEndAngle));\n }\n else if (anticlockwise && newStartAngle < newEndAngle) {\n newEndAngle = newStartAngle -\n (PI2 - modPI2(newEndAngle - newStartAngle));\n }\n angles[0] = newStartAngle;\n angles[1] = newEndAngle;\n}\nvar PathProxy = (function () {\n function PathProxy(notSaveData) {\n this.dpr = 1;\n this._version = 0;\n this._xi = 0;\n this._yi = 0;\n this._x0 = 0;\n this._y0 = 0;\n this._len = 0;\n if (notSaveData) {\n this._saveData = false;\n }\n if (this._saveData) {\n this.data = [];\n }\n }\n PathProxy.prototype.increaseVersion = function () {\n this._version++;\n };\n PathProxy.prototype.getVersion = function () {\n return this._version;\n };\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n if (segmentIgnoreThreshold > 0) {\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n }\n };\n PathProxy.prototype.setDPR = function (dpr) {\n this.dpr = dpr;\n };\n PathProxy.prototype.setContext = function (ctx) {\n this._ctx = ctx;\n };\n PathProxy.prototype.getContext = function () {\n return this._ctx;\n };\n PathProxy.prototype.beginPath = function () {\n this._ctx && this._ctx.beginPath();\n this.reset();\n return this;\n };\n PathProxy.prototype.reset = function () {\n if (this._saveData) {\n this._len = 0;\n }\n if (this._lineDash) {\n this._lineDash = null;\n this._dashOffset = 0;\n }\n if (this._pathSegLen) {\n this._pathSegLen = null;\n this._pathLen = 0;\n }\n this._version++;\n };\n PathProxy.prototype.moveTo = function (x, y) {\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y);\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n };\n PathProxy.prototype.lineTo = function (x, y) {\n var exceedUnit = mathAbs(x - this._xi) > this._ux\n || mathAbs(y - this._yi) > this._uy\n || this._len < 5;\n this.addData(CMD.L, x, y);\n if (this._ctx && exceedUnit) {\n this._needsDash ? this._dashedLineTo(x, y)\n : this._ctx.lineTo(x, y);\n }\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n }\n return this;\n };\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n if (this._ctx) {\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n this._xi = x3;\n this._yi = y3;\n return this;\n };\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\n this.addData(CMD.Q, x1, y1, x2, y2);\n if (this._ctx) {\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n this._xi = x2;\n this._yi = y2;\n return this;\n };\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n tmpAngles[0] = startAngle;\n tmpAngles[1] = endAngle;\n normalizeArcAngles(tmpAngles, anticlockwise);\n startAngle = tmpAngles[0];\n endAngle = tmpAngles[1];\n var delta = endAngle - startAngle;\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n this._xi = mathCos(endAngle) * r + cx;\n this._yi = mathSin(endAngle) * r + cy;\n return this;\n };\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n return this;\n };\n PathProxy.prototype.rect = function (x, y, w, h) {\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n };\n PathProxy.prototype.closePath = function () {\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n if (ctx) {\n this._needsDash && this._dashedLineTo(x0, y0);\n ctx.closePath();\n }\n this._xi = x0;\n this._yi = y0;\n return this;\n };\n PathProxy.prototype.fill = function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n };\n PathProxy.prototype.stroke = function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n };\n PathProxy.prototype.setLineDash = function (lineDash) {\n if (lineDash instanceof Array) {\n this._lineDash = lineDash;\n this._dashIdx = 0;\n var lineDashSum = 0;\n for (var i = 0; i < lineDash.length; i++) {\n lineDashSum += lineDash[i];\n }\n this._dashSum = lineDashSum;\n this._needsDash = true;\n }\n else {\n this._lineDash = null;\n this._needsDash = false;\n }\n return this;\n };\n PathProxy.prototype.setLineDashOffset = function (offset) {\n this._dashOffset = offset;\n return this;\n };\n PathProxy.prototype.len = function () {\n return this._len;\n };\n PathProxy.prototype.setData = function (data) {\n var len = data.length;\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n this._len = len;\n };\n PathProxy.prototype.appendPath = function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n if (hasTypedArray && (this.data instanceof Float32Array)) {\n this.data = new Float32Array(offset + appendSize);\n }\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n this._len = offset;\n };\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\n if (!this._saveData) {\n return;\n }\n var data = this.data;\n if (this._len + arguments.length > data.length) {\n this._expandData();\n data = this.data;\n }\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n };\n PathProxy.prototype._expandData = function () {\n if (!(this.data instanceof Array)) {\n var newData = [];\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n this.data = newData;\n }\n };\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\n var dashSum = this._dashSum;\n var lineDash = this._lineDash;\n var ctx = this._ctx;\n var offset = this._dashOffset;\n var x0 = this._xi;\n var y0 = this._yi;\n var dx = x1 - x0;\n var dy = y1 - y0;\n var dist = mathSqrt(dx * dx + dy * dy);\n var x = x0;\n var y = y0;\n var nDash = lineDash.length;\n var dash;\n var idx;\n dx /= dist;\n dy /= dist;\n if (offset < 0) {\n offset = dashSum + offset;\n }\n offset %= dashSum;\n x -= offset * dx;\n y -= offset * dy;\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\n idx = this._dashIdx;\n dash = lineDash[idx];\n x += dx * dash;\n y += dy * dash;\n this._dashIdx = (idx + 1) % nDash;\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\n continue;\n }\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin(x, x1) : mathMax(x, x1), dy >= 0 ? mathMin(y, y1) : mathMax(y, y1));\n }\n dx = x - x1;\n dy = y - y1;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n };\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\n var ctx = this._ctx;\n var dashSum = this._dashSum;\n var offset = this._dashOffset;\n var lineDash = this._lineDash;\n var x0 = this._xi;\n var y0 = this._yi;\n var bezierLen = 0;\n var idx = this._dashIdx;\n var nDash = lineDash.length;\n var t;\n var dx;\n var dy;\n var x;\n var y;\n var tmpLen = 0;\n if (offset < 0) {\n offset = dashSum + offset;\n }\n offset %= dashSum;\n for (t = 0; t < 1; t += 0.1) {\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\n - cubicAt(x0, x1, x2, x3, t);\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\n - cubicAt(y0, y1, y2, y3, t);\n bezierLen += mathSqrt(dx * dx + dy * dy);\n }\n for (; idx < nDash; idx++) {\n tmpLen += lineDash[idx];\n if (tmpLen > offset) {\n break;\n }\n }\n t = (tmpLen - offset) / bezierLen;\n while (t <= 1) {\n x = cubicAt(x0, x1, x2, x3, t);\n y = cubicAt(y0, y1, y2, y3, t);\n idx % 2 ? ctx.moveTo(x, y)\n : ctx.lineTo(x, y);\n t += lineDash[idx] / bezierLen;\n idx = (idx + 1) % nDash;\n }\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\n dx = x3 - x;\n dy = y3 - y;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n };\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\n var x3 = x2;\n var y3 = y2;\n x2 = (x2 + 2 * x1) / 3;\n y2 = (y2 + 2 * y1) / 3;\n x1 = (this._xi + 2 * x1) / 3;\n y1 = (this._yi + 2 * y1) / 3;\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\n };\n PathProxy.prototype.toStatic = function () {\n if (!this._saveData) {\n return;\n }\n var data = this.data;\n if (data instanceof Array) {\n data.length = this._len;\n if (hasTypedArray && this._len > 11) {\n this.data = new Float32Array(data);\n }\n }\n };\n PathProxy.prototype.getBoundingRect = function () {\n min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n var data = this.data;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var i;\n for (i = 0; i < this._len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n case CMD.L:\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n }\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n }\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n PathProxy.prototype._calculateLength = function () {\n var data = this.data;\n var len = this._len;\n var ux = this._ux;\n var uy = this._uy;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n if (!this._pathSegLen) {\n this._pathSegLen = [];\n }\n var pathSegLen = this._pathSegLen;\n var pathTotalLen = 0;\n var segCount = 0;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n var l = -1;\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n break;\n case CMD.L: {\n var x2 = data[i++];\n var y2 = data[i++];\n var dx = x2 - xi;\n var dy = y2 - yi;\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x2;\n yi = y2;\n }\n break;\n }\n case CMD.C: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n var x3 = data[i++];\n var y3 = data[i++];\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var delta = data[i++];\n var endAngle = delta + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R: {\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n l = width * 2 + height * 2;\n break;\n }\n case CMD.Z: {\n var dx = x0 - xi;\n var dy = y0 - yi;\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (l >= 0) {\n pathSegLen[segCount++] = l;\n pathTotalLen += l;\n }\n }\n this._pathLen = pathTotalLen;\n return pathTotalLen;\n };\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\n var d = this.data;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n var x0;\n var y0;\n var xi;\n var yi;\n var x;\n var y;\n var drawPart = percent < 1;\n var pathSegLen;\n var pathTotalLen;\n var accumLength = 0;\n var segCount = 0;\n var displayedLength;\n if (drawPart) {\n if (!this._pathSegLen) {\n this._calculateLength();\n }\n pathSegLen = this._pathSegLen;\n pathTotalLen = this._pathLen;\n displayedLength = percent * pathTotalLen;\n if (!displayedLength) {\n return;\n }\n }\n lo: for (var i = 0; i < len;) {\n var cmd = d[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = xi = d[i++];\n y0 = yi = d[i++];\n ctx.moveTo(xi, yi);\n break;\n case CMD.L: {\n x = d[i++];\n y = d[i++];\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n }\n break;\n }\n case CMD.C: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n var x3 = d[i++];\n var y3 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n break lo;\n }\n accumLength += l;\n }\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n break lo;\n }\n accumLength += l;\n }\n ctx.quadraticCurveTo(x1, y1, x2, y2);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n var cx = d[i++];\n var cy = d[i++];\n var rx = d[i++];\n var ry = d[i++];\n var startAngle = d[i++];\n var delta = d[i++];\n var psi = d[i++];\n var anticlockwise = !d[i++];\n var r = (rx > ry) ? rx : ry;\n var scaleX = (rx > ry) ? 1 : rx / ry;\n var scaleY = (rx > ry) ? ry / rx : 1;\n var isEllipse = mathAbs(rx - ry) > 1e-3;\n var endAngle = startAngle + delta;\n var breakBuild = false;\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n breakBuild = true;\n }\n accumLength += l;\n }\n if (isEllipse && ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n }\n else {\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n }\n if (breakBuild) {\n break lo;\n }\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n x = d[i++];\n y = d[i++];\n var width = d[i++];\n var height = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var d_1 = displayedLength - accumLength;\n ctx.moveTo(x, y);\n ctx.lineTo(x + mathMin(d_1, width), y);\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x + width, y + mathMin(d_1, height));\n }\n d_1 -= height;\n if (d_1 > 0) {\n ctx.lineTo(x + mathMax(width - d_1, 0), y + height);\n }\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x, y + mathMax(height - d_1, 0));\n }\n break lo;\n }\n accumLength += l;\n }\n ctx.rect(x, y, width, height);\n break;\n case CMD.Z:\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n };\n PathProxy.CMD = CMD;\n PathProxy.initDefaultProps = (function () {\n var proto = PathProxy.prototype;\n proto._saveData = true;\n proto._needsDash = false;\n proto._dashOffset = 0;\n proto._dashIdx = 0;\n proto._dashSum = 0;\n proto._ux = 0;\n proto._uy = 0;\n })();\n return PathProxy;\n}());\nexport default PathProxy;\n","export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n var _a = 0;\n var _b = x0;\n if ((y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)) {\n return false;\n }\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n var tmp = _a * x - y + _b;\n var _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}\n","import * as curve from '../core/curve';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n return false;\n }\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n","import { quadraticProjectPoint } from '../core/curve';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n return false;\n }\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n","var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}\n","import { normalizeRadian } from './util';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n return true;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n","export default function windingLine(x0, y0, x1, y1, x, y) {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n if (y1 === y0) {\n return 0;\n }\n var t = (y - y0) / (y1 - y0);\n var dir = y1 < y0 ? 1 : -1;\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n var x_ = t * (x1 - x0) + x0;\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n","import PathProxy from '../core/PathProxy';\nimport * as line from './line';\nimport * as cubic from './cubic';\nimport * as quadratic from './quadratic';\nimport * as arc from './arc';\nimport * as curve from '../core/curve';\nimport windingLine from './windingLine';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n if ((y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\n return 0;\n }\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var w = 0;\n var nExtrema = -1;\n var y0_ = void 0;\n var y1_ = void 0;\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i];\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) {\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n if ((y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)) {\n return 0;\n }\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n for (var i = 0; i < nRoots; i++) {\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) {\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) {\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n if (startAngle > endAngle) {\n var tmp_1 = startAngle;\n startAngle = endAngle;\n endAngle = tmp_1;\n }\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n var w = 0;\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if ((angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n var data = path.data;\n var len = path.len();\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (cmd === CMD.M && i > 1) {\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n }\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++];\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n x0 = x1;\n y0 = y1;\n }\n var _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n }\n else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n return containPath(pathProxy, lineWidth, true, x, y);\n}\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable';\nimport Element from '../Element';\nimport PathProxy from '../core/PathProxy';\nimport * as pathContain from '../contain/path';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util';\nimport { lum } from '../tool/color';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = [\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n];\nvar Path = (function (_super) {\n __extends(Path, _super);\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n Path.prototype.update = function () {\n var _this = this;\n _super.prototype.update.call(this);\n var style = this.style;\n if (style.decal) {\n var decalEl = this._decalEl\n = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n decalEl.__dirty |= Element.REDARAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n extend(this.style, value);\n }\n }\n else if (key === 'shape') {\n extend(this.shape, value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n if (fillLum > 0.5) {\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n }\n return DARK_LABEL_COLOR;\n };\n Path.prototype.getInsideTextStroke = function (textFill) {\n var pathFill = this.style.fill;\n if (isString(pathFill)) {\n var zr = this.__zr;\n var isDarkMode = !!(zr && zr.isDarkMode());\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n };\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\n Path.prototype.pathUpdated = function () {\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\n };\n Path.prototype.createPathProxy = function () {\n this.path = new PathProxy(false);\n };\n Path.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n };\n Path.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n Path.prototype.getBoundingRect = function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n if (needsUpdateRect) {\n var firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n this.createPathProxy();\n }\n var path = this.path;\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectWithStroke.copy(rect);\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n var w = style.lineWidth;\n if (!this.hasFill()) {\n var strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n if (lineScale > 1e-10) {\n rectWithStroke.width += w / lineScale;\n rectWithStroke.height += w / lineScale;\n rectWithStroke.x -= w / lineScale / 2;\n rectWithStroke.y -= w / lineScale / 2;\n }\n }\n return rectWithStroke;\n }\n return rect;\n };\n Path.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n if (rect.contain(x, y)) {\n var pathProxy = this.path;\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n if (lineScale > 1e-10) {\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n };\n Path.prototype.dirtyShape = function () {\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n };\n Path.prototype.dirty = function () {\n this.dirtyStyle();\n this.dirtyShape();\n };\n Path.prototype.animateShape = function (loop) {\n return this.animate('shape', loop);\n };\n Path.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n };\n Path.prototype.attrKV = function (key, value) {\n if (key === 'shape') {\n this.setShape(value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n };\n Path.prototype.setShape = function (keyOrObj, value) {\n var shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj);\n }\n this.dirtyShape();\n return this;\n };\n Path.prototype.shapeChanged = function () {\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\n };\n Path.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n };\n Path.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n };\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetShape;\n if (state && state.shape) {\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n if (targetShape) {\n if (transition) {\n this.shape = extend({}, this.shape);\n var targetShapePrimaryProps = {};\n var shapeKeys = keys(targetShape);\n for (var i = 0; i < shapeKeys.length; i++) {\n var key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n this.shape[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n }, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n };\n Path.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedShape;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n };\n Path.prototype.getAnimationStyleProps = function () {\n return DEFAULT_PATH_ANIMATION_PROPS;\n };\n Path.prototype.isZeroArea = function () {\n return false;\n };\n Path.extend = function (defaultProps) {\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n defaultProps.init && defaultProps.init.call(_this, opts);\n return _this;\n }\n Sub.prototype.getDefaultStyle = function () {\n return clone(defaultProps.style);\n };\n Sub.prototype.getDefaultShape = function () {\n return clone(defaultProps.shape);\n };\n return Sub;\n }(Path));\n for (var key in defaultProps) {\n if (typeof defaultProps[key] === 'function') {\n Sub.prototype[key] = defaultProps[key];\n }\n }\n return Sub;\n };\n Path.SHAPE_CHANGED_BIT = 4;\n Path.initDefaultProps = (function () {\n var pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\n })();\n return Path;\n}(Displayable));\nexport default Path;\n","import { __extends } from \"tslib\";\nimport Displayable from './Displayable';\nimport { getBoundingRect, DEFAULT_FONT } from '../contain/text';\nimport { DEFAULT_PATH_STYLE } from './Path';\nimport { createObject, defaults } from '../core/util';\nexport var DEFAULT_TSPAN_STYLE = defaults({\n strokeFirst: true,\n font: DEFAULT_FONT,\n x: 0,\n y: 0,\n textAlign: 'left',\n textBaseline: 'top',\n miterLimit: 2\n}, DEFAULT_PATH_STYLE);\nvar TSpan = (function (_super) {\n __extends(TSpan, _super);\n function TSpan() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TSpan.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n };\n TSpan.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n TSpan.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_TSPAN_STYLE, obj);\n };\n TSpan.prototype.setBoundingRect = function (rect) {\n this._rect = rect;\n };\n TSpan.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n var text = style.text;\n text != null ? (text += '') : (text = '');\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n if (this.hasStroke()) {\n var w = style.lineWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n this._rect = rect;\n }\n return this._rect;\n };\n TSpan.initDefaultProps = (function () {\n var tspanProto = TSpan.prototype;\n tspanProto.dirtyRectTolerance = 10;\n })();\n return TSpan;\n}(Displayable));\nTSpan.prototype.type = 'tspan';\nexport default TSpan;\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable';\nimport BoundingRect from '../core/BoundingRect';\nimport { defaults, createObject } from '../core/util';\nexport var DEFAULT_IMAGE_STYLE = defaults({\n x: 0,\n y: 0\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_IMAGE_ANIMATION_PROPS = {\n style: defaults({\n x: true,\n y: true,\n width: true,\n height: true,\n sx: true,\n sy: true,\n sWidth: true,\n sHeight: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nfunction isImageLike(source) {\n return !!(source\n && typeof source !== 'string'\n && source.width && source.height);\n}\nvar ZRImage = (function (_super) {\n __extends(ZRImage, _super);\n function ZRImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ZRImage.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_IMAGE_STYLE, obj);\n };\n ZRImage.prototype._getSize = function (dim) {\n var style = this.style;\n var size = style[dim];\n if (size != null) {\n return size;\n }\n var imageSource = isImageLike(style.image)\n ? style.image : this.__image;\n if (!imageSource) {\n return 0;\n }\n var otherDim = dim === 'width' ? 'height' : 'width';\n var otherDimSize = style[otherDim];\n if (otherDimSize == null) {\n return imageSource[dim];\n }\n else {\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n }\n };\n ZRImage.prototype.getWidth = function () {\n return this._getSize('width');\n };\n ZRImage.prototype.getHeight = function () {\n return this._getSize('height');\n };\n ZRImage.prototype.getAnimationStyleProps = function () {\n return DEFAULT_IMAGE_ANIMATION_PROPS;\n };\n ZRImage.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\n }\n return this._rect;\n };\n return ZRImage;\n}(Displayable));\nZRImage.prototype.type = 'image';\nexport default ZRImage;\n","export function buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4;\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n var total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n","var round = Math.round;\nexport function subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n return outputShape;\n}\nexport function subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n return outputShape;\n}\nexport function subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n }\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0\n ? doubledPosition / 2\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport * as roundRectHelper from '../helper/roundRect';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize';\nvar RectShape = (function () {\n function RectShape() {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n }\n return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n __extends(Rect, _super);\n function Rect(opts) {\n return _super.call(this, opts) || this;\n }\n Rect.prototype.getDefaultShape = function () {\n return new RectShape();\n };\n Rect.prototype.buildPath = function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n };\n Rect.prototype.isZeroArea = function () {\n return !this.shape.width || !this.shape.height;\n };\n return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n","import { __extends } from \"tslib\";\nimport { parseRichText, parsePlainText } from './helper/parseText';\nimport TSpan from './TSpan';\nimport { retrieve2, isString, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util';\nimport { DEFAULT_FONT, adjustTextX, adjustTextY } from '../contain/text';\nimport ZRImage from './Image';\nimport Rect from './shape/Rect';\nimport BoundingRect from '../core/BoundingRect';\nimport { copy } from '../core/matrix';\nimport Displayable, { DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable';\nvar DEFAULT_RICH_TEXT_COLOR = {\n fill: '#000'\n};\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\nexport var DEFAULT_TEXT_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineWidth: true,\n fontSize: true,\n lineHeight: true,\n width: true,\n height: true,\n textShadowColor: true,\n textShadowBlur: true,\n textShadowOffsetX: true,\n textShadowOffsetY: true,\n backgroundColor: true,\n padding: true,\n borderColor: true,\n borderWidth: true,\n borderRadius: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar ZRText = (function (_super) {\n __extends(ZRText, _super);\n function ZRText(opts) {\n var _this = _super.call(this) || this;\n _this.type = 'text';\n _this._children = [];\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\n _this.attr(opts);\n return _this;\n }\n ZRText.prototype.childrenRef = function () {\n return this._children;\n };\n ZRText.prototype.update = function () {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.zlevel = this.zlevel;\n child.z = this.z;\n child.z2 = this.z2;\n child.culling = this.culling;\n child.cursor = this.cursor;\n child.invisible = this.invisible;\n }\n var attachedTransform = this.attachedTransform;\n if (attachedTransform) {\n attachedTransform.updateTransform();\n var m = attachedTransform.transform;\n if (m) {\n this.transform = this.transform || [];\n copy(this.transform, m);\n }\n else {\n this.transform = null;\n }\n }\n else {\n _super.prototype.update.call(this);\n }\n };\n ZRText.prototype.getComputedTransform = function () {\n if (this.__hostTarget) {\n this.__hostTarget.getComputedTransform();\n this.__hostTarget.updateInnerText(true);\n }\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\n : _super.prototype.getComputedTransform.call(this);\n };\n ZRText.prototype._updateSubTexts = function () {\n this._childCursor = 0;\n normalizeTextStyle(this.style);\n this.style.rich\n ? this._updateRichTexts()\n : this._updatePlainTexts();\n this._children.length = this._childCursor;\n this.styleUpdated();\n };\n ZRText.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = zr;\n }\n };\n ZRText.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = null;\n }\n };\n ZRText.prototype.getBoundingRect = function () {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n if (!this._rect) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n this._rect = rect || tmpRect;\n }\n return this._rect;\n };\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n };\n ZRText.prototype.setTextContent = function (textContent) {\n throw new Error('Can\\'t attach text on another text');\n };\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n if (!sourceStyle) {\n return targetStyle;\n }\n var sourceRich = sourceStyle.rich;\n var targetRich = targetStyle.rich || (sourceRich && {});\n extend(targetStyle, sourceStyle);\n if (sourceRich && targetRich) {\n this._mergeRich(targetRich, sourceRich);\n targetStyle.rich = targetRich;\n }\n else if (targetRich) {\n targetStyle.rich = targetRich;\n }\n return targetStyle;\n };\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\n var richNames = keys(sourceRich);\n for (var i = 0; i < richNames.length; i++) {\n var richName = richNames[i];\n targetRich[richName] = targetRich[richName] || {};\n extend(targetRich[richName], sourceRich[richName]);\n }\n };\n ZRText.prototype.getAnimationStyleProps = function () {\n return DEFAULT_TEXT_ANIMATION_PROPS;\n };\n ZRText.prototype._getOrCreateChild = function (Ctor) {\n var child = this._children[this._childCursor];\n if (!child || !(child instanceof Ctor)) {\n child = new Ctor();\n }\n this._children[this._childCursor++] = child;\n child.__zr = this.__zr;\n child.parent = this;\n return child;\n };\n ZRText.prototype._updatePlainTexts = function () {\n var style = this.style;\n var textFont = style.font || DEFAULT_FONT;\n var textPadding = style.padding;\n var text = getStyleText(style);\n var contentBlock = parsePlainText(text, style);\n var needDrawBg = needDrawBackground(style);\n var bgColorDrawn = !!(style.backgroundColor);\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var defaultStyle = this._defaultStyle;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.align || defaultStyle.align || 'left';\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n var textX = baseX;\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n if (needDrawBg || textPadding) {\n var outerWidth_1 = contentBlock.width;\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\n }\n textY += lineHeight / 2;\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n if (verticalAlign === 'top') {\n textY += textPadding[0];\n }\n else if (verticalAlign === 'bottom') {\n textY -= textPadding[2];\n }\n }\n var defaultLineWidth = 0;\n var useDefaultFill = false;\n var textFill = getFill('fill' in style\n ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in style\n ? style.stroke\n : (!bgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill))\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = style.textShadowBlur > 0;\n var fixedBoundingRect = style.width != null\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\n for (var i = 0; i < textLines.length; i++) {\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n subElStyle.text = textLines[i];\n subElStyle.x = textX;\n subElStyle.y = textY;\n if (textAlign) {\n subElStyle.textAlign = textAlign;\n }\n subElStyle.textBaseline = 'middle';\n subElStyle.opacity = style.opacity;\n subElStyle.strokeFirst = true;\n if (hasShadow) {\n subElStyle.shadowBlur = style.textShadowBlur || 0;\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n }\n if (textStroke) {\n subElStyle.stroke = textStroke;\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n subElStyle.lineDash = style.lineDash;\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n subElStyle.font = textFont;\n textY += lineHeight;\n if (fixedBoundingRect) {\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\n }\n }\n };\n ZRText.prototype._updateRichTexts = function () {\n var style = this.style;\n var text = getStyleText(style);\n var contentBlock = parseRichText(text, style);\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.padding;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var defaultStyle = this._defaultStyle;\n var textAlign = style.align || defaultStyle.align;\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n var xRight = xLeft + contentWidth;\n if (needDrawBackground(style)) {\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n var bgColorDrawn = !!(style.backgroundColor);\n for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var tokens = line.tokens;\n var tokenCount = tokens.length;\n var lineHeight = line.lineHeight;\n var remainedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token = void 0;\n while (leftIndex < tokenCount\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n remainedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n while (rightIndex >= 0\n && (token = tokens[rightIndex], token.align === 'right')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n remainedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n }\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex];\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\n lineXLeft += token.width;\n leftIndex++;\n }\n lineTop += lineHeight;\n }\n };\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text;\n var verticalAlign = token.verticalAlign;\n var y = lineTop + lineHeight / 2;\n if (verticalAlign === 'top') {\n y = lineTop + token.height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\n ? x - token.width\n : textAlign === 'center'\n ? x - token.width / 2\n : x, y - token.height / 2, token.width, token.height);\n var bgColorDrawn = !!tokenStyle.backgroundColor;\n var textPadding = token.textPadding;\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n }\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n var defaultStyle = this._defaultStyle;\n var useDefaultFill = false;\n var defaultLineWidth = 0;\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\n : 'fill' in style ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\n : 'stroke' in style ? style.stroke\n : (!bgColorDrawn\n && !parentBgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = tokenStyle.textShadowBlur > 0\n || style.textShadowBlur > 0;\n subElStyle.text = token.text;\n subElStyle.x = x;\n subElStyle.y = y;\n if (hasShadow) {\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n }\n subElStyle.textAlign = textAlign;\n subElStyle.textBaseline = 'middle';\n subElStyle.font = token.font || DEFAULT_FONT;\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n if (textStroke) {\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n subElStyle.stroke = textStroke;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n var textWidth = token.contentWidth;\n var textHeight = token.contentHeight;\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\n };\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\n var textBackgroundColor = style.backgroundColor;\n var textBorderWidth = style.borderWidth;\n var textBorderColor = style.borderColor;\n var isPlainBg = isString(textBackgroundColor);\n var textBorderRadius = style.borderRadius;\n var self = this;\n var rectEl;\n var imgEl;\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\n rectEl = this._getOrCreateChild(Rect);\n rectEl.useStyle(rectEl.createStyle());\n rectEl.style.fill = null;\n var rectShape = rectEl.shape;\n rectShape.x = x;\n rectShape.y = y;\n rectShape.width = width;\n rectShape.height = height;\n rectShape.r = textBorderRadius;\n rectEl.dirtyShape();\n }\n if (isPlainBg) {\n var rectStyle = rectEl.style;\n rectStyle.fill = textBackgroundColor || null;\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n }\n else if (textBackgroundColor && textBackgroundColor.image) {\n imgEl = this._getOrCreateChild(ZRImage);\n imgEl.onload = function () {\n self.dirtyStyle();\n };\n var imgStyle = imgEl.style;\n imgStyle.image = textBackgroundColor.image;\n imgStyle.x = x;\n imgStyle.y = y;\n imgStyle.width = width;\n imgStyle.height = height;\n }\n if (textBorderWidth && textBorderColor) {\n var rectStyle = rectEl.style;\n rectStyle.lineWidth = textBorderWidth;\n rectStyle.stroke = textBorderColor;\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n rectStyle.lineDash = style.borderDash;\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\n rectEl.strokeContainThreshold = 0;\n if (rectEl.hasFill() && rectEl.hasStroke()) {\n rectStyle.strokeFirst = true;\n rectStyle.lineWidth *= 2;\n }\n }\n var commonStyle = (rectEl || imgEl).style;\n commonStyle.shadowBlur = style.shadowBlur || 0;\n commonStyle.shadowColor = style.shadowColor || 'transparent';\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n };\n ZRText.makeFont = function (style) {\n var font = '';\n if (style.fontSize || style.fontFamily || style.fontWeight) {\n var fontSize = '';\n if (typeof style.fontSize === 'string'\n && (style.fontSize.indexOf('px') !== -1\n || style.fontSize.indexOf('rem') !== -1\n || style.fontSize.indexOf('em') !== -1)) {\n fontSize = style.fontSize;\n }\n else if (!isNaN(+style.fontSize)) {\n fontSize = style.fontSize + 'px';\n }\n else {\n fontSize = '12px';\n }\n font = [\n style.fontStyle,\n style.fontWeight,\n fontSize,\n style.fontFamily || 'sans-serif'\n ].join(' ');\n }\n return font && trim(font) || style.textFont || style.font;\n };\n return ZRText;\n}(Displayable));\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\nexport function normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\nfunction normalizeStyle(style) {\n if (style) {\n style.font = ZRText.makeFont(style);\n var textAlign = style.align;\n textAlign === 'middle' && (textAlign = 'center');\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\n var verticalAlign = style.verticalAlign;\n verticalAlign === 'center' && (verticalAlign = 'middle');\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\n var textPadding = style.padding;\n if (textPadding) {\n style.padding = normalizeCssArray(style.padding);\n }\n }\n}\nfunction getStroke(stroke, lineWidth) {\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n ? null\n : (stroke.image || stroke.colorStops)\n ? '#000'\n : stroke;\n}\nfunction getFill(fill) {\n return (fill == null || fill === 'none')\n ? null\n : (fill.image || fill.colorStops)\n ? '#000'\n : fill;\n}\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right'\n ? (x - textPadding[1])\n : textAlign === 'center'\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n : (x + textPadding[3]);\n}\nfunction getStyleText(style) {\n var text = style.text;\n text != null && (text += '');\n return text;\n}\nfunction needDrawBackground(style) {\n return !!(style.backgroundColor\n || (style.borderWidth && style.borderColor));\n}\nexport default ZRText;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from './model';\nexport var getECData = makeInner();","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LRU from 'zrender/lib/core/LRU';\nimport { extend, indexOf, isArrayLike, isObject, keys, isArray, each } from 'zrender/lib/core/util';\nimport { getECData } from './innerStore';\nimport * as colorTool from 'zrender/lib/tool/color';\nimport { queryDataIndex, makeInner } from './model';\nimport Path from 'zrender/lib/graphic/Path';\nimport { error } from './log'; // Reserve 0 as default.\n\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar getSavedStates = makeInner();\nexport var HOVER_STATE_NORMAL = 0;\nexport var HOVER_STATE_BLUR = 1;\nexport var HOVER_STATE_EMPHASIS = 2;\nexport var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\nexport var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\nexport var Z2_EMPHASIS_LIFT = 10;\nexport var Z2_SELECT_LIFT = 9;\nexport var HIGHLIGHT_ACTION_TYPE = 'highlight';\nexport var DOWNPLAY_ACTION_TYPE = 'downplay';\nexport var SELECT_ACTION_TYPE = 'select';\nexport var UNSELECT_ACTION_TYPE = 'unselect';\nexport var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\n\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n} // Most lifted color are duplicated.\n\n\nvar liftedColorCache = new LRU(100);\n\nfunction liftColor(color) {\n if (typeof color !== 'string') {\n return color;\n }\n\n var liftedColor = liftedColorCache.get(color);\n\n if (!liftedColor) {\n liftedColor = colorTool.lift(color, -0.1);\n liftedColorCache.put(color, liftedColor);\n }\n\n return liftedColor;\n}\n\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\n el.onHoverStateChange(stateName);\n }\n\n el.hoverState = hoverStateEnum;\n}\n\nfunction singleEnterEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\n}\n\nfunction singleLeaveEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterBlur(el) {\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\n}\n\nfunction singleLeaveBlur(el) {\n if (el.hoverState === HOVER_STATE_BLUR) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterSelect(el) {\n el.selected = true;\n}\n\nfunction singleLeaveSelect(el) {\n el.selected = false;\n}\n\nfunction updateElementState(el, updater, commonParam) {\n updater(el, commonParam);\n}\n\nfunction traverseUpdateState(el, updater, commonParam) {\n updateElementState(el, updater, commonParam);\n el.isGroup && el.traverse(function (child) {\n updateElementState(child, updater, commonParam);\n });\n}\n\nexport function setStatesFlag(el, stateName) {\n switch (stateName) {\n case 'emphasis':\n el.hoverState = HOVER_STATE_EMPHASIS;\n break;\n\n case 'normal':\n el.hoverState = HOVER_STATE_NORMAL;\n break;\n\n case 'blur':\n el.hoverState = HOVER_STATE_BLUR;\n break;\n\n case 'select':\n el.selected = true;\n }\n}\n/**\n * If we reuse elements when rerender.\n * DONT forget to clearStates before we update the style and shape.\n * Or we may update on the wrong state instead of normal state.\n */\n\nexport function clearStates(el) {\n if (el.isGroup) {\n el.traverse(function (child) {\n child.clearStates();\n });\n } else {\n el.clearStates();\n }\n}\n\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\n var style = el.style;\n var fromState = {};\n\n for (var i = 0; i < props.length; i++) {\n var propName = props[i];\n var val = style[propName];\n fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.__fromStateTransition // Dont consider the animation to emphasis state.\n && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') {\n animator.saveFinalToTarget(fromState, props);\n }\n }\n\n return fromState;\n}\n\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\n var cloned = false;\n\n if (el instanceof Path) {\n var store = getSavedStates(el);\n var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill;\n var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke;\n\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\n state = state || {}; // Apply default color lift\n\n var emphasisStyle = state.style || {};\n\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\n cloned = true; // Not modify the original value.\n\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times.\n\n emphasisStyle.fill = liftColor(fromFill);\n } // Not highlight stroke if fill has been highlighted.\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\n if (!cloned) {\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n }\n\n emphasisStyle.stroke = liftColor(fromStroke);\n }\n\n state.style = emphasisStyle;\n }\n }\n\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n if (!cloned) {\n state = extend({}, state);\n }\n\n var z2EmphasisLift = el.z2EmphasisLift;\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createSelectDefaultState(el, stateName, state) {\n // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n state = extend({}, state);\n var z2SelectLift = el.z2SelectLift;\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createBlurDefaultState(el, stateName, state) {\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\n var currentOpacity = el.style.opacity;\n var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, {\n opacity: 1\n }) : null;\n state = state || {};\n var blurStyle = state.style || {};\n\n if (blurStyle.opacity == null) {\n // clone state\n state = extend({}, state);\n blurStyle = extend({\n // Already being applied 'emphasis'. DON'T mul opacity multiple times.\n opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1\n }, blurStyle);\n state.style = blurStyle;\n }\n\n return state;\n}\n\nfunction elementStateProxy(stateName, targetStates) {\n var state = this.states[stateName];\n\n if (this.style) {\n if (stateName === 'emphasis') {\n return createEmphasisDefaultState(this, stateName, targetStates, state);\n } else if (stateName === 'blur') {\n return createBlurDefaultState(this, stateName, state);\n } else if (stateName === 'select') {\n return createSelectDefaultState(this, stateName, state);\n }\n }\n\n return state;\n}\n/**FI\n * Set hover style (namely \"emphasis style\") of element.\n * @param el Should not be `zrender/graphic/Group`.\n * @param focus 'self' | 'selfInSeries' | 'series'\n */\n\n\nexport function setDefaultStateProxy(el) {\n el.stateProxy = elementStateProxy;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (textContent) {\n textContent.stateProxy = elementStateProxy;\n }\n\n if (textGuide) {\n textGuide.stateProxy = elementStateProxy;\n }\n}\nexport function enterEmphasisWhenMouseOver(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasisWhenMouseOut(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterEmphasis(el, highlightDigit) {\n el.__highByOuter |= 1 << (highlightDigit || 0);\n traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasis(el, highlightDigit) {\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterBlur(el) {\n traverseUpdateState(el, singleEnterBlur);\n}\nexport function leaveBlur(el) {\n traverseUpdateState(el, singleLeaveBlur);\n}\nexport function enterSelect(el) {\n traverseUpdateState(el, singleEnterSelect);\n}\nexport function leaveSelect(el) {\n traverseUpdateState(el, singleLeaveSelect);\n}\n\nfunction shouldSilent(el, e) {\n return el.__highDownSilentOnTouch && e.zrByTouch;\n}\n\nexport function allLeaveBlur(api) {\n var model = api.getModel();\n model.eachComponent(function (componentType, componentModel) {\n var view = componentType === 'series' ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel); // Leave blur anyway\n\n view.group.traverse(function (child) {\n singleLeaveBlur(child);\n });\n });\n}\nexport function blurSeries(targetSeriesIndex, focus, blurScope, api) {\n var ecModel = api.getModel();\n blurScope = blurScope || 'coordinateSystem';\n\n function leaveBlurOfIndices(data, dataIndices) {\n for (var i = 0; i < dataIndices.length; i++) {\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\n itemEl && leaveBlur(itemEl);\n }\n }\n\n if (targetSeriesIndex == null) {\n return;\n }\n\n if (!focus || focus === 'none') {\n return;\n }\n\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\n var targetCoordSys = targetSeriesModel.coordinateSystem;\n\n if (targetCoordSys && targetCoordSys.master) {\n targetCoordSys = targetCoordSys.master;\n }\n\n var blurredSeries = [];\n ecModel.eachSeries(function (seriesModel) {\n var sameSeries = targetSeriesModel === seriesModel;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.master) {\n coordSys = coordSys.master;\n }\n\n var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead.\n\n if (!( // Not blur other series if blurScope series\n blurScope === 'series' && !sameSeries // Not blur other coordinate system if blurScope is coordinateSystem\n || blurScope === 'coordinateSystem' && !sameCoordSys // Not blur self series if focus is series.\n || focus === 'series' && sameSeries // TODO blurScope: coordinate system\n )) {\n var view = api.getViewOfSeriesModel(seriesModel);\n view.group.traverse(function (child) {\n singleEnterBlur(child);\n });\n\n if (isArrayLike(focus)) {\n leaveBlurOfIndices(seriesModel.getData(), focus);\n } else if (isObject(focus)) {\n var dataTypes = keys(focus);\n\n for (var d = 0; d < dataTypes.length; d++) {\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\n }\n }\n\n blurredSeries.push(seriesModel);\n }\n });\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (view && view.blurSeries) {\n view.blurSeries(blurredSeries, ecModel);\n }\n });\n}\nexport function blurComponent(componentMainType, componentIndex, api) {\n if (componentMainType == null || componentIndex == null) {\n return;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.focusBlurEnabled) {\n return;\n }\n\n view.group.traverse(function (child) {\n singleEnterBlur(child);\n });\n}\nexport function blurSeriesFromHighlightPayload(seriesModel, payload, api) {\n var seriesIndex = seriesModel.seriesIndex;\n var data = seriesModel.getData(payload.dataType);\n var dataIndex = queryDataIndex(data, payload); // Pick the first one if there is multiple/none exists.\n\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\n var el = data.getItemGraphicEl(dataIndex);\n\n if (!el) {\n var count = data.count();\n var current = 0; // If data on dataIndex is NaN.\n\n while (!el && current < count) {\n el = data.getItemGraphicEl(current++);\n }\n }\n\n if (el) {\n var ecData = getECData(el);\n blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api);\n } else {\n // If there is no element put on the data. Try getting it from raw option\n // TODO Should put it on seriesModel?\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n\n if (focus_1 != null) {\n blurSeries(seriesIndex, focus_1, blurScope, api);\n }\n }\n}\nexport function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) {\n var ret = {\n focusSelf: false,\n dispatchers: null\n };\n\n if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) {\n return ret;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return ret;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.findHighDownDispatchers) {\n return ret;\n }\n\n var dispatchers = view.findHighDownDispatchers(name); // At presnet, the component (like Geo) only blur inside itself.\n // So we do not use `blurScope` in component.\n\n var focusSelf;\n\n for (var i = 0; i < dispatchers.length; i++) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatchers[i])) {\n error('param should be highDownDispatcher');\n }\n\n if (getECData(dispatchers[i]).focus === 'self') {\n focusSelf = true;\n break;\n }\n }\n\n return {\n focusSelf: focusSelf,\n dispatchers: dispatchers\n };\n}\nexport function handleGlobalMouseOverForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n var ecData = getECData(dispatcher);\n\n var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api),\n dispatchers = _a.dispatchers,\n focusSelf = _a.focusSelf; // If `findHighDownDispatchers` is supported on the component,\n // highlight/downplay elements with the same name.\n\n\n if (dispatchers) {\n if (focusSelf) {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n }\n\n each(dispatchers, function (dispatcher) {\n return enterEmphasisWhenMouseOver(dispatcher, e);\n });\n } else {\n // Try blur all in the related series. Then emphasis the hoverred.\n // TODO. progressive mode.\n blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\n\n if (ecData.focus === 'self') {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n } // Other than series, component that not support `findHighDownDispatcher` will\n // also use it. But in this case, highlight/downplay are only supported in\n // mouse hover but not in dispatchAction.\n\n\n enterEmphasisWhenMouseOver(dispatcher, e);\n }\n}\nexport function handleGlboalMouseOutForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n allLeaveBlur(api);\n var ecData = getECData(dispatcher);\n var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers;\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n return leaveEmphasisWhenMouseOut(dispatcher, e);\n });\n } else {\n leaveEmphasisWhenMouseOut(dispatcher, e);\n }\n}\nexport function toggleSelectionFromPayload(seriesModel, payload, api) {\n if (!isSelectChangePayload(payload)) {\n return;\n }\n\n var dataType = payload.dataType;\n var data = seriesModel.getData(dataType);\n var dataIndex = queryDataIndex(data, payload);\n\n if (!isArray(dataIndex)) {\n dataIndex = [dataIndex];\n }\n\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\n}\nexport function updateSeriesElementSelection(seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n data.eachItemGraphicEl(function (el, idx) {\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\n });\n });\n}\nexport function getAllSelectedIndices(ecModel) {\n var ret = [];\n ecModel.eachSeries(function (seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n var dataIndices = seriesModel.getSelectedDataIndices();\n\n if (dataIndices.length > 0) {\n var item = {\n dataIndex: dataIndices,\n seriesIndex: seriesModel.seriesIndex\n };\n\n if (type != null) {\n item.dataType = type;\n }\n\n ret.push(item);\n }\n });\n });\n return ret;\n}\n/**\n * Enable the function that mouseover will trigger the emphasis state.\n *\n * NOTE:\n * This function should be used on the element with dataIndex, seriesIndex.\n *\n */\n\nexport function enableHoverEmphasis(el, focus, blurScope) {\n setAsHighDownDispatcher(el, true);\n traverseUpdateState(el, setDefaultStateProxy);\n enableHoverFocus(el, focus, blurScope);\n}\nexport function enableHoverFocus(el, focus, blurScope) {\n var ecData = getECData(el);\n\n if (focus != null) {\n // TODO dataIndex may be set after this function. This check is not useful.\n // if (ecData.dataIndex == null) {\n // if (__DEV__) {\n // console.warn('focus can only been set on element with dataIndex');\n // }\n // }\n // else {\n ecData.focus = focus;\n ecData.blurScope = blurScope; // }\n } else if (ecData.focus) {\n ecData.focus = null;\n }\n}\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\nvar defaultStyleGetterMap = {\n itemStyle: 'getItemStyle',\n lineStyle: 'getLineStyle',\n areaStyle: 'getAreaStyle'\n};\n/**\n * Set emphasis/blur/selected states of element.\n */\n\nexport function setStatesStylesFromModel(el, itemModel, styleType, // default itemStyle\ngetter) {\n styleType = styleType || 'itemStyle';\n\n for (var i = 0; i < OTHER_STATES.length; i++) {\n var stateName = OTHER_STATES[i];\n var model = itemModel.getModel([stateName, styleType]);\n var state = el.ensureState(stateName); // Let it throw error if getterType is not found.\n\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\n }\n}\n/**\n * @parame el\n * @param el.highDownSilentOnTouch\n * In touch device, mouseover event will be trigger on touchstart event\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\n * conveniently use hoverStyle when tap on touch screen without additional\n * code for compatibility.\n * But if the chart/component has select feature, which usually also use\n * hoverStyle, there might be conflict between 'select-highlight' and\n * 'hover-highlight' especially when roam is enabled (see geo for example).\n * In this case, `highDownSilentOnTouch` should be used to disable\n * hover-highlight on touch device.\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\n */\n\nexport function setAsHighDownDispatcher(el, asDispatcher) {\n var disable = asDispatcher === false;\n var extendedEl = el; // Make `highDownSilentOnTouch` and `onStateChange` only work after\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n\n if (el.highDownSilentOnTouch) {\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n } // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n\n if (!disable || extendedEl.__highDownDispatcher) {\n // Emphasis, normal can be triggered manually by API or other components like hover link.\n // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\n // Also keep previous record.\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\n extendedEl.__highDownDispatcher = !disable;\n }\n}\nexport function isHighDownDispatcher(el) {\n return !!(el && el.__highDownDispatcher);\n}\n/**\n * Enable component highlight/downplay features:\n * + hover link (within the same name)\n * + focus blur in component\n */\n\nexport function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n var ecData = getECData(el);\n ecData.componentMainType = componentModel.mainType;\n ecData.componentIndex = componentModel.componentIndex;\n ecData.componentHighDownName = componentHighDownName;\n}\n/**\n * Support hightlight/downplay record on each elements.\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\n * user triggerred hightlight/downplay should not conflict.\n * Only all of the highlightDigit cleared, return to normal.\n * @param {string} highlightKey\n * @return {number} highlightDigit\n */\n\nexport function getHighlightDigit(highlightKey) {\n var highlightDigit = _highlightKeyMap[highlightKey];\n\n if (highlightDigit == null && _highlightNextDigit <= 32) {\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n }\n\n return highlightDigit;\n}\nexport function isSelectChangePayload(payload) {\n var payloadType = payload.type;\n return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;\n}\nexport function isHighDownPayload(payload) {\n var payloadType = payload.type;\n return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;\n}\nexport function savePathStates(el) {\n var store = getSavedStates(el);\n store.normalFill = el.style.fill;\n store.normalStroke = el.style.stroke;\n var selectState = el.states.select || {};\n store.selectFill = selectState.style && selectState.style.fill || null;\n store.selectStroke = selectState.style && selectState.style.stroke || null;\n}","import PathProxy from '../core/PathProxy';\nimport { applyTransform as v2ApplyTransform } from '../core/vector';\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\nexport default function transformPath(path, m) {\n var data = path.data;\n var len = path.len();\n var cmd;\n var nPoint;\n var i;\n var j;\n var k;\n var p;\n var M = CMD.M;\n var C = CMD.C;\n var L = CMD.L;\n var R = CMD.R;\n var A = CMD.A;\n var Q = CMD.Q;\n for (i = 0, j = 0; i < len;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n case L:\n nPoint = 1;\n break;\n case C:\n nPoint = 3;\n break;\n case Q:\n nPoint = 2;\n break;\n case A:\n var x = m[4];\n var y = m[5];\n var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\n data[i] *= sx;\n data[i++] += x;\n data[i] *= sy;\n data[i++] += y;\n data[i++] *= sx;\n data[i++] *= sy;\n data[i++] += angle;\n data[i++] += angle;\n i += 2;\n j = i;\n break;\n case R:\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n p[0] += data[i++];\n p[1] += data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n }\n for (k = 0; k < nPoint; k++) {\n var p_1 = points[k];\n p_1[0] = data[i++];\n p_1[1] = data[i++];\n v2ApplyTransform(p_1, p_1, m);\n data[j++] = p_1[0];\n data[j++] = p_1[1];\n }\n }\n path.increaseVersion();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../graphic/Path';\nimport PathProxy from '../core/PathProxy';\nimport transformPath from './transformPath';\nimport { extend } from '../core/util';\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n;\nfunction vRatio(u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n}\n;\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n * Math.acos(vRatio(u, v));\n}\n;\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0\n + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n var f = (fa === fs ? -1 : 1)\n * mathSqrt((((rx * rx) * (ry * ry))\n - ((rx * rx) * (yp * yp))\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n + (ry * ry) * (xp * xp))) || 0;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0\n + mathCos(psi) * cxp\n - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0\n + mathSin(psi) * cxp\n + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (dTheta < 0) {\n var n = Math.round(dTheta / PI * 1e6) / 1e6;\n dTheta = PI * 2 + (n % 2) * PI;\n }\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction createPathProxyFromString(data) {\n var path = new PathProxy();\n if (!data) {\n return path;\n }\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var CMD = PathProxy.CMD;\n var cmdList = data.match(commandReg);\n if (!cmdList) {\n return path;\n }\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd = void 0;\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n var off = 0;\n while (off < pLen) {\n var ctlPtx = void 0;\n var ctlPty = void 0;\n var rx = void 0;\n var ry = void 0;\n var psi = void 0;\n var fa = void 0;\n var fs = void 0;\n var x1 = cpx;\n var y1 = cpy;\n var len = void 0;\n var pathData = void 0;\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd);\n cpx = subpathX;\n cpy = subpathY;\n }\n prevCmd = cmd;\n }\n path.toStatic();\n return path;\n}\nvar SVGPath = (function (_super) {\n __extends(SVGPath, _super);\n function SVGPath() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SVGPath.prototype.applyTransform = function (m) { };\n return SVGPath;\n}(Path));\nfunction isPathProxy(path) {\n return path.setData != null;\n}\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n var innerOpts = extend({}, opts);\n innerOpts.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.setData(pathProxy.data);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n else {\n var ctx = path;\n pathProxy.rebuildPath(ctx, 1);\n }\n };\n innerOpts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirtyShape();\n };\n return innerOpts;\n}\nexport function createFromString(str, opts) {\n return new SVGPath(createPathOptions(str, opts));\n}\nexport function extendFromString(str, defaultOpts) {\n var innerOpts = createPathOptions(str, defaultOpts);\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n _this.applyTransform = innerOpts.applyTransform;\n _this.buildPath = innerOpts.buildPath;\n return _this;\n }\n return Sub;\n }(SVGPath));\n return Sub;\n}\nexport function mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n if (!pathEl.path) {\n pathEl.createPathProxy();\n }\n if (pathEl.shapeChanged()) {\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\n }\n pathList.push(pathEl.path);\n }\n var pathBundle = new Path(opts);\n pathBundle.createPathProxy();\n pathBundle.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.appendPath(pathList);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n };\n return pathBundle;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nvar CircleShape = (function () {\n function CircleShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n }\n return CircleShape;\n}());\nexport { CircleShape };\nvar Circle = (function (_super) {\n __extends(Circle, _super);\n function Circle(opts) {\n return _super.call(this, opts) || this;\n }\n Circle.prototype.getDefaultShape = function () {\n return new CircleShape();\n };\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n }\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n };\n return Circle;\n}(Path));\n;\nCircle.prototype.type = 'circle';\nexport default Circle;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nvar EllipseShape = (function () {\n function EllipseShape() {\n this.cx = 0;\n this.cy = 0;\n this.rx = 0;\n this.ry = 0;\n }\n return EllipseShape;\n}());\nexport { EllipseShape };\nvar Ellipse = (function (_super) {\n __extends(Ellipse, _super);\n function Ellipse(opts) {\n return _super.call(this, opts) || this;\n }\n Ellipse.prototype.getDefaultShape = function () {\n return new EllipseShape();\n };\n Ellipse.prototype.buildPath = function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k;\n var oy = b * k;\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n };\n return Ellipse;\n}(Path));\nEllipse.prototype.type = 'ellipse';\nexport default Ellipse;\n","import { normalizeArcAngles } from '../../core/PathProxy';\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar mathACos = Math.acos;\nvar mathATan2 = Math.atan2;\nvar mathAbs = Math.abs;\nvar mathSqrt = Math.sqrt;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar e = 1e-4;\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0;\n var y10 = y1 - y0;\n var x32 = x3 - x2;\n var y32 = y3 - y2;\n var t = y32 * x10 - x32 * y10;\n if (t * t < e) {\n return;\n }\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\n var x01 = x0 - x1;\n var y01 = y0 - y1;\n var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n var ox = lo * y01;\n var oy = -lo * x01;\n var x11 = x0 + ox;\n var y11 = y0 + oy;\n var x10 = x1 + ox;\n var y10 = y1 + oy;\n var x00 = (x11 + x10) / 2;\n var y00 = (y11 + y10) / 2;\n var dx = x10 - x11;\n var dy = y10 - y11;\n var d2 = dx * dx + dy * dy;\n var r = radius - cr;\n var s = x11 * y10 - x10 * y11;\n var d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n var cx0 = (s * dy - dx * d) / d2;\n var cy0 = (-s * dx - dy * d) / d2;\n var cx1 = (s * dy + dx * d) / d2;\n var cy1 = (-s * dx + dy * d) / d2;\n var dx0 = cx0 - x00;\n var dy0 = cy0 - y00;\n var dx1 = cx1 - x00;\n var dy1 = cy1 - y00;\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1;\n cy0 = cy1;\n }\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (radius / r - 1),\n y11: cy0 * (radius / r - 1)\n };\n}\nexport function buildPath(ctx, shape) {\n var radius = mathMax(shape.r, 0);\n var innerRadius = mathMax(shape.r0 || 0, 0);\n var hasRadius = radius > 0;\n var hasInnerRadius = innerRadius > 0;\n if (!hasRadius && !hasInnerRadius) {\n return;\n }\n if (!hasRadius) {\n radius = innerRadius;\n innerRadius = 0;\n }\n if (innerRadius > radius) {\n var tmp = radius;\n radius = innerRadius;\n innerRadius = tmp;\n }\n var clockwise = !!shape.clockwise;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var arc;\n if (startAngle === endAngle) {\n arc = 0;\n }\n else {\n var tmpAngles = [startAngle, endAngle];\n normalizeArcAngles(tmpAngles, !clockwise);\n arc = mathAbs(tmpAngles[0] - tmpAngles[1]);\n }\n var x = shape.cx;\n var y = shape.cy;\n var cornerRadius = shape.cornerRadius || 0;\n var innerCornerRadius = shape.innerCornerRadius || 0;\n if (!(radius > e)) {\n ctx.moveTo(x, y);\n }\n else if (arc > PI2 - e) {\n ctx.moveTo(x + radius * mathCos(startAngle), y + radius * mathSin(startAngle));\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\n if (innerRadius > e) {\n ctx.moveTo(x + innerRadius * mathCos(endAngle), y + innerRadius * mathSin(endAngle));\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n else {\n var halfRd = mathAbs(radius - innerRadius) / 2;\n var cr = mathMin(halfRd, cornerRadius);\n var icr = mathMin(halfRd, innerCornerRadius);\n var cr0 = icr;\n var cr1 = cr;\n var xrs = radius * mathCos(startAngle);\n var yrs = radius * mathSin(startAngle);\n var xire = innerRadius * mathCos(endAngle);\n var yire = innerRadius * mathSin(endAngle);\n var xre = void 0;\n var yre = void 0;\n var xirs = void 0;\n var yirs = void 0;\n if (cr > e || icr > e) {\n xre = radius * mathCos(endAngle);\n yre = radius * mathSin(endAngle);\n xirs = innerRadius * mathCos(startAngle);\n yirs = innerRadius * mathSin(startAngle);\n if (arc < PI) {\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n if (it_1) {\n var x0 = xrs - it_1[0];\n var y0 = yrs - it_1[1];\n var x1 = xre - it_1[0];\n var y1 = yre - it_1[1];\n var a = 1 / mathSin(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);\n var b = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\n cr0 = mathMin(icr, (innerRadius - b) / (a - 1));\n cr1 = mathMin(cr, (radius - b) / (a + 1));\n }\n }\n }\n if (!(arc > e)) {\n ctx.moveTo(x + xrs, y + yrs);\n }\n else if (cr1 > e) {\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\n if (cr1 < cr) {\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\n }\n else {\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\n }\n }\n else {\n ctx.moveTo(x + xrs, y + yrs);\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\n }\n if (!(innerRadius > e) || !(arc > e)) {\n ctx.lineTo(x + xire, y + yire);\n }\n else if (cr0 > e) {\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\n if (cr0 < icr) {\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\n }\n else {\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\n }\n }\n else {\n ctx.lineTo(x + xire, y + yire);\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n ctx.closePath();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport * as roundSectorHelper from '../helper/roundSector';\nvar SectorShape = (function () {\n function SectorShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n this.cornerRadius = 0;\n this.innerCornerRadius = 0;\n }\n return SectorShape;\n}());\nexport { SectorShape };\nvar Sector = (function (_super) {\n __extends(Sector, _super);\n function Sector(opts) {\n return _super.call(this, opts) || this;\n }\n Sector.prototype.getDefaultShape = function () {\n return new SectorShape();\n };\n Sector.prototype.buildPath = function (ctx, shape) {\n roundSectorHelper.buildPath(ctx, shape);\n };\n Sector.prototype.isZeroArea = function () {\n return this.shape.startAngle === this.shape.endAngle\n || this.shape.r === this.shape.r0;\n };\n return Sector;\n}(Path));\nSector.prototype.type = 'sector';\nexport default Sector;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nvar RingShape = (function () {\n function RingShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.r0 = 0;\n }\n return RingShape;\n}());\nexport { RingShape };\nvar Ring = (function (_super) {\n __extends(Ring, _super);\n function Ring(opts) {\n return _super.call(this, opts) || this;\n }\n Ring.prototype.getDefaultShape = function () {\n return new RingShape();\n };\n Ring.prototype.buildPath = function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n };\n return Ring;\n}(Path));\nRing.prototype.type = 'ring';\nexport default Ring;\n","import { distance as v2Distance } from '../../core/vector';\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\n + v0 * t + p1;\n}\nexport default function smoothSpline(points, isLoop) {\n var len = points.length;\n var ret = [];\n var distance = 0;\n for (var i = 1; i < len; i++) {\n distance += v2Distance(points[i - 1], points[i]);\n }\n var segs = distance / 2;\n segs = segs < len ? len : segs;\n for (var i = 0; i < segs; i++) {\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\n var idx = Math.floor(pos);\n var w = pos - idx;\n var p0 = void 0;\n var p1 = points[idx % len];\n var p2 = void 0;\n var p3 = void 0;\n if (!isLoop) {\n p0 = points[idx === 0 ? idx : idx - 1];\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\n }\n else {\n p0 = points[(idx - 1 + len) % len];\n p2 = points[(idx + 1) % len];\n p3 = points[(idx + 2) % len];\n }\n var w2 = w * w;\n var w3 = w * w2;\n ret.push([\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\n ]);\n }\n return ret;\n}\n","import { min as v2Min, max as v2Max, scale as v2Scale, distance as v2Distance, add as v2Add, clone as v2Clone, sub as v2Sub } from '../../core/vector';\nexport default function smoothBezier(points, smooth, isLoop, constraint) {\n var cps = [];\n var v = [];\n var v1 = [];\n var v2 = [];\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n for (var i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n }\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n }\n else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n }\n else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n v2Sub(v, nextPoint, prevPoint);\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n cps.push(cp0);\n cps.push(cp1);\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n","import smoothSpline from './smoothSpline';\nimport smoothBezier from './smoothBezier';\nexport function buildPath(ctx, shape, closePath) {\n var smooth = shape.smooth;\n var points = shape.points;\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n }\n else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n closePath && ctx.closePath();\n }\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport * as polyHelper from '../helper/poly';\nvar PolygonShape = (function () {\n function PolygonShape() {\n this.points = null;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolygonShape;\n}());\nexport { PolygonShape };\nvar Polygon = (function (_super) {\n __extends(Polygon, _super);\n function Polygon(opts) {\n return _super.call(this, opts) || this;\n }\n Polygon.prototype.getDefaultShape = function () {\n return new PolygonShape();\n };\n Polygon.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n };\n return Polygon;\n}(Path));\n;\nPolygon.prototype.type = 'polygon';\nexport default Polygon;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport * as polyHelper from '../helper/poly';\nvar PolylineShape = (function () {\n function PolylineShape() {\n this.points = null;\n this.percent = 1;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolylineShape;\n}());\nexport { PolylineShape };\nvar Polyline = (function (_super) {\n __extends(Polyline, _super);\n function Polyline(opts) {\n return _super.call(this, opts) || this;\n }\n Polyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Polyline.prototype.getDefaultShape = function () {\n return new PolylineShape();\n };\n Polyline.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n };\n return Polyline;\n}(Path));\nPolyline.prototype.type = 'polyline';\nexport default Polyline;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n function LineShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n __extends(Line, _super);\n function Line(opts) {\n return _super.call(this, opts) || this;\n }\n Line.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Line.prototype.getDefaultShape = function () {\n return new LineShape();\n };\n Line.prototype.buildPath = function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n };\n Line.prototype.pointAt = function (p) {\n var shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n };\n return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nimport * as vec2 from '../../core/vector';\nimport { quadraticSubdivide, cubicSubdivide, quadraticAt, cubicAt, quadraticDerivativeAt, cubicDerivativeAt } from '../../core/curve';\nvar out = [];\nvar BezierCurveShape = (function () {\n function BezierCurveShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.percent = 1;\n }\n return BezierCurveShape;\n}());\nexport { BezierCurveShape };\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n if (cpx2 === null || cpy2 === null) {\n return [\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n ];\n }\n else {\n return [\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n ];\n }\n}\nvar BezierCurve = (function (_super) {\n __extends(BezierCurve, _super);\n function BezierCurve(opts) {\n return _super.call(this, opts) || this;\n }\n BezierCurve.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n BezierCurve.prototype.getDefaultShape = function () {\n return new BezierCurveShape();\n };\n BezierCurve.prototype.buildPath = function (ctx, shape) {\n var x1 = shape.x1;\n var y1 = shape.y1;\n var x2 = shape.x2;\n var y2 = shape.y2;\n var cpx1 = shape.cpx1;\n var cpy1 = shape.cpy1;\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n }\n else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n };\n BezierCurve.prototype.pointAt = function (t) {\n return someVectorAt(this.shape, t, false);\n };\n BezierCurve.prototype.tangentAt = function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n };\n return BezierCurve;\n}(Path));\n;\nBezierCurve.prototype.type = 'bezier-curve';\nexport default BezierCurve;\n","import { __extends } from \"tslib\";\nimport Path from '../Path';\nvar ArcShape = (function () {\n function ArcShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n return ArcShape;\n}());\nexport { ArcShape };\nvar Arc = (function (_super) {\n __extends(Arc, _super);\n function Arc(opts) {\n return _super.call(this, opts) || this;\n }\n Arc.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Arc.prototype.getDefaultShape = function () {\n return new ArcShape();\n };\n Arc.prototype.buildPath = function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n };\n return Arc;\n}(Path));\nArc.prototype.type = 'arc';\nexport default Arc;\n","import { __extends } from \"tslib\";\nimport Path from './Path';\nvar CompoundPath = (function (_super) {\n __extends(CompoundPath, _super);\n function CompoundPath() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'compound';\n return _this;\n }\n CompoundPath.prototype._updatePathDirty = function () {\n var paths = this.shape.paths;\n var dirtyPath = this.shapeChanged();\n for (var i = 0; i < paths.length; i++) {\n dirtyPath = dirtyPath || paths[i].shapeChanged();\n }\n if (dirtyPath) {\n this.dirtyShape();\n }\n };\n CompoundPath.prototype.beforeBrush = function () {\n this._updatePathDirty();\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale();\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n };\n CompoundPath.prototype.buildPath = function (ctx, shape) {\n var paths = shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n };\n CompoundPath.prototype.afterBrush = function () {\n var paths = this.shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].pathUpdated();\n }\n };\n CompoundPath.prototype.getBoundingRect = function () {\n this._updatePathDirty.call(this);\n return Path.prototype.getBoundingRect.call(this);\n };\n return CompoundPath;\n}(Path));\nexport default CompoundPath;\n","var Gradient = (function () {\n function Gradient(colorStops) {\n this.colorStops = colorStops || [];\n }\n Gradient.prototype.addColorStop = function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n };\n return Gradient;\n}());\nexport default Gradient;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient';\nvar LinearGradient = (function (_super) {\n __extends(LinearGradient, _super);\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0 : x;\n _this.y = y == null ? 0 : y;\n _this.x2 = x2 == null ? 1 : x2;\n _this.y2 = y2 == null ? 0 : y2;\n _this.type = 'linear';\n _this.global = globalCoord || false;\n return _this;\n }\n return LinearGradient;\n}(Gradient));\nexport default LinearGradient;\n;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient';\nvar RadialGradient = (function (_super) {\n __extends(RadialGradient, _super);\n function RadialGradient(x, y, r, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0.5 : x;\n _this.y = y == null ? 0.5 : y;\n _this.r = r == null ? 0.5 : r;\n _this.type = 'radial';\n _this.global = globalCoord || false;\n return _this;\n }\n return RadialGradient;\n}(Gradient));\nexport default RadialGradient;\n","import Point from './Point';\nvar extent = [0, 0];\nvar extent2 = [0, 0];\nvar minTv = new Point();\nvar maxTv = new Point();\nvar OrientedBoundingRect = (function () {\n function OrientedBoundingRect(rect, transform) {\n this._corners = [];\n this._axes = [];\n this._origin = [0, 0];\n for (var i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (var i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n var corners = this._corners;\n var axes = this._axes;\n var x = rect.x;\n var y = rect.y;\n var x2 = x + rect.width;\n var y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n if (transform) {\n for (var i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n for (var i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n };\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\n var overlapped = true;\n var noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\n var overlapped = true;\n for (var i = 0; i < 2; i++) {\n var axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n var axis = this._axes[dim];\n var origin = this._origin;\n var proj = corners[0].dot(axis) + origin[dim];\n var min = proj;\n var max = proj;\n for (var i = 1; i < corners.length; i++) {\n var proj_1 = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj_1, min);\n max = Math.max(proj_1, max);\n }\n out[0] = min;\n out[1] = max;\n };\n return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n","import { __extends } from \"tslib\";\nimport Displayble from './Displayable';\nimport BoundingRect from '../core/BoundingRect';\nvar m = [];\nvar IncrementalDisplayable = (function (_super) {\n __extends(IncrementalDisplayable, _super);\n function IncrementalDisplayable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.notClear = true;\n _this.incremental = true;\n _this._displayables = [];\n _this._temporaryDisplayables = [];\n _this._cursor = 0;\n return _this;\n }\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n IncrementalDisplayable.prototype.useStyle = function () {\n this.style = {};\n };\n IncrementalDisplayable.prototype.getCursor = function () {\n return this._cursor;\n };\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\n this._cursor = this._displayables.length;\n };\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n this.notClear = false;\n };\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n this._temporaryDisplayables = [];\n };\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n }\n else {\n this._displayables.push(displayable);\n }\n this.markRedraw();\n };\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n };\n IncrementalDisplayable.prototype.getDisplayables = function () {\n return this._displayables;\n };\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n return this._temporaryDisplayables;\n };\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n };\n IncrementalDisplayable.prototype.update = function () {\n this.updateTransform();\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n };\n IncrementalDisplayable.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n rect.union(childRect);\n }\n this._rect = rect;\n }\n return this._rect;\n };\n IncrementalDisplayable.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n return false;\n };\n return IncrementalDisplayable;\n}(Displayble));\nexport default IncrementalDisplayable;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as pathTool from 'zrender/lib/tool/path';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as vector from 'zrender/lib/core/vector';\nimport Path from 'zrender/lib/graphic/Path';\nimport Transformable from 'zrender/lib/core/Transformable';\nimport ZRImage from 'zrender/lib/graphic/Image';\nimport Group from 'zrender/lib/graphic/Group';\nimport ZRText from 'zrender/lib/graphic/Text';\nimport Circle from 'zrender/lib/graphic/shape/Circle';\nimport Ellipse from 'zrender/lib/graphic/shape/Ellipse';\nimport Sector from 'zrender/lib/graphic/shape/Sector';\nimport Ring from 'zrender/lib/graphic/shape/Ring';\nimport Polygon from 'zrender/lib/graphic/shape/Polygon';\nimport Polyline from 'zrender/lib/graphic/shape/Polyline';\nimport Rect from 'zrender/lib/graphic/shape/Rect';\nimport Line from 'zrender/lib/graphic/shape/Line';\nimport BezierCurve from 'zrender/lib/graphic/shape/BezierCurve';\nimport Arc from 'zrender/lib/graphic/shape/Arc';\nimport CompoundPath from 'zrender/lib/graphic/CompoundPath';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient';\nimport RadialGradient from 'zrender/lib/graphic/RadialGradient';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport OrientedBoundingRect from 'zrender/lib/core/OrientedBoundingRect';\nimport Point from 'zrender/lib/core/Point';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable';\nimport * as subPixelOptimizeUtil from 'zrender/lib/graphic/helper/subPixelOptimize';\nimport { extend, isArrayLike, map, defaults, isObject, retrieve2, isString, keys, each, hasOwn } from 'zrender/lib/core/util';\nimport { getECData } from './innerStore';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar _customShapeMap = {};\n/**\n * Extend shape with parameters\n */\n\nexport function extendShape(opts) {\n return Path.extend(opts);\n}\nvar extendPathFromString = pathTool.extendFromString;\n/**\n * Extend path\n */\n\nexport function extendPath(pathData, opts) {\n return extendPathFromString(pathData, opts);\n}\n/**\n * Register a user defined shape.\n * The shape class can be fetched by `getShapeClass`\n * This method will overwrite the registered shapes, including\n * the registered built-in shapes, if using the same `name`.\n * The shape can be used in `custom series` and\n * `graphic component` by declaring `{type: name}`.\n *\n * @param name\n * @param ShapeClass Can be generated by `extendShape`.\n */\n\nexport function registerShape(name, ShapeClass) {\n _customShapeMap[name] = ShapeClass;\n}\n/**\n * Find shape class registered by `registerShape`. Usually used in\n * fetching user defined shape.\n *\n * [Caution]:\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\n * to use user registered shapes.\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\n * `registerShape` by default. That enables users to get both built-in\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\n * the built-in shapes by using names like 'circle', 'rect' via calling\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\n * in case that it is overwritten by users, except that some features, like\n * `custom series`, `graphic component`, do it deliberately.\n *\n * (2) In the features like `custom series`, `graphic component`, the user input\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\n * are reserved names, that is, if some user register a shape named `'image'`,\n * the shape will not be used. If we intending to add some more reserved names\n * in feature, that might bring break changes (disable some existing user shape\n * names). But that case probably rearly happen. So we dont make more mechanism\n * to resolve this issue here.\n *\n * @param name\n * @return The shape class. If not found, return nothing.\n */\n\nexport function getShapeClass(name) {\n if (_customShapeMap.hasOwnProperty(name)) {\n return _customShapeMap[name];\n }\n}\n/**\n * Create a path element from path data string\n * @param pathData\n * @param opts\n * @param rect\n * @param layout 'center' or 'cover' default to be cover\n */\n\nexport function makePath(pathData, opts, rect, layout) {\n var path = pathTool.createFromString(pathData, opts);\n\n if (rect) {\n if (layout === 'center') {\n rect = centerGraphic(rect, path.getBoundingRect());\n }\n\n resizePath(path, rect);\n }\n\n return path;\n}\n/**\n * Create a image element from image url\n * @param imageUrl image url\n * @param opts options\n * @param rect constrain rect\n * @param layout 'center' or 'cover'. Default to be 'cover'\n */\n\nexport function makeImage(imageUrl, rect, layout) {\n var zrImg = new ZRImage({\n style: {\n image: imageUrl,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n onload: function (img) {\n if (layout === 'center') {\n var boundingRect = {\n width: img.width,\n height: img.height\n };\n zrImg.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return zrImg;\n}\n/**\n * Get position of centered element in bounding box.\n *\n * @param rect element local bounding box\n * @param boundingRect constraint bounding box\n * @return element position containing x, y, width, and height\n */\n\nfunction centerGraphic(rect, boundingRect) {\n // Set rect to center, keep width / height ratio.\n var aspect = boundingRect.width / boundingRect.height;\n var width = rect.height * aspect;\n var height;\n\n if (width <= rect.width) {\n height = rect.height;\n } else {\n width = rect.width;\n height = width / aspect;\n }\n\n var cx = rect.x + rect.width / 2;\n var cy = rect.y + rect.height / 2;\n return {\n x: cx - width / 2,\n y: cy - height / 2,\n width: width,\n height: height\n };\n}\n\nexport var mergePath = pathTool.mergePath;\n/**\n * Resize a path to fit the rect\n * @param path\n * @param rect\n */\n\nexport function resizePath(path, rect) {\n if (!path.applyTransform) {\n return;\n }\n\n var pathRect = path.getBoundingRect();\n var m = pathRect.calculateTransform(rect);\n path.applyTransform(m);\n}\n/**\n * Sub pixel optimize line for canvas\n */\n\nexport function subPixelOptimizeLine(param) {\n subPixelOptimizeUtil.subPixelOptimizeLine(param.shape, param.shape, param.style);\n return param;\n}\n/**\n * Sub pixel optimize rect for canvas\n */\n\nexport function subPixelOptimizeRect(param) {\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\n return param;\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param position Coordinate, such as x, y\n * @param lineWidth Should be nonnegative integer.\n * @param positiveOrNegative Default false (negative).\n * @return Optimized position.\n */\n\nexport var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\n var isFrom = false;\n var removeOpt;\n\n if (typeof dataIndex === 'function') {\n during = cb;\n cb = dataIndex;\n dataIndex = null;\n } else if (isObject(dataIndex)) {\n cb = dataIndex.cb;\n during = dataIndex.during;\n isFrom = dataIndex.isFrom;\n removeOpt = dataIndex.removeOpt;\n dataIndex = dataIndex.dataIndex;\n }\n\n var isUpdate = animationType === 'update';\n var isRemove = animationType === 'remove';\n var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option.\n // If animation is enabled. Will use this animation config in payload.\n // If animation is disabled. Just ignore it.\n\n if (animatableModel && animatableModel.ecModel) {\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\n animationPayload = updatePayload && updatePayload.animation;\n }\n\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n\n if (!isRemove) {\n // Must stop the remove animation.\n el.stopAnimation('remove');\n }\n\n if (animationEnabled) {\n var duration = void 0;\n var animationEasing = void 0;\n var animationDelay = void 0;\n\n if (animationPayload) {\n duration = animationPayload.duration || 0;\n animationEasing = animationPayload.easing || 'cubicOut';\n animationDelay = animationPayload.delay || 0;\n } else if (isRemove) {\n removeOpt = removeOpt || {};\n duration = retrieve2(removeOpt.duration, 200);\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\n animationDelay = 0;\n } else {\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\n }\n\n if (typeof animationDelay === 'function') {\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n }\n\n if (typeof duration === 'function') {\n duration = duration(dataIndex);\n }\n\n duration > 0 ? isFrom ? el.animateFrom(props, {\n duration: duration,\n delay: animationDelay || 0,\n easing: animationEasing,\n done: cb,\n force: !!cb || !!during,\n scope: animationType,\n during: during\n }) : el.animateTo(props, {\n duration: duration,\n delay: animationDelay || 0,\n easing: animationEasing,\n done: cb,\n force: !!cb || !!during,\n setToFinal: true,\n scope: animationType,\n during: during\n }) : ( // FIXME:\n // If `duration` is 0, only the animation on props\n // can be stoped, other animation should be continued?\n // But at present using duration 0 in `animateTo`, `animateFrom`\n // might cause unexpected behavior.\n el.stopAnimation(), // If `isFrom`, the props is the \"from\" props.\n !isFrom && el.attr(props), cb && cb());\n } else {\n el.stopAnimation();\n !isFrom && el.attr(props); // Call during once.\n\n during && during(1);\n cb && cb();\n }\n}\n/**\n * Update graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @example\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\n * // Or\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, function () { console.log('Animation done!'); });\n */\n\n\nfunction updateProps(el, props, // TODO: TYPE AnimatableModel\nanimatableModel, dataIndex, cb, during) {\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\n}\n\nexport { updateProps };\n/**\n * Init graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n */\n\nexport function initProps(el, props, animatableModel, dataIndex, cb, during) {\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\n}\n/**\n * Remove graphic element\n */\n\nexport function removeElement(el, props, animatableModel, dataIndex, cb, during) {\n // Don't do remove animation twice.\n if (isElementRemoved(el)) {\n return;\n }\n\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\n}\n\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\n el.removeTextContent();\n el.removeTextGuideLine();\n removeElement(el, {\n style: {\n opacity: 0\n }\n }, animatableModel, dataIndex, done);\n}\n\nexport function removeElementWithFadeOut(el, animatableModel, dataIndex) {\n function doRemove() {\n el.parent && el.parent.remove(el);\n } // Hide label and labelLine first\n // TODO Also use fade out animation?\n\n\n if (!el.isGroup) {\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\n } else {\n el.traverse(function (disp) {\n if (!disp.isGroup) {\n // Can invoke doRemove multiple times.\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\n }\n });\n }\n}\n/**\n * If element is removed.\n * It can determine if element is having remove animation.\n */\n\nexport function isElementRemoved(el) {\n if (!el.__zr) {\n return true;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.scope === 'remove') {\n return true;\n }\n }\n\n return false;\n}\n/**\n * Get transform matrix of target (param target),\n * in coordinate of its ancestor (param ancestor)\n *\n * @param target\n * @param [ancestor]\n */\n\nexport function getTransform(target, ancestor) {\n var mat = matrix.identity([]);\n\n while (target && target !== ancestor) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n return mat;\n}\n/**\n * Apply transform to an vertex.\n * @param target [x, y]\n * @param transform Can be:\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\n * @param invert Whether use invert matrix.\n * @return [x, y]\n */\n\nexport function applyTransform(target, transform, invert) {\n if (transform && !isArrayLike(transform)) {\n transform = Transformable.getLocalTransform(transform);\n }\n\n if (invert) {\n transform = matrix.invert([], transform);\n }\n\n return vector.applyTransform([], target, transform);\n}\n/**\n * @param direction 'left' 'right' 'top' 'bottom'\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\n * @param invert Whether use invert matrix.\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\n */\n\nexport function transformDirection(direction, transform, invert) {\n // Pick a base, ensure that transform result will not be (0, 0).\n var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]);\n var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]);\n var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0];\n vertex = applyTransform(vertex, transform, invert);\n return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';\n}\n\nfunction isNotGroup(el) {\n return !el.isGroup;\n}\n\nfunction isPath(el) {\n return el.shape != null;\n}\n/**\n * Apply group transition animation from g1 to g2.\n * If no animatableModel, no animation.\n */\n\n\nexport function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n\n if (isPath(el)) {\n obj.shape = extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\n }\n }\n });\n}\nexport function clipPointsByRect(points, rect) {\n // FIXME: this way migth be incorrect when grpahic clipped by a corner.\n // and when element have border.\n return map(points, function (point) {\n var x = point[0];\n x = mathMax(x, rect.x);\n x = mathMin(x, rect.x + rect.width);\n var y = point[1];\n y = mathMax(y, rect.y);\n y = mathMin(y, rect.y + rect.height);\n return [x, y];\n });\n}\n/**\n * Return a new clipped rect. If rect size are negative, return undefined.\n */\n\nexport function clipRectByRect(targetRect, rect) {\n var x = mathMax(targetRect.x, rect.x);\n var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n var y = mathMax(targetRect.y, rect.y);\n var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border,\n // should be painted. So return undefined.\n\n if (x2 >= x && y2 >= y) {\n return {\n x: x,\n y: y,\n width: x2 - x,\n height: y2 - y\n };\n }\n}\nexport function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path.\nopt, rect) {\n var innerOpts = extend({\n rectHover: true\n }, opt);\n var style = innerOpts.style = {\n strokeNoScale: true\n };\n rect = rect || {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n };\n\n if (iconStr) {\n return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');\n }\n}\n/**\n * Return `true` if the given line (line `a`) and the given polygon\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\n\nexport function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n var p = points[i];\n\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n return true;\n }\n\n p2 = p;\n }\n}\n/**\n * Return `true` if the given two lines (line `a` and line `b`)\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\n\nexport function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n}\n/**\n * Cross product of 2-dimension vector.\n */\n\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction nearZero(val) {\n return val <= 1e-6 && val >= -1e-6;\n}\n\nexport function setTooltipConfig(opt) {\n var itemTooltipOption = opt.itemTooltipOption;\n var componentModel = opt.componentModel;\n var itemName = opt.itemName;\n var itemTooltipOptionObj = isString(itemTooltipOption) ? {\n formatter: itemTooltipOption\n } : itemTooltipOption;\n var mainType = componentModel.mainType;\n var componentIndex = componentModel.componentIndex;\n var formatterParams = {\n componentType: mainType,\n name: itemName,\n $vars: ['name']\n };\n formatterParams[mainType + 'Index'] = componentIndex;\n var formatterParamsExtra = opt.formatterParamsExtra;\n\n if (formatterParamsExtra) {\n each(keys(formatterParamsExtra), function (key) {\n if (!hasOwn(formatterParams, key)) {\n formatterParams[key] = formatterParamsExtra[key];\n formatterParams.$vars.push(key);\n }\n });\n }\n\n var ecData = getECData(opt.el);\n ecData.componentMainType = mainType;\n ecData.componentIndex = componentIndex;\n ecData.tooltipConfig = {\n name: itemName,\n option: defaults({\n content: itemName,\n formatterParams: formatterParams\n }, itemTooltipOptionObj)\n };\n} // Register built-in shapes. These shapes might be overwirtten\n// by users, although we do not recommend that.\n\nregisterShape('circle', Circle);\nregisterShape('ellipse', Ellipse);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexport { Group, ZRImage as Image, ZRText as Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect, OrientedBoundingRect, Point, Path };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ZRText from 'zrender/lib/graphic/Text';\nimport { isFunction, retrieve2, extend, keys, trim } from 'zrender/lib/core/util';\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states';\nimport { deprecateReplaceLog } from '../util/log';\nimport { makeInner, interpolateRawValues } from '../util/model';\nimport { initProps, updateProps } from '../util/graphic';\nimport { getECData } from '../util/innerStore';\nvar EMPTY_OBJ = {};\nexport function setLabelText(label, labelTexts) {\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var text = labelTexts[stateName];\n var state = label.ensureState(stateName);\n state.style = state.style || {};\n state.style.text = text;\n }\n\n var oldStates = label.currentStates.slice();\n label.clearStates(true);\n label.setStyle({\n text: labelTexts.normal\n });\n label.useStates(oldStates, true);\n}\n\nfunction getLabelText(opt, stateModels, interpolatedValue) {\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex;\n var normalModel = stateModels.normal;\n var baseText;\n\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? {\n interpolatedValue: interpolatedValue\n } : null);\n }\n\n if (baseText == null) {\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;\n }\n\n var statesText = {\n normal: baseText\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = stateModels[stateName];\n statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText);\n }\n\n return statesText;\n}\n\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified // TODO specified position?\n) {\n opt = opt || EMPTY_OBJ;\n var isSetOnText = targetEl instanceof ZRText;\n var needsCreateText = false;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\n\n if (stateModel && stateModel.getShallow('show')) {\n needsCreateText = true;\n break;\n }\n }\n\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\n\n if (needsCreateText) {\n if (!isSetOnText) {\n // Reuse the previous\n if (!textContent) {\n textContent = new ZRText();\n targetEl.setTextContent(textContent);\n } // Use same state proxy\n\n\n if (targetEl.stateProxy) {\n textContent.stateProxy = targetEl.stateProxy;\n }\n }\n\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\n var normalModel = labelStatesModels.normal;\n var showNormal = !!normalModel.getShallow('show');\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\n normalStyle.text = labelStatesTexts.normal;\n\n if (!isSetOnText) {\n // Always create new\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\n }\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = labelStatesModels[stateName];\n\n if (stateModel) {\n var stateObj = textContent.ensureState(stateName);\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\n\n if (stateShow !== showNormal) {\n stateObj.ignore = !stateShow;\n }\n\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\n stateObj.style.text = labelStatesTexts[stateName];\n\n if (!isSetOnText) {\n var targetElEmphasisState = targetEl.ensureState(stateName);\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\n }\n }\n } // PENDING: if there is many requirements that emphasis position\n // need to be different from normal position, we might consider\n // auto slient is those cases.\n\n\n textContent.silent = !!normalModel.getShallow('silent'); // Keep x and y\n\n if (textContent.style.x != null) {\n normalStyle.x = textContent.style.x;\n }\n\n if (textContent.style.y != null) {\n normalStyle.y = textContent.style.y;\n }\n\n textContent.ignore = !showNormal; // Always create new style.\n\n textContent.useStyle(normalStyle);\n textContent.dirty();\n\n if (opt.enableTextSetter) {\n labelInner(textContent).setLabelText = function (interpolatedValue) {\n var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\n setLabelText(textContent, labelStatesTexts);\n };\n }\n } else if (textContent) {\n // Not display rich text.\n textContent.ignore = true;\n }\n\n targetEl.dirty();\n}\n\nexport { setLabelStyle };\nexport function getLabelStatesModels(itemModel, labelName) {\n labelName = labelName || 'label';\n var statesModels = {\n normal: itemModel.getModel(labelName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\n }\n\n return statesModels;\n}\n/**\n * Set basic textStyle properties.\n */\n\nexport function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n var textStyle = {};\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}\nexport function createTextConfig(textStyleModel, opt, isNotNormal) {\n opt = opt || {};\n var textConfig = {};\n var labelPosition;\n var labelRotate = textStyleModel.getShallow('rotate');\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\n var labelOffset = textStyleModel.getShallow('offset');\n labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\n\n if (labelPosition != null) {\n textConfig.position = labelPosition;\n }\n\n if (labelOffset != null) {\n textConfig.offset = labelOffset;\n }\n\n if (labelRotate != null) {\n labelRotate *= Math.PI / 180;\n textConfig.rotation = labelRotate;\n }\n\n if (labelDistance != null) {\n textConfig.distance = labelDistance;\n } // fill and auto is determined by the color of path fill if it's not specified by developers.\n\n\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto';\n return textConfig;\n}\n/**\n * The uniform entry of set text style, that is, retrieve style definitions\n * from `model` and set to `textStyle` object.\n *\n * Never in merge mode, but in overwrite mode, that is, all of the text style\n * properties will be set. (Consider the states of normal and emphasis and\n * default value can be adopted, merge would make the logic too complicated\n * to manage.)\n */\n\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\n var ecModel = textStyleModel.ecModel;\n var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case:\n // {\n // data: [{\n // value: 12,\n // label: {\n // rich: {\n // // no 'a' here but using parent 'a'.\n // }\n // }\n // }],\n // rich: {\n // a: { ... }\n // }\n // }\n\n var richItemNames = getRichItemNames(textStyleModel);\n var richResult;\n\n if (richItemNames) {\n richResult = {};\n\n for (var name_1 in richItemNames) {\n if (richItemNames.hasOwnProperty(name_1)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n }\n }\n }\n\n if (richResult) {\n textStyle.rich = richResult;\n }\n\n var overflow = textStyleModel.get('overflow');\n\n if (overflow) {\n textStyle.overflow = overflow;\n }\n\n var margin = textStyleModel.get('minMargin');\n\n if (margin != null) {\n textStyle.margin = margin;\n }\n\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\n} // Consider case:\n// {\n// data: [{\n// value: 12,\n// label: {\n// rich: {\n// // no 'a' here but using parent 'a'.\n// }\n// }\n// }],\n// rich: {\n// a: { ... }\n// }\n// }\n// TODO TextStyleModel\n\n\nfunction getRichItemNames(textStyleModel) {\n // Use object to remove duplicated names.\n var richItemNameMap;\n\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\n\n if (rich) {\n richItemNameMap = richItemNameMap || {};\n var richKeys = keys(rich);\n\n for (var i = 0; i < richKeys.length; i++) {\n var richKey = richKeys[i];\n richItemNameMap[richKey] = 1;\n }\n }\n\n textStyleModel = textStyleModel.parentModel;\n }\n\n return richItemNameMap;\n}\n\nvar TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'];\nvar TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'];\nvar TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\n\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\n var inheritColor = opt && opt.inheritColor;\n var fillColor = textStyleModel.getShallow('color');\n var strokeColor = textStyleModel.getShallow('textBorderColor');\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\n\n if (fillColor === 'inherit' || fillColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (fillColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n fillColor = inheritColor;\n } else {\n fillColor = null;\n }\n }\n\n if (strokeColor === 'inherit' || strokeColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (strokeColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n strokeColor = inheritColor;\n } else {\n strokeColor = null;\n }\n }\n\n if (!isAttached) {\n // Only use default global textStyle.color if text is individual.\n // Otherwise it will use the strategy of attached text color because text may be on a path.\n fillColor = fillColor || globalTextStyle.color;\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\n }\n\n if (fillColor != null) {\n textStyle.fill = fillColor;\n }\n\n if (strokeColor != null) {\n textStyle.stroke = strokeColor;\n }\n\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n\n if (textBorderWidth != null) {\n textStyle.lineWidth = textBorderWidth;\n }\n\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\n\n if (textBorderType != null) {\n textStyle.lineDash = textBorderType;\n }\n\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\n\n if (textBorderDashOffset != null) {\n textStyle.lineDashOffset = textBorderDashOffset;\n }\n\n if (!isNotNormal && opacity == null && !inRich) {\n opacity = opt && opt.defaultOpacity;\n }\n\n if (opacity != null) {\n textStyle.opacity = opacity;\n } // TODO\n\n\n if (!isNotNormal && !isAttached) {\n // Set default finally.\n if (textStyle.fill == null && opt.inheritColor) {\n textStyle.fill = opt.inheritColor;\n }\n } // Do not use `getFont` here, because merge should be supported, where\n // part of these properties may be changed in emphasis style, and the\n // others should remain their original value got from normal style.\n\n\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\n var key = TEXT_PROPS_WITH_GLOBAL[i];\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\n var key = TEXT_PROPS_SELF[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n if (textStyle.verticalAlign == null) {\n var baseline = textStyleModel.getShallow('baseline');\n\n if (baseline != null) {\n textStyle.verticalAlign = baseline;\n }\n }\n\n if (!isBlock || !opt.disableBox) {\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\n var key = TEXT_PROPS_BOX[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n var borderType = textStyleModel.getShallow('borderType');\n\n if (borderType != null) {\n textStyle.borderDash = borderType;\n }\n\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.backgroundColor === 'auto') {\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\n }\n }\n\n textStyle.backgroundColor = inheritColor;\n }\n\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.borderColor === 'auto') {\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\n }\n }\n\n textStyle.borderColor = inheritColor;\n }\n }\n}\n\nexport function getFont(opt, ecModel) {\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n return trim([// FIXME in node-canvas fontWeight is before fontStyle\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' '));\n}\nexport var labelInner = makeInner();\nexport function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\n if (!label) {\n return;\n }\n\n var obj = labelInner(label);\n obj.prevValue = obj.value;\n obj.value = value;\n var normalLabelModel = labelStatesModels.normal;\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\n\n if (obj.valueAnimation) {\n obj.precision = normalLabelModel.get('precision');\n obj.defaultInterpolatedText = getDefaultText;\n obj.statesModels = labelStatesModels;\n }\n}\nexport function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {\n var labelInnerStore = labelInner(textEl);\n\n if (!labelInnerStore.valueAnimation) {\n return;\n }\n\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; // Consider the case that being animating, do not use the `obj.value`,\n // Otherwise it will jump to the `obj.value` when this new animation started.\n\n var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\n var targetValue = labelInnerStore.value;\n\n function during(percent) {\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);\n labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\n var labelText = getLabelText({\n labelDataIndex: dataIndex,\n labelFetcher: labelFetcher,\n defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ''\n }, labelInnerStore.statesModels, interpolated);\n setLabelText(textEl, labelText);\n }\n\n (currValue == null ? initProps : updateProps)(textEl, {}, animatableModel, dataIndex, null, during);\n}\nexport function enableLayoutLayoutFeatures(el, dataIndex, dataType) {\n getECData(el).dataIndex = dataIndex;\n getECData(el).dataType = dataType;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getFont } from '../../label/labelStyle';\nimport ZRText from 'zrender/lib/graphic/Text';\nvar PATH_COLOR = ['textStyle', 'color']; // TODO Performance improvement?\n\nvar tmpRichText = new ZRText();\n\nvar TextStyleMixin =\n/** @class */\nfunction () {\n function TextStyleMixin() {}\n /**\n * Get color property or get color from option.textStyle.color\n */\n // TODO Callback\n\n\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\n var ecModel = this.ecModel;\n return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n };\n /**\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\n * @return {string}\n */\n\n\n TextStyleMixin.prototype.getFont = function () {\n return getFont({\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily')\n }, this.ecModel);\n };\n\n TextStyleMixin.prototype.getTextRect = function (text) {\n tmpRichText.useStyle({\n text: text,\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily'),\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\n padding: this.getShallow('padding'),\n lineHeight: this.getShallow('lineHeight'),\n rich: this.getShallow('rich')\n });\n tmpRichText.update();\n return tmpRichText.getBoundingRect();\n };\n\n return TextStyleMixin;\n}();\n\n;\nexport default TextStyleMixin;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper';\nexport var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\n\nvar LineStyleMixin =\n/** @class */\nfunction () {\n function LineStyleMixin() {}\n\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\n return getLineStyle(this, excludes);\n };\n\n return LineStyleMixin;\n}();\n\n;\nexport { LineStyleMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper';\nexport var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\n\nvar ItemStyleMixin =\n/** @class */\nfunction () {\n function ItemStyleMixin() {}\n\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\n return getItemStyle(this, excludes, includes);\n };\n\n return ItemStyleMixin;\n}();\n\nexport { ItemStyleMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport env from 'zrender/lib/core/env';\nimport { enableClassExtend, enableClassCheck } from '../util/clazz';\nimport { AreaStyleMixin } from './mixin/areaStyle';\nimport TextStyleMixin from './mixin/textStyle';\nimport { LineStyleMixin } from './mixin/lineStyle';\nimport { ItemStyleMixin } from './mixin/itemStyle';\nimport { mixin, clone, merge } from 'zrender/lib/core/util';\n\nvar Model =\n/** @class */\nfunction () {\n function Model(option, parentModel, ecModel) {\n this.parentModel = parentModel;\n this.ecModel = ecModel;\n this.option = option; // Simple optimization\n // if (this.init) {\n // if (arguments.length <= 4) {\n // this.init(option, parentModel, ecModel, extraOpt);\n // }\n // else {\n // this.init.apply(this, arguments);\n // }\n // }\n }\n\n Model.prototype.init = function (option, parentModel, ecModel) {\n var rest = [];\n\n for (var _i = 3; _i < arguments.length; _i++) {\n rest[_i - 3] = arguments[_i];\n }\n };\n /**\n * Merge the input option to me.\n */\n\n\n Model.prototype.mergeOption = function (option, ecModel) {\n merge(this.option, option, true);\n }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `ModelOption`\n // TODO: TYPE strict key check?\n // get(path: string | string[], ignoreParent?: boolean): ModelOption;\n\n\n Model.prototype.get = function (path, ignoreParent) {\n if (path == null) {\n return this.option;\n }\n\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\n };\n\n Model.prototype.getShallow = function (key, ignoreParent) {\n var option = this.option;\n var val = option == null ? option : option[key];\n\n if (val == null && !ignoreParent) {\n var parentModel = this.parentModel;\n\n if (parentModel) {\n // FIXME:TS do not know how to make it works\n val = parentModel.getShallow(key);\n }\n }\n\n return val;\n }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `Model<ModelOption>`\n // getModel(path: string | string[], parentModel?: Model): Model;\n // TODO 'xxx.yyy.zzz' is deprecated\n\n\n Model.prototype.getModel = function (path, parentModel) {\n var hasPath = path != null;\n var pathFinal = hasPath ? this.parsePath(path) : null;\n var obj = hasPath ? this._doGet(pathFinal) : this.option;\n parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));\n return new Model(obj, parentModel, this.ecModel);\n };\n /**\n * Squash option stack into one.\n * parentModel will be removed after squashed.\n *\n * NOTE: resolveParentPath will not be applied here for simplicity. DON'T use this function\n * if resolveParentPath is modified.\n *\n * @param deepMerge If do deep merge. Default to be false.\n */\n // squash(\n // deepMerge?: boolean,\n // handleCallback?: (func: () => object) => object\n // ) {\n // const optionStack = [];\n // let model: Model = this;\n // while (model) {\n // if (model.option) {\n // optionStack.push(model.option);\n // }\n // model = model.parentModel;\n // }\n // const newOption = {} as Opt;\n // let option;\n // while (option = optionStack.pop()) { // Top down merge\n // if (isFunction(option) && handleCallback) {\n // option = handleCallback(option);\n // }\n // if (deepMerge) {\n // merge(newOption, option);\n // }\n // else {\n // extend(newOption, option);\n // }\n // }\n // // Remove parentModel\n // this.option = newOption;\n // this.parentModel = null;\n // }\n\n /**\n * If model has option\n */\n\n\n Model.prototype.isEmpty = function () {\n return this.option == null;\n };\n\n Model.prototype.restoreData = function () {}; // Pending\n\n\n Model.prototype.clone = function () {\n var Ctor = this.constructor;\n return new Ctor(clone(this.option));\n }; // setReadOnly(properties): void {\n // clazzUtil.setReadOnly(this, properties);\n // }\n // If path is null/undefined, return null/undefined.\n\n\n Model.prototype.parsePath = function (path) {\n if (typeof path === 'string') {\n return path.split('.');\n }\n\n return path;\n }; // Resolve path for parent. Perhaps useful when parent use a different property.\n // Default to be a identity resolver.\n // Can be modified to a different resolver.\n\n\n Model.prototype.resolveParentPath = function (path) {\n return path;\n }; // FIXME:TS check whether put this method here\n\n\n Model.prototype.isAnimationEnabled = function () {\n if (!env.node && this.option) {\n if (this.option.animation != null) {\n return !!this.option.animation;\n } else if (this.parentModel) {\n return this.parentModel.isAnimationEnabled();\n }\n }\n };\n\n Model.prototype._doGet = function (pathArr, parentModel) {\n var obj = this.option;\n\n if (!pathArr) {\n return obj;\n }\n\n for (var i = 0; i < pathArr.length; i++) {\n // Ignore empty\n if (!pathArr[i]) {\n continue;\n } // obj could be number/string/... (like 0)\n\n\n obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n\n if (obj == null) {\n break;\n }\n }\n\n if (obj == null && parentModel) {\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\n }\n\n return obj;\n };\n\n return Model;\n}();\n\n; // Enable Model.extend.\n\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, LineStyleMixin);\nmixin(Model, ItemStyleMixin);\nmixin(Model, AreaStyleMixin);\nmixin(Model, TextStyleMixin);\nexport default Model;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parseClassType } from './clazz';\nimport { makePrintable } from './log'; // A random offset\n\nvar base = Math.round(Math.random() * 10);\n/**\n * @public\n * @param {string} type\n * @return {string}\n */\n\nexport function getUID(type) {\n // Considering the case of crossing js context,\n // use Math.random to make id as unique as possible.\n return [type || '', base++].join('_');\n}\n/**\n * Implements `SubTypeDefaulterManager` for `target`.\n */\n\nexport function enableSubTypeDefaulter(target) {\n var subTypeDefaulters = {};\n\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\n var componentTypeInfo = parseClassType(componentType);\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\n };\n\n target.determineSubType = function (componentType, option) {\n var type = option.type;\n\n if (!type) {\n var componentTypeMain = parseClassType(componentType).main;\n\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n type = subTypeDefaulters[componentTypeMain](option);\n }\n }\n\n return type;\n };\n}\n/**\n * Implements `TopologicalTravelable<any>` for `entity`.\n *\n * Topological travel on Activity Network (Activity On Vertices).\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\n * If there is circular dependencey, Error will be thrown.\n */\n\nexport function enableTopologicalTravel(entity, dependencyGetter) {\n /**\n * @param targetNameList Target Component type list.\n * Can be ['aa', 'bb', 'aa.xx']\n * @param fullNameList By which we can build dependency graph.\n * @param callback Params: componentType, dependencies.\n * @param context Scope of callback.\n */\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n if (!targetNameList.length) {\n return;\n }\n\n var result = makeDepndencyGraph(fullNameList);\n var graph = result.graph;\n var noEntryList = result.noEntryList;\n var targetNameSet = {};\n zrUtil.each(targetNameList, function (name) {\n targetNameSet[name] = true;\n });\n\n while (noEntryList.length) {\n var currComponentType = noEntryList.pop();\n var currVertex = graph[currComponentType];\n var isInTargetNameSet = !!targetNameSet[currComponentType];\n\n if (isInTargetNameSet) {\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\n delete targetNameSet[currComponentType];\n }\n\n zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n }\n\n zrUtil.each(targetNameSet, function () {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\n }\n\n throw new Error(errMsg);\n });\n\n function removeEdge(succComponentType) {\n graph[succComponentType].entryCount--;\n\n if (graph[succComponentType].entryCount === 0) {\n noEntryList.push(succComponentType);\n }\n } // Consider this case: legend depends on series, and we call\n // chart.setOption({series: [...]}), where only series is in option.\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n // not be called, but only sereis.mergeOption is called. Thus legend\n // have no chance to update its local record about series (like which\n // name of series is available in legend).\n\n\n function removeEdgeAndAdd(succComponentType) {\n targetNameSet[succComponentType] = true;\n removeEdge(succComponentType);\n }\n };\n\n function makeDepndencyGraph(fullNameList) {\n var graph = {};\n var noEntryList = [];\n zrUtil.each(fullNameList, function (name) {\n var thisItem = createDependencyGraphItem(graph, name);\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n thisItem.entryCount = availableDeps.length;\n\n if (thisItem.entryCount === 0) {\n noEntryList.push(name);\n }\n\n zrUtil.each(availableDeps, function (dependentName) {\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n thisItem.predecessor.push(dependentName);\n }\n\n var thatItem = createDependencyGraphItem(graph, dependentName);\n\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n thatItem.successor.push(name);\n }\n });\n });\n return {\n graph: graph,\n noEntryList: noEntryList\n };\n }\n\n function createDependencyGraphItem(graph, name) {\n if (!graph[name]) {\n graph[name] = {\n predecessor: [],\n successor: []\n };\n }\n\n return graph[name];\n }\n\n function getAvailableDependencies(originalDeps, fullNameList) {\n var availableDeps = [];\n zrUtil.each(originalDeps, function (dep) {\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n });\n return availableDeps;\n }\n}\nexport function inheritDefaultOption(superOption, subOption) {\n // See also `model/Component.ts#getDefaultOption`\n return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Language: English.\n */\nexport default {\n time: {\n month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n },\n legend: {\n selector: {\n all: 'All',\n inverse: 'Inv'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: 'Box Select',\n polygon: 'Lasso Select',\n lineX: 'Horizontally Select',\n lineY: 'Vertically Select',\n keep: 'Keep Selections',\n clear: 'Clear Selections'\n }\n },\n dataView: {\n title: 'Data View',\n lang: ['Data View', 'Close', 'Refresh']\n },\n dataZoom: {\n title: {\n zoom: 'Zoom',\n back: 'Zoom Reset'\n }\n },\n magicType: {\n title: {\n line: 'Switch to Line Chart',\n bar: 'Switch to Bar Chart',\n stack: 'Stack',\n tiled: 'Tile'\n }\n },\n restore: {\n title: 'Restore'\n },\n saveAsImage: {\n title: 'Save as Image',\n lang: ['Right Click to Save Image']\n }\n },\n series: {\n typeNames: {\n pie: 'Pie chart',\n bar: 'Bar chart',\n line: 'Line chart',\n scatter: 'Scatter plot',\n effectScatter: 'Ripple scatter plot',\n radar: 'Radar chart',\n tree: 'Tree',\n treemap: 'Treemap',\n boxplot: 'Boxplot',\n candlestick: 'Candlestick',\n k: 'K line chart',\n heatmap: 'Heat map',\n map: 'Map',\n parallel: 'Parallel coordinate map',\n lines: 'Line graph',\n graph: 'Relationship graph',\n sankey: 'Sankey diagram',\n funnel: 'Funnel chart',\n gauge: 'Guage',\n pictorialBar: 'Pictorial bar',\n themeRiver: 'Theme River Map',\n sunburst: 'Sunburst'\n }\n },\n aria: {\n general: {\n withTitle: 'This is a chart about \"{title}\"',\n withoutTitle: 'This is a chart'\n },\n series: {\n single: {\n prefix: '',\n withName: ' with type {seriesType} named {seriesName}.',\n withoutName: ' with type {seriesType}.'\n },\n multiple: {\n prefix: '. It consists of {seriesCount} series count.',\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\n withoutName: ' The {seriesId} series is a {seriesType}.',\n separator: {\n middle: '',\n end: ''\n }\n }\n },\n data: {\n allData: 'The data is as follows: ',\n partialData: 'The first {displayCnt} items are: ',\n withName: 'the data for {name} is {value}',\n withoutName: '{value}',\n separator: {\n middle: ', ',\n end: '. '\n }\n }\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport default {\n time: {\n month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],\n dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六']\n },\n legend: {\n selector: {\n all: '全选',\n inverse: '反选'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: '矩形选择',\n polygon: '圈选',\n lineX: '横向选择',\n lineY: '纵向选择',\n keep: '保持选择',\n clear: '清除选择'\n }\n },\n dataView: {\n title: '数据视图',\n lang: ['数据视图', '关闭', '刷新']\n },\n dataZoom: {\n title: {\n zoom: '区域缩放',\n back: '区域缩放还原'\n }\n },\n magicType: {\n title: {\n line: '切换为折线图',\n bar: '切换为柱状图',\n stack: '切换为堆叠',\n tiled: '切换为平铺'\n }\n },\n restore: {\n title: '还原'\n },\n saveAsImage: {\n title: '保存为图片',\n lang: ['右键另存为图片']\n }\n },\n series: {\n typeNames: {\n pie: '饼图',\n bar: '柱状图',\n line: '折线图',\n scatter: '散点图',\n effectScatter: '涟漪散点图',\n radar: '雷达图',\n tree: '树图',\n treemap: '矩形树图',\n boxplot: '箱型图',\n candlestick: 'K线图',\n k: 'K线图',\n heatmap: '热力图',\n map: '地图',\n parallel: '平行坐标图',\n lines: '线图',\n graph: '关系图',\n sankey: '桑基图',\n funnel: '漏斗图',\n gauge: '仪表盘图',\n pictorialBar: '象形柱图',\n themeRiver: '主题河流图',\n sunburst: '旭日图'\n }\n },\n aria: {\n general: {\n withTitle: '这是一个关于“{title}”的图表。',\n withoutTitle: '这是一个图表,'\n },\n series: {\n single: {\n prefix: '',\n withName: '图表类型是{seriesType},表示{seriesName}。',\n withoutName: '图表类型是{seriesType}。'\n },\n multiple: {\n prefix: '它由{seriesCount}个图表系列组成。',\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\n withoutName: '第{seriesId}个系列是一个{seriesType},',\n separator: {\n middle: ';',\n end: '。'\n }\n }\n },\n data: {\n allData: '其数据是——',\n partialData: '其中,前{displayCnt}项是——',\n withName: '{name}的数据是{value}',\n withoutName: '{value}',\n separator: {\n middle: ',',\n end: ''\n }\n }\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../model/Model';\nimport env from 'zrender/lib/core/env'; // default import ZH and EN lang\n\nimport langEN from '../i18n/langEN';\nimport langZH from '../i18n/langZH';\nimport { isString, clone, merge } from 'zrender/lib/core/util';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n var langStr = (\n /* eslint-disable-next-line */\n document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n locale = locale.toUpperCase();\n localeModels[locale] = new Model(localeObj);\n localeStorage[locale] = localeObj;\n} // export function getLocale(locale: string) {\n// return localeStorage[locale];\n// }\n\nexport function createLocaleObject(locale) {\n if (isString(locale)) {\n var localeObj = localeStorage[locale.toUpperCase()] || {};\n\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n return clone(localeObj);\n } else {\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n } else {\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n}\nexport function getLocaleModel(lang) {\n return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n return localeModels[DEFAULT_LOCALE];\n} // Default locale\n\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as numberUtil from './number';\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG } from '../core/locale';\nimport Model from '../model/Model';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = ONE_SECOND * 60;\nexport var ONE_HOUR = ONE_MINUTE * 60;\nexport var ONE_DAY = ONE_HOUR * 24;\nexport var ONE_YEAR = ONE_DAY * 365;\nexport var defaultLeveledFormatter = {\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{hh}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\n};\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\nexport var fullLeveledFormatter = {\n year: '{yyyy}',\n month: '{yyyy}-{MM}',\n day: fullDayFormatter,\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\n millisecond: defaultLeveledFormatter.none\n};\nexport var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'];\nexport function pad(str, len) {\n str += '';\n return '0000'.substr(0, len - str.length) + str;\n}\nexport function getPrimaryTimeUnit(timeUnit) {\n switch (timeUnit) {\n case 'half-year':\n case 'quarter':\n return 'month';\n\n case 'week':\n case 'half-week':\n return 'day';\n\n case 'half-day':\n case 'quarter-day':\n return 'hour';\n\n default:\n // year, minutes, second, milliseconds\n return timeUnit;\n }\n}\nexport function isPrimaryTimeUnit(timeUnit) {\n return timeUnit === getPrimaryTimeUnit(timeUnit);\n}\nexport function getDefaultFormatPrecisionOfInterval(timeUnit) {\n switch (timeUnit) {\n case 'year':\n case 'month':\n return 'day';\n\n case 'millisecond':\n return 'millisecond';\n\n default:\n // Also for day, hour, minute, second\n return 'second';\n }\n}\nexport function format( // Note: The result based on `isUTC` are totally different, which can not be just simply\n// substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\ntime, template, isUTC, lang) {\n var date = numberUtil.parseDate(time);\n var y = date[fullYearGetterName(isUTC)]();\n var M = date[monthGetterName(isUTC)]() + 1;\n var q = Math.floor((M - 1) / 4) + 1;\n var d = date[dateGetterName(isUTC)]();\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\n var H = date[hoursGetterName(isUTC)]();\n var h = (H - 1) % 12 + 1;\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\n var timeModel = localeModel.getModel('time');\n var month = timeModel.get('month');\n var monthAbbr = timeModel.get('monthAbbr');\n var dayOfWeek = timeModel.get('dayOfWeek');\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\n return (template || '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, y % 100 + '').replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + '');\n}\nexport function leveledFormat(tick, idx, formatter, lang, isUTC) {\n var template = null;\n\n if (typeof formatter === 'string') {\n // Single formatter for all units at all levels\n template = formatter;\n } else if (typeof formatter === 'function') {\n // Callback formatter\n template = formatter(tick.value, idx, {\n level: tick.level\n });\n } else {\n var defaults = zrUtil.extend({}, defaultLeveledFormatter);\n\n if (tick.level > 0) {\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\n defaults[primaryTimeUnits[i]] = \"{primary|\" + defaults[primaryTimeUnits[i]] + \"}\";\n }\n }\n\n var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units\n : zrUtil.defaults(formatter, defaults) : defaults;\n var unit = getUnitFromValue(tick.value, isUTC);\n\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n } else if (mergedFormatter.inherit) {\n // Unit formatter is not defined and should inherit from bigger units\n var targetId = timeUnits.indexOf(unit);\n\n for (var i = targetId - 1; i >= 0; --i) {\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n break;\n }\n }\n\n template = template || defaults.none;\n }\n\n if (zrUtil.isArray(template)) {\n var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level;\n levelId = Math.min(levelId, template.length - 1);\n template = template[levelId];\n }\n }\n\n return format(new Date(tick.value), template, isUTC, lang);\n}\nexport function getUnitFromValue(value, isUTC) {\n var date = numberUtil.parseDate(value);\n var M = date[monthGetterName(isUTC)]() + 1;\n var d = date[dateGetterName(isUTC)]();\n var h = date[hoursGetterName(isUTC)]();\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var isSecond = S === 0;\n var isMinute = isSecond && s === 0;\n var isHour = isMinute && m === 0;\n var isDay = isHour && h === 0;\n var isMonth = isDay && d === 1;\n var isYear = isMonth && M === 1;\n\n if (isYear) {\n return 'year';\n } else if (isMonth) {\n return 'month';\n } else if (isDay) {\n return 'day';\n } else if (isHour) {\n return 'hour';\n } else if (isMinute) {\n return 'minute';\n } else if (isSecond) {\n return 'second';\n } else {\n return 'millisecond';\n }\n}\nexport function getUnitValue(value, unit, isUTC) {\n var date = typeof value === 'number' ? numberUtil.parseDate(value) : value;\n unit = unit || getUnitFromValue(value, isUTC);\n\n switch (unit) {\n case 'year':\n return date[fullYearGetterName(isUTC)]();\n\n case 'half-year':\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\n\n case 'quarter':\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\n\n case 'month':\n return date[monthGetterName(isUTC)]();\n\n case 'day':\n return date[dateGetterName(isUTC)]();\n\n case 'half-day':\n return date[hoursGetterName(isUTC)]() / 24;\n\n case 'hour':\n return date[hoursGetterName(isUTC)]();\n\n case 'minute':\n return date[minutesGetterName(isUTC)]();\n\n case 'second':\n return date[secondsGetterName(isUTC)]();\n\n case 'millisecond':\n return date[millisecondsGetterName(isUTC)]();\n }\n}\nexport function fullYearGetterName(isUTC) {\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\n}\nexport function monthGetterName(isUTC) {\n return isUTC ? 'getUTCMonth' : 'getMonth';\n}\nexport function dateGetterName(isUTC) {\n return isUTC ? 'getUTCDate' : 'getDate';\n}\nexport function hoursGetterName(isUTC) {\n return isUTC ? 'getUTCHours' : 'getHours';\n}\nexport function minutesGetterName(isUTC) {\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\n}\nexport function secondsGetterName(isUTC) {\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function millisecondsGetterName(isUTC) {\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function fullYearSetterName(isUTC) {\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\n}\nexport function monthSetterName(isUTC) {\n return isUTC ? 'setUTCMonth' : 'setMonth';\n}\nexport function dateSetterName(isUTC) {\n return isUTC ? 'setUTCDate' : 'setDate';\n}\nexport function hoursSetterName(isUTC) {\n return isUTC ? 'setUTCHours' : 'setHours';\n}\nexport function minutesSetterName(isUTC) {\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\n}\nexport function secondsSetterName(isUTC) {\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}\nexport function millisecondsSetterName(isUTC) {\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parseDate, isNumeric, numericToNumber } from './number';\nimport { format as timeFormat, pad } from './time';\nimport { deprecateReplaceLog } from './log';\n/**\n * Add a comma each three digit.\n */\n\nexport function addCommas(x) {\n if (!isNumeric(x)) {\n return zrUtil.isString(x) ? x : '-';\n }\n\n var parts = (x + '').split('.');\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : '');\n}\nexport function toCamelCase(str, upperCaseFirst) {\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n return group1.toUpperCase();\n });\n\n if (upperCaseFirst && str) {\n str = str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n return str;\n}\nexport var normalizeCssArray = zrUtil.normalizeCssArray;\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\nexport function encodeHTML(source) {\n return source == null ? '' : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n/**\n * Make value user readable for tooltip and label.\n * \"User readable\":\n * Try to not print programmer-specific text like NaN, Infinity, null, undefined.\n * Avoid to display an empty string, which users can not recognize there is\n * a value and it might look like a bug.\n */\n\nexport function makeValueReadable(value, valueType, useUTC) {\n var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss}';\n\n function stringToUserReadable(str) {\n return str && zrUtil.trim(str) ? str : '-';\n }\n\n function isNumberUserReadable(num) {\n return !!(num != null && !isNaN(num) && isFinite(num));\n }\n\n var isTypeTime = valueType === 'time';\n var isValueDate = value instanceof Date;\n\n if (isTypeTime || isValueDate) {\n var date = isTypeTime ? parseDate(value) : value;\n\n if (!isNaN(+date)) {\n return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\n } else if (isValueDate) {\n return '-';\n } // In other cases, continue to try to display the value in the following code.\n\n }\n\n if (valueType === 'ordinal') {\n return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';\n } // By default.\n\n\n var numericResult = numericToNumber(value);\n return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : '-';\n}\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\n\nvar wrapVar = function (varName, seriesIdx) {\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\n * Template formatter\n * @param {Array.<Object>|Object} paramsList\n */\n\n\nexport function formatTpl(tpl, paramsList, encode) {\n if (!zrUtil.isArray(paramsList)) {\n paramsList = [paramsList];\n }\n\n var seriesLen = paramsList.length;\n\n if (!seriesLen) {\n return '';\n }\n\n var $vars = paramsList[0].$vars || [];\n\n for (var i = 0; i < $vars.length; i++) {\n var alias = TPL_VAR_ALIAS[i];\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n }\n\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n for (var k = 0; k < $vars.length; k++) {\n var val = paramsList[seriesIdx][$vars[k]];\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n }\n }\n\n return tpl;\n}\n/**\n * simple Template formatter\n */\n\nexport function formatTplSimple(tpl, param, encode) {\n zrUtil.each(param, function (value, key) {\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n });\n return tpl;\n}\nexport function getTooltipMarker(inOpt, extraCssText) {\n var opt = zrUtil.isString(inOpt) ? {\n color: inOpt,\n extraCssText: extraCssText\n } : inOpt || {};\n var color = opt.color;\n var type = opt.type;\n extraCssText = opt.extraCssText;\n var renderMode = opt.renderMode || 'html';\n\n if (!color) {\n return '';\n }\n\n if (renderMode === 'html') {\n return type === 'subItem' ? '<span style=\"display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;' + 'border-radius:4px;width:4px;height:4px;background-color:' // Only support string\n + encodeHTML(color) + ';' + (extraCssText || '') + '\"></span>' : '<span style=\"display:inline-block;margin-right:4px;' + 'border-radius:10px;width:10px;height:10px;background-color:' + encodeHTML(color) + ';' + (extraCssText || '') + '\"></span>';\n } else {\n // Should better not to auto generate style name by auto-increment number here.\n // Because this util is usually called in tooltip formatter, which is probably\n // called repeatly when mouse move and the auto-increment number increases fast.\n // Users can make their own style name by theirselves, make it unique and readable.\n var markerId = opt.markerId || 'markerX';\n return {\n renderMode: renderMode,\n content: '{' + markerId + '|} ',\n style: type === 'subItem' ? {\n width: 4,\n height: 4,\n borderRadius: 2,\n backgroundColor: color\n } : {\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: color\n }\n };\n }\n}\n/**\n * @deprecated Use `time/format` instead.\n * ISO Date format\n * @param {string} tpl\n * @param {number} value\n * @param {boolean} [isUTC=false] Default in local time.\n * see `module:echarts/scale/Time`\n * and `module:echarts/util/number#parseDate`.\n * @inner\n */\n\nexport function formatTime(tpl, value, isUTC) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\n }\n\n if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n tpl = 'MM-dd\\nyyyy';\n }\n\n var date = parseDate(value);\n var utc = isUTC ? 'UTC' : '';\n var y = date['get' + utc + 'FullYear']();\n var M = date['get' + utc + 'Month']() + 1;\n var d = date['get' + utc + 'Date']();\n var h = date['get' + utc + 'Hours']();\n var m = date['get' + utc + 'Minutes']();\n var s = date['get' + utc + 'Seconds']();\n var S = date['get' + utc + 'Milliseconds']();\n tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', y % 100 + '').replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3));\n return tpl;\n}\n/**\n * Capital first\n * @param {string} str\n * @return {string}\n */\n\nexport function capitalFirst(str) {\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n/**\n * @return Never be null/undefined.\n */\n\nexport function convertToColorString(color, defaultColor) {\n defaultColor = defaultColor || 'transparent';\n return zrUtil.isString(color) ? color : zrUtil.isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor;\n}\nexport { truncateText } from 'zrender/lib/graphic/helper/parseText';\n/**\n * open new tab\n * @param link url\n * @param target blank or self\n */\n\nexport function windowOpen(link, target) {\n /* global window */\n if (target === '_blank' || target === 'blank') {\n var blank = window.open();\n blank.opener = null;\n blank.location.href = link;\n } else {\n window.open(link, target);\n }\n}\nexport { getTextRect } from '../legacy/getTextRect';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Layout helpers for each component positioning\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { parsePercent } from './number';\nimport * as formatUtil from './format';\nvar each = zrUtil.each;\n/**\n * @public\n */\n\nexport var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\n * @public\n */\n\nexport var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\n\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n var x = 0;\n var y = 0;\n\n if (maxWidth == null) {\n maxWidth = Infinity;\n }\n\n if (maxHeight == null) {\n maxHeight = Infinity;\n }\n\n var currentLineMaxSize = 0;\n group.eachChild(function (child, idx) {\n var rect = child.getBoundingRect();\n var nextChild = group.childAt(idx + 1);\n var nextChildRect = nextChild && nextChild.getBoundingRect();\n var nextX;\n var nextY;\n\n if (orient === 'horizontal') {\n var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group\n // FIXME compare before adding gap?\n\n if (nextX > maxWidth || child.newline) {\n x = 0;\n nextX = moveX;\n y += currentLineMaxSize + gap;\n currentLineMaxSize = rect.height;\n } else {\n // FIXME: consider rect.y is not `0`?\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n }\n } else {\n var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group\n\n if (nextY > maxHeight || child.newline) {\n x += currentLineMaxSize + gap;\n y = 0;\n nextY = moveY;\n currentLineMaxSize = rect.width;\n } else {\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n }\n }\n\n if (child.newline) {\n return;\n }\n\n child.x = x;\n child.y = y;\n child.markRedraw();\n orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n });\n}\n/**\n * VBox or HBox layouting\n * @param {string} orient\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\n\nexport var box = boxLayout;\n/**\n * VBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\nexport var vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\n * HBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\n\nexport var hbox = zrUtil.curry(boxLayout, 'horizontal');\n/**\n * If x or x2 is not specified or 'center' 'left' 'right',\n * the width would be as long as possible.\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\n * the height would be as long as possible.\n */\n\nexport function getAvailableSize(positionInfo, containerRect, margin) {\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var x = parsePercent(positionInfo.left, containerWidth);\n var y = parsePercent(positionInfo.top, containerHeight);\n var x2 = parsePercent(positionInfo.right, containerWidth);\n var y2 = parsePercent(positionInfo.bottom, containerHeight);\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\n margin = formatUtil.normalizeCssArray(margin || 0);\n return {\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\n };\n}\n/**\n * Parse position info.\n */\n\nexport function getLayoutRect(positionInfo, containerRect, margin) {\n margin = formatUtil.normalizeCssArray(margin || 0);\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var left = parsePercent(positionInfo.left, containerWidth);\n var top = parsePercent(positionInfo.top, containerHeight);\n var right = parsePercent(positionInfo.right, containerWidth);\n var bottom = parsePercent(positionInfo.bottom, containerHeight);\n var width = parsePercent(positionInfo.width, containerWidth);\n var height = parsePercent(positionInfo.height, containerHeight);\n var verticalMargin = margin[2] + margin[0];\n var horizontalMargin = margin[1] + margin[3];\n var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right\n\n if (isNaN(width)) {\n width = containerWidth - right - horizontalMargin - left;\n }\n\n if (isNaN(height)) {\n height = containerHeight - bottom - verticalMargin - top;\n }\n\n if (aspect != null) {\n // If width and height are not given\n // 1. Graph should not exceeds the container\n // 2. Aspect must be keeped\n // 3. Graph should take the space as more as possible\n // FIXME\n // Margin is not considered, because there is no case that both\n // using margin and aspect so far.\n if (isNaN(width) && isNaN(height)) {\n if (aspect > containerWidth / containerHeight) {\n width = containerWidth * 0.8;\n } else {\n height = containerHeight * 0.8;\n }\n } // Calculate width or height with given aspect\n\n\n if (isNaN(width)) {\n width = aspect * height;\n }\n\n if (isNaN(height)) {\n height = width / aspect;\n }\n } // If left is not specified, calculate left from right and width\n\n\n if (isNaN(left)) {\n left = containerWidth - right - width - horizontalMargin;\n }\n\n if (isNaN(top)) {\n top = containerHeight - bottom - height - verticalMargin;\n } // Align left and top\n\n\n switch (positionInfo.left || positionInfo.right) {\n case 'center':\n left = containerWidth / 2 - width / 2 - margin[3];\n break;\n\n case 'right':\n left = containerWidth - width - horizontalMargin;\n break;\n }\n\n switch (positionInfo.top || positionInfo.bottom) {\n case 'middle':\n case 'center':\n top = containerHeight / 2 - height / 2 - margin[0];\n break;\n\n case 'bottom':\n top = containerHeight - height - verticalMargin;\n break;\n } // If something is wrong and left, top, width, height are calculated as NaN\n\n\n left = left || 0;\n top = top || 0;\n\n if (isNaN(width)) {\n // Width may be NaN if only one value is given except width\n width = containerWidth - horizontalMargin - left - (right || 0);\n }\n\n if (isNaN(height)) {\n // Height may be NaN if only one value is given except height\n height = containerHeight - verticalMargin - top - (bottom || 0);\n }\n\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\n rect.margin = margin;\n return rect;\n}\n/**\n * Position a zr element in viewport\n * Group position is specified by either\n * {left, top}, {right, bottom}\n * If all properties exists, right and bottom will be igonred.\n *\n * Logic:\n * 1. Scale (against origin point in parent coord)\n * 2. Rotate (against origin point in parent coord)\n * 3. Traslate (with el.position by this method)\n * So this method only fixes the last step 'Traslate', which does not affect\n * scaling and rotating.\n *\n * If be called repeatly with the same input el, the same result will be gotten.\n *\n * @param el Should have `getBoundingRect` method.\n * @param positionInfo\n * @param positionInfo.left\n * @param positionInfo.top\n * @param positionInfo.right\n * @param positionInfo.bottom\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\n * @param containerRect\n * @param margin\n * @param opt\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\n * @param opt.boundingMode\n * Specify how to calculate boundingRect when locating.\n * 'all': Position the boundingRect that is transformed and uioned\n * both itself and its descendants.\n * This mode simplies confine the elements in the bounding\n * of their container (e.g., using 'right: 0').\n * 'raw': Position the boundingRect that is not transformed and only itself.\n * This mode is useful when you want a element can overflow its\n * container. (Consider a rotated circle needs to be located in a corner.)\n * In this mode positionInfo.width/height can only be number.\n */\n\nexport function positionElement(el, positionInfo, containerRect, margin, opt) {\n var h = !opt || !opt.hv || opt.hv[0];\n var v = !opt || !opt.hv || opt.hv[1];\n var boundingMode = opt && opt.boundingMode || 'all';\n\n if (!h && !v) {\n return;\n }\n\n var rect;\n\n if (boundingMode === 'raw') {\n rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n } else {\n rect = el.getBoundingRect();\n\n if (el.needLocalTransform()) {\n var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el,\n // which should not be modified.\n\n rect = rect.clone();\n rect.applyTransform(transform);\n }\n } // The real width and height can not be specified but calculated by the given el.\n\n\n var layoutRect = getLayoutRect(zrUtil.defaults({\n width: rect.width,\n height: rect.height\n }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform\n // (see zrender/core/Transformable#getLocalTransform),\n // we can just only modify el.position to get final result.\n\n var dx = h ? layoutRect.x - rect.x : 0;\n var dy = v ? layoutRect.y - rect.y : 0;\n\n if (boundingMode === 'raw') {\n el.x = dx;\n el.y = dy;\n } else {\n el.x += dx;\n el.y += dy;\n }\n\n el.markRedraw();\n}\n/**\n * @param option Contains some of the properties in HV_NAMES.\n * @param hvIdx 0: horizontal; 1: vertical.\n */\n\nexport function sizeCalculable(option, hvIdx) {\n return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\nexport function fetchLayoutMode(ins) {\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\n return zrUtil.isObject(layoutMode) ? layoutMode : layoutMode ? {\n type: layoutMode\n } : null;\n}\n/**\n * Consider Case:\n * When default option has {left: 0, width: 100}, and we set {right: 0}\n * through setOption or media query, using normal zrUtil.merge will cause\n * {right: 0} does not take effect.\n *\n * @example\n * ComponentModel.extend({\n * init: function () {\n * ...\n * let inputPositionParams = layout.getLayoutParams(option);\n * this.mergeOption(inputPositionParams);\n * },\n * mergeOption: function (newOption) {\n * newOption && zrUtil.merge(thisOption, newOption, true);\n * layout.mergeLayoutParam(thisOption, newOption);\n * }\n * });\n *\n * @param targetOption\n * @param newOption\n * @param opt\n */\n\nexport function mergeLayoutParam(targetOption, newOption, opt) {\n var ignoreSize = opt && opt.ignoreSize;\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n var hResult = merge(HV_NAMES[0], 0);\n var vResult = merge(HV_NAMES[1], 1);\n copy(HV_NAMES[0], targetOption, hResult);\n copy(HV_NAMES[1], targetOption, vResult);\n\n function merge(names, hvIdx) {\n var newParams = {};\n var newValueCount = 0;\n var merged = {};\n var mergedValueCount = 0;\n var enoughParamNumber = 2;\n each(names, function (name) {\n merged[name] = targetOption[name];\n });\n each(names, function (name) {\n // Consider case: newOption.width is null, which is\n // set by user for removing width setting.\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n hasValue(newParams, name) && newValueCount++;\n hasValue(merged, name) && mergedValueCount++;\n });\n\n if (ignoreSize[hvIdx]) {\n // Only one of left/right is premitted to exist.\n if (hasValue(newOption, names[1])) {\n merged[names[2]] = null;\n } else if (hasValue(newOption, names[2])) {\n merged[names[1]] = null;\n }\n\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // or targetOption: {right: ...} and newOption: {width: ...},\n // There is no conflict when merged only has params count\n // little than enoughParamNumber.\n\n\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // Than we can make sure user only want those two, and ignore\n // all origin params in targetOption.\n else if (newValueCount >= enoughParamNumber) {\n return newParams;\n } else {\n // Chose another param from targetOption by priority.\n for (var i = 0; i < names.length; i++) {\n var name_1 = names[i];\n\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\n newParams[name_1] = targetOption[name_1];\n break;\n }\n }\n\n return newParams;\n }\n }\n\n function hasProp(obj, name) {\n return obj.hasOwnProperty(name);\n }\n\n function hasValue(obj, name) {\n return obj[name] != null && obj[name] !== 'auto';\n }\n\n function copy(names, target, source) {\n each(names, function (name) {\n target[name] = source[name];\n });\n }\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n */\n\nexport function getLayoutParams(source) {\n return copyLayoutParams({}, source);\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n * @param {Object} source\n * @return {Object} Result contains those props.\n */\n\nexport function copyLayoutParams(target, source) {\n source && target && each(LOCATION_PARAMS, function (name) {\n source.hasOwnProperty(name) && (target[name] = source[name]);\n });\n return target;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Model from './Model';\nimport * as componentUtil from '../util/component';\nimport { enableClassManagement, parseClassType, isExtendedClass, mountExtend } from '../util/clazz';\nimport { makeInner, queryReferringComponents } from '../util/model';\nimport * as layout from '../util/layout';\nvar inner = makeInner();\n\nvar ComponentModel =\n/** @class */\nfunction (_super) {\n __extends(ComponentModel, _super);\n\n function ComponentModel(option, parentModel, ecModel) {\n var _this = _super.call(this, option, parentModel, ecModel) || this;\n\n _this.uid = componentUtil.getUID('ec_cpt_model');\n return _this;\n }\n\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = layout.fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n zrUtil.merge(option, themeModel.get(this.mainType));\n zrUtil.merge(option, this.getDefaultOption());\n\n if (layoutMode) {\n layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\n zrUtil.merge(this.option, option, true);\n var layoutMode = layout.fetchLayoutMode(this);\n\n if (layoutMode) {\n layout.mergeLayoutParam(this.option, option, layoutMode);\n }\n };\n /**\n * Called immediately after `init` or `mergeOption` of this instance called.\n */\n\n\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {};\n /**\n * [How to declare defaultOption]:\n *\n * (A) If using class declaration in typescript (since echarts 5):\n * ```ts\n * import {ComponentOption} from '../model/option';\n * export interface XxxOption extends ComponentOption {\n * aaa: number\n * }\n * export class XxxModel extends Component {\n * static type = 'xxx';\n * static defaultOption: XxxOption = {\n * aaa: 123\n * }\n * }\n * Component.registerClass(XxxModel);\n * ```\n * ```ts\n * import {inheritDefaultOption} from '../util/component';\n * import {XxxModel, XxxOption} from './XxxModel';\n * export interface XxxSubOption extends XxxOption {\n * bbb: number\n * }\n * class XxxSubModel extends XxxModel {\n * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\n * bbb: 456\n * })\n * fn() {\n * let opt = this.getDefaultOption();\n * // opt is {aaa: 123, bbb: 456}\n * }\n * }\n * ```\n *\n * (B) If using class extend (previous approach in echarts 3 & 4):\n * ```js\n * let XxxComponent = Component.extend({\n * defaultOption: {\n * xx: 123\n * }\n * })\n * ```\n * ```js\n * let XxxSubComponent = XxxComponent.extend({\n * defaultOption: {\n * yy: 456\n * },\n * fn: function () {\n * let opt = this.getDefaultOption();\n * // opt is {xx: 123, yy: 456}\n * }\n * })\n * ```\n */\n\n\n ComponentModel.prototype.getDefaultOption = function () {\n var ctor = this.constructor; // If using class declaration, it is different to travel super class\n // in legacy env and auto merge defaultOption. So if using class\n // declaration, defaultOption should be merged manually.\n\n if (!isExtendedClass(ctor)) {\n // When using ts class, defaultOption must be declared as static.\n return ctor.defaultOption;\n } // FIXME: remove this approach?\n\n\n var fields = inner(this);\n\n if (!fields.defaultOption) {\n var optList = [];\n var clz = ctor;\n\n while (clz) {\n var opt = clz.prototype.defaultOption;\n opt && optList.push(opt);\n clz = clz.superClass;\n }\n\n var defaultOption = {};\n\n for (var i = optList.length - 1; i >= 0; i--) {\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n }\n\n fields.defaultOption = defaultOption;\n }\n\n return fields.defaultOption;\n };\n /**\n * Notice: always force to input param `useDefault` in case that forget to consider it.\n * The same behavior as `modelUtil.parseFinder`.\n *\n * @param useDefault In many cases like series refer axis and axis refer grid,\n * If axis index / axis id not specified, use the first target as default.\n * In other cases like dataZoom refer axis, if not specified, measn no refer.\n */\n\n\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\n var indexKey = mainType + 'Index';\n var idKey = mainType + 'Id';\n return queryReferringComponents(this.ecModel, mainType, {\n index: this.get(indexKey, true),\n id: this.get(idKey, true)\n }, opt);\n };\n\n ComponentModel.prototype.getBoxLayoutParams = function () {\n // Consider itself having box layout configs.\n var boxLayoutModel = this;\n return {\n left: boxLayoutModel.get('left'),\n top: boxLayoutModel.get('top'),\n right: boxLayoutModel.get('right'),\n bottom: boxLayoutModel.get('bottom'),\n width: boxLayoutModel.get('width'),\n height: boxLayoutModel.get('height')\n };\n };\n\n ComponentModel.protoInitialize = function () {\n var proto = ComponentModel.prototype;\n proto.type = 'component';\n proto.id = '';\n proto.name = '';\n proto.mainType = '';\n proto.subType = '';\n proto.componentIndex = 0;\n }();\n\n return ComponentModel;\n}(Model);\n\nmountExtend(ComponentModel, Model);\nenableClassManagement(ComponentModel);\ncomponentUtil.enableSubTypeDefaulter(ComponentModel);\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\n\nfunction getDependencies(componentType) {\n var deps = [];\n zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (clz) {\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\n }); // Ensure main type.\n\n deps = zrUtil.map(deps, function (type) {\n return parseClassType(type).main;\n }); // Hack dataset for convenience.\n\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n deps.unshift('dataset');\n }\n\n return deps;\n}\n\nexport default ComponentModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar platform = ''; // Navigator not exists in node\n\nif (typeof navigator !== 'undefined') {\n /* global navigator */\n platform = navigator.platform || '';\n}\n\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\nexport default {\n darkMode: 'auto',\n // backgroundColor: 'rgba(0,0,0,0)',\n // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization\n // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'],\n // Light colors:\n // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'],\n // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'],\n // Dark colors:\n // color: [\n // '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83',\n // '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'\n // ],\n color: [// '#51689b', '#ce5c5c', '#fbc357', '#8fbf8f', '#659d84', '#fb8e6a', '#c77288', '#786090', '#91c4c5', '#6890ba'\n '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\n aria: {\n decal: {\n decals: [{\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [2, 5],\n symbolSize: 1,\n rotation: Math.PI / 6\n }, {\n color: decalColor,\n symbol: 'circle',\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\n dashArrayY: [6, 0],\n symbolSize: 0.8\n }, {\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [4, 3],\n rotation: -Math.PI / 4\n }, {\n color: decalColor,\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\n dashArrayY: [6, 0]\n }, {\n color: decalColor,\n dashArrayX: [[1, 0], [1, 6]],\n dashArrayY: [1, 0, 6, 0],\n rotation: Math.PI / 4\n }, {\n color: decalColor,\n symbol: 'triangle',\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\n dashArrayY: [7, 2],\n symbolSize: 0.75\n }]\n }\n },\n // If xAxis and yAxis declared, grid is created by default.\n // grid: {},\n textStyle: {\n // color: '#000',\n // decoration: 'none',\n // PENDING\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n // fontFamily: 'Arial, Verdana, sans-serif',\n fontSize: 12,\n fontStyle: 'normal',\n fontWeight: 'normal'\n },\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n // Default is source-over\n blendMode: null,\n stateAnimation: {\n duration: 300,\n easing: 'cubicOut'\n },\n animation: 'auto',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut',\n animationEasingUpdate: 'cubicInOut',\n animationThreshold: 2000,\n // Configuration for progressive/incremental rendering\n progressiveThreshold: 3000,\n progressive: 400,\n // Threshold of if use single hover layer to optimize.\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n // which is unexpected.\n // see example <echarts/test/heatmap-large.html>.\n hoverLayerThreshold: 3000,\n // See: module:echarts/scale/Time\n useUTC: false\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util';\n;\n;\n;\nexport var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'seriesName']);\nexport var SOURCE_FORMAT_ORIGINAL = 'original';\nexport var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nexport var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nexport var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nexport var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nexport var SOURCE_FORMAT_UNKNOWN = 'unknown';\nexport var SERIES_LAYOUT_BY_COLUMN = 'column';\nexport var SERIES_LAYOUT_BY_ROW = 'row';\n;\n;\n;\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types'; // The result of `guessOrdinal`.\n\nexport var BE_ORDINAL = {\n Must: 1,\n Might: 2,\n Not: 3 // Other cases\n\n};\nvar innerGlobalModel = makeInner();\n/**\n * MUST be called before mergeOption of all series.\n */\n\nexport function resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\n * [The strategy of the arrengment of data dimensions for dataset]:\n * \"value way\": all axes are non-category axes. So series one by one take\n * several (the number is coordSysDims.length) dimensions from dataset.\n * The result of data arrengment of data dimensions like:\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\n * \"category way\": at least one axis is category axis. So the the first data\n * dimension is always mapped to the first category axis and shared by\n * all of the series. The other data dimensions are taken by series like\n * \"value way\" does.\n * The result of data arrengment of data dimensions like:\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\n *\n * @return encode Never be `null/undefined`.\n */\n\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\n * Work for data like [{name: ..., value: ...}, ...].\n *\n * @return encode Never be `null/undefined`.\n */\n\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel) {\n return encode;\n }\n\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = []; // 5 is an experience value.\n\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n\n\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n\n if (idxResult) {\n encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority.\n\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n\n return encode;\n}\n/**\n * @return If return null/undefined, indicate that should not use datasetModel.\n */\n\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n var thisData = seriesModel.get('data', true);\n\n if (!thisData) {\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n index: seriesModel.get('datasetIndex', true),\n id: seriesModel.get('datasetId', true)\n }, SINGLE_REFERRING).models[0];\n }\n}\n/**\n * @return Always return an array event empty.\n */\n\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n // Only these attributes declared, we by defualt reference to `datasetIndex: 0`.\n // Otherwise, no reference.\n if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n return [];\n }\n\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n index: datasetModel.get('fromDatasetIndex', true),\n id: datasetModel.get('fromDatasetId', true)\n }, SINGLE_REFERRING).models;\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n */\n\nexport function guessOrdinal(source, dimIndex) {\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n} // dimIndex may be overflow source data.\n// return {BE_ORDINAL}\n\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n var result; // Experience value.\n\n var maxLoop = 5;\n\n if (isTypedArray(data)) {\n return BE_ORDINAL.Not;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n var dimType;\n\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = dataArrayRows[dimIndex];\n\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n if ((result = detectValue(sample[startIndex + i])) != null) {\n return result;\n }\n }\n } else {\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\n var row = dataArrayRows[startIndex + i];\n\n if (row && (result = detectValue(row[dimIndex])) != null) {\n return result;\n }\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var dataObjectRows = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n var item = dataObjectRows[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n var dataKeyedColumns = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n var sample = dataKeyedColumns[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\n if ((result = detectValue(sample[i])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var dataOriginal = data;\n\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n var item = dataOriginal[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n\n if (val != null && isFinite(val) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n\n return BE_ORDINAL.Not;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, assert } from 'zrender/lib/core/util';\nimport { isComponentIdInternal } from '../util/model';\nvar internalOptionCreatorMap = createHashMap();\nexport function registerInternalOptionCreator(mainType, creator) {\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\n internalOptionCreatorMap.set(mainType, creator);\n}\nexport function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\n\n if (!internalOptionCreator) {\n return newCmptOptionList;\n }\n\n var internalOptions = internalOptionCreator(ecModel);\n\n if (!internalOptions) {\n return newCmptOptionList;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < internalOptions.length; i++) {\n assert(isComponentIdInternal(internalOptions[i]));\n }\n }\n\n return newCmptOptionList.concat(internalOptions);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, normalizeToArray } from '../../util/model';\nvar innerColor = makeInner();\nvar innerDecal = makeInner();\n\nvar PaletteMixin =\n/** @class */\nfunction () {\n function PaletteMixin() {}\n\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\n var defaultPalette = normalizeToArray(this.get('color', true));\n var layeredPalette = this.get('colorLayer', true);\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\n };\n\n PaletteMixin.prototype.clearColorPalette = function () {\n clearPalette(this, innerColor);\n };\n\n return PaletteMixin;\n}();\n\nexport function getDecalFromPalette(ecModel, name, scope, requestNum) {\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\n}\n\nfunction getNearestPalette(palettes, requestColorNum) {\n var paletteNum = palettes.length; // TODO palettes must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (palettes[i].length > requestColorNum) {\n return palettes[i];\n }\n }\n\n return palettes[paletteNum - 1];\n}\n/**\n * @param name MUST NOT be null/undefined. Otherwise call this function\n * twise with the same parameters will get different result.\n * @param scope default this.\n * @return Can be null/undefined\n */\n\n\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\n scope = scope || that;\n var scopeFields = inner(scope);\n var paletteIdx = scopeFields.paletteIdx || 0;\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (paletteNameMap.hasOwnProperty(name)) {\n return paletteNameMap[name];\n }\n\n var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); // In case can't find in layered color palette.\n\n palette = palette || defaultPalette;\n\n if (!palette || !palette.length) {\n return;\n }\n\n var pickedPaletteItem = palette[paletteIdx];\n\n if (name) {\n paletteNameMap[name] = pickedPaletteItem;\n }\n\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\n return pickedPaletteItem;\n}\n\nfunction clearPalette(that, inner) {\n inner(that).paletteIdx = 0;\n inner(that).paletteNameMap = {};\n}\n\nexport { PaletteMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\n * consistent to the original sequence, even though there might result in \"hole\".\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\n\nimport { each, filter, isArray, isObject, isString, createHashMap, assert, clone, merge, extend, mixin, isFunction } from 'zrender/lib/core/util';\nimport * as modelUtil from '../util/model';\nimport Model from './Model';\nimport ComponentModel from './Component';\nimport globalDefault from './globalDefault';\nimport { resetSourceDefaulter } from '../data/helper/sourceHelper';\nimport { concatInternalOptions } from './internalComponentCreator';\nimport { PaletteMixin } from './mixin/palette';\nimport { error } from '../util/log'; // -----------------------\n// Internal method names:\n// -----------------------\n\nvar reCreateSeriesIndices;\nvar assertSeriesInitialized;\nvar initBase;\nvar OPTION_INNER_KEY = '\\0_ec_inner';\nvar OPTION_INNER_VALUE = 1;\nvar BUITIN_COMPONENTS_MAP = {\n grid: 'GridComponent',\n polar: 'PolarComponent',\n geo: 'GeoComponent',\n singleAxis: 'SingleAxisComponent',\n parallel: 'ParallelComponent',\n calendar: 'CalendarComponent',\n graphic: 'GraphicComponent',\n toolbox: 'ToolboxComponent',\n tooltip: 'TooltipComponent',\n axisPointer: 'AxisPointerComponent',\n brush: 'BrushComponent',\n title: 'TitleComponent',\n timeline: 'TimelineComponent',\n markPoint: 'MarkPointComponent',\n markLine: 'MarkLineComponent',\n markArea: 'MarkAreaComponent',\n legend: 'LegendComponent',\n dataZoom: 'DataZoomComponent',\n visualMap: 'VisualMapComponent',\n // aria: 'AriaComponent',\n // dataset: 'DatasetComponent',\n // Dependencies\n xAxis: 'GridComponent',\n yAxis: 'GridComponent',\n angleAxis: 'PolarComponent',\n radiusAxis: 'PolarComponent'\n};\nvar BUILTIN_CHARTS_MAP = {\n line: 'LineChart',\n bar: 'BarChart',\n pie: 'PieChart',\n scatter: 'ScatterChart',\n radar: 'RadarChart',\n map: 'MapChart',\n tree: 'TreeChart',\n treemap: 'TreemapChart',\n graph: 'GraphChart',\n gauge: 'GaugeChart',\n funnel: 'FunnelChart',\n parallel: 'ParallelChart',\n sankey: 'SankeyChart',\n boxplot: 'BoxplotChart',\n candlestick: 'CandlestickChart',\n effectScatter: 'EffectScatterChart',\n lines: 'LinesChart',\n heatmap: 'HeatmapChart',\n pictorialBar: 'PictorialBarChart',\n themeRiver: 'ThemeRiverChart',\n sunburst: 'SunburstChart',\n custom: 'CustomChart'\n};\nvar componetsMissingLogPrinted = {};\n\nvar GlobalModel =\n/** @class */\nfunction (_super) {\n __extends(GlobalModel, _super);\n\n function GlobalModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n this._theme = new Model(theme);\n this._locale = new Model(locale);\n this._optionManager = optionManager;\n };\n\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\n if (process.env.NODE_ENV !== 'production') {\n assert(option != null, 'option is null/undefined');\n assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()');\n }\n\n var innerOpt = normalizeSetOptionInput(opts);\n\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\n\n this._resetOption(null, innerOpt);\n };\n /**\n * @param type null/undefined: reset all.\n * 'recreate': force recreate all.\n * 'timeline': only reset timeline option\n * 'media': only reset media query option\n * @return Whether option changed.\n */\n\n\n GlobalModel.prototype.resetOption = function (type, opt) {\n return this._resetOption(type, normalizeSetOptionInput(opt));\n };\n\n GlobalModel.prototype._resetOption = function (type, opt) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (!this.option || type === 'recreate') {\n initBase(this, baseOption);\n } else {\n this.restoreData();\n\n this._mergeOption(baseOption, opt);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n } // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\n // it should better not have the same props with `MediaUnit['option']`.\n // Becuase either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\n // rather than original \"baseOption\". If they both override a prop, the result might be\n // unexpected when media state changed after `setOption` called.\n // If we really need to modify a props in each `MediaUnit['option']`, use the full version\n // (`{baseOption, media}`) in `setOption`.\n // For `timeline`, the case is the same.\n\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n\n if (timelineOption) {\n optionChanged = true;\n\n this._mergeOption(timelineOption, opt);\n }\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n optionChanged = true;\n\n this._mergeOption(mediaOption, opt);\n }, this);\n }\n }\n\n return optionChanged;\n };\n\n GlobalModel.prototype.mergeOption = function (option) {\n this._mergeOption(option, null);\n };\n\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var componentsCount = this._componentsCount;\n var newCmptTypes = [];\n var newCmptTypeMap = createHashMap();\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n if (process.env.NODE_ENV !== 'production') {\n var componentImportName = BUITIN_COMPONENTS_MAP[mainType];\n\n if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\n error(\"Component \" + mainType + \" is used but not imported.\\nimport { \" + componentImportName + \" } from 'echarts/components';\\necharts.use([\" + componentImportName + \"]);\");\n componetsMissingLogPrinted[componentImportName] = true;\n }\n } // globalSettingTask.dirty();\n\n\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCmptTypes.push(mainType);\n newCmptTypeMap.set(mainType, true);\n }\n });\n\n if (replaceMergeMainTypeMap) {\n // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\n // we trade it as it is declared in option as `{xxx: []}`. Because:\n // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\n // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\n newCmptTypes.push(mainTypeInReplaceMerge);\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\n }\n });\n }\n\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType) {\n var newCmptOptionList = concatInternalOptions(this, mainType, modelUtil.normalizeToArray(newOption[mainType]));\n var oldCmptList = componentsMap.get(mainType);\n var mergeMode = // `!oldCmptList` means init. See the comment in `mappingToExists`\n !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';\n var mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode); // Set mainType and complete subType.\n\n modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); // Empty it before the travel, in order to prevent `this._componentsMap`\n // from being used in the `init`/`mergeOption`/`optionUpdated` of some\n // components, which is probably incorrect logic.\n\n option[mainType] = null;\n componentsMap.set(mainType, null);\n componentsCount.set(mainType, 0);\n var optionsByMainType = [];\n var cmptsByMainType = [];\n var cmptsCountByMainType = 0;\n each(mappingResult, function (resultItem, index) {\n var componentModel = resultItem.existing;\n var newCmptOption = resultItem.newOption;\n\n if (!newCmptOption) {\n if (componentModel) {\n // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } // If no both `resultItem.exist` and `resultItem.option`,\n // either it is in `replaceMerge` and not matched by any id,\n // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\n\n } else {\n var isSeriesType = mainType === 'series';\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists\n );\n\n if (!ComponentModelClass) {\n if (process.env.NODE_ENV !== 'production') {\n var subType = resultItem.keyInfo.subType;\n var seriesImportName = BUILTIN_CHARTS_MAP[subType];\n\n if (!componetsMissingLogPrinted[subType]) {\n componetsMissingLogPrinted[subType] = true;\n\n if (seriesImportName) {\n error(\"Series \" + subType + \" is used but not imported.\\nimport { \" + seriesImportName + \" } from 'echarts/charts';\\necharts.use([\" + seriesImportName + \"]);\");\n } else {\n error(\"Unkown series \" + subType);\n }\n }\n }\n\n return;\n }\n\n if (componentModel && componentModel.constructor === ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCmptOption, this);\n componentModel.optionUpdated(newCmptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo`\n\n extend(componentModel, extraOpt);\n\n if (resultItem.brandNew) {\n componentModel.__requireNewView = true;\n }\n\n componentModel.init(newCmptOption, this, this); // Call optionUpdated after init.\n // newCmptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n if (componentModel) {\n optionsByMainType.push(componentModel.option);\n cmptsByMainType.push(componentModel);\n cmptsCountByMainType++;\n } else {\n // Always do assign to avoid elided item in array.\n optionsByMainType.push(void 0);\n cmptsByMainType.push(void 0);\n }\n }, this);\n option[mainType] = optionsByMainType;\n componentsMap.set(mainType, cmptsByMainType);\n componentsCount.set(mainType, cmptsCountByMainType); // Backup series for filtering.\n\n if (mainType === 'series') {\n reCreateSeriesIndices(this);\n }\n } // If no series declared, ensure `_seriesIndices` initialized.\n\n\n if (!this._seriesIndices) {\n reCreateSeriesIndices(this);\n }\n };\n /**\n * Get option for output (cloned option and inner info removed)\n */\n\n\n GlobalModel.prototype.getOption = function () {\n var option = clone(this.option);\n each(option, function (optInMainType, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(optInMainType); // Inner cmpts need to be removed.\n // Inner cmpts might not be at last since ec5.0, but still\n // compatible for users: if inner cmpt at last, splice the returned array.\n\n var realLen = opts.length;\n var metNonInner = false;\n\n for (var i = realLen - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\n metNonInner = true;\n } else {\n opts[i] = null;\n !metNonInner && realLen--;\n }\n }\n\n opts.length = realLen;\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n };\n\n GlobalModel.prototype.getTheme = function () {\n return this._theme;\n };\n\n GlobalModel.prototype.getLocaleModel = function () {\n return this._locale;\n };\n\n GlobalModel.prototype.getLocale = function (localePosition) {\n var locale = this.getLocaleModel();\n return locale.get(localePosition);\n };\n\n GlobalModel.prototype.setUpdatePayload = function (payload) {\n this._payload = payload;\n };\n\n GlobalModel.prototype.getUpdatePayload = function () {\n return this._payload;\n };\n /**\n * @param idx If not specified, return the first one.\n */\n\n\n GlobalModel.prototype.getComponent = function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n var cmpt = list[idx || 0];\n\n if (cmpt) {\n return cmpt;\n } else if (idx == null) {\n for (var i = 0; i < list.length; i++) {\n if (list[i]) {\n return list[i];\n }\n }\n }\n }\n };\n /**\n * @return Never be null/undefined.\n */\n\n\n GlobalModel.prototype.queryComponents = function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cmpts = this._componentsMap.get(mainType);\n\n if (!cmpts || !cmpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n result = [];\n each(modelUtil.normalizeToArray(index), function (idx) {\n cmpts[idx] && result.push(cmpts[idx]);\n });\n } else if (id != null) {\n result = queryByIdOrName('id', id, cmpts);\n } else if (name != null) {\n result = queryByIdOrName('name', name, cmpts);\n } else {\n // Return all non-empty components in that mainType\n result = filter(cmpts, function (cmpt) {\n return !!cmpt;\n });\n }\n\n return filterBySubType(result, condition);\n };\n /**\n * The interface is different from queryComponents,\n * which is convenient for inner usage.\n *\n * @usage\n * let result = findComponents(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n * );\n * let result = findComponents(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n * );\n * let result = findComponents(\n * {mainType: 'series',\n * filter: function (model, index) {...}}\n * );\n * // result like [component0, componnet1, ...]\n */\n\n\n GlobalModel.prototype.findComponents = function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) // Retrieve all non-empty components.\n : filter(this._componentsMap.get(mainType), function (cmpt) {\n return !!cmpt;\n });\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n };\n\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (isFunction(mainType)) {\n var ctxForAll_1 = cb;\n var cbForAll_1 = mainType;\n componentsMap.each(function (cmpts, componentType) {\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\n }\n });\n } else {\n var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null;\n\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\n }\n }\n };\n /**\n * Get series list before filtered by name.\n */\n\n\n GlobalModel.prototype.getSeriesByName = function (name) {\n var nameStr = modelUtil.convertOptionIdName(name, null);\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && nameStr != null && oneSeries.name === nameStr;\n });\n };\n /**\n * Get series list before filtered by index.\n */\n\n\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n };\n /**\n * Get series list before filtered by type.\n * FIXME: rename to getRawSeriesByType?\n */\n\n\n GlobalModel.prototype.getSeriesByType = function (subType) {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && oneSeries.subType === subType;\n });\n };\n /**\n * Get all series before filtered.\n */\n\n\n GlobalModel.prototype.getSeries = function () {\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) {\n return !!oneSeries;\n });\n };\n /**\n * Count series before filtered.\n */\n\n\n GlobalModel.prototype.getSeriesCount = function () {\n return this._componentsCount.get('series');\n };\n /**\n * After filtering, series may be different\n * frome raw series.\n */\n\n\n GlobalModel.prototype.eachSeries = function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n };\n /**\n * Iterate raw series before filtered.\n *\n * @param {Function} cb\n * @param {*} context\n */\n\n\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\n each(this._componentsMap.get('series'), function (series) {\n series && cb.call(context, series, series.componentIndex);\n });\n };\n /**\n * After filtering, series may be different.\n * frome raw series.\n */\n\n\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n };\n /**\n * Iterate raw series before filtered of given type.\n */\n\n\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n };\n\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n };\n\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\n return (this._seriesIndices || []).slice();\n };\n\n GlobalModel.prototype.filterSeries = function (cb, context) {\n assertSeriesInitialized(this);\n var newSeriesIndices = [];\n each(this._seriesIndices, function (seriesRawIdx) {\n var series = this._componentsMap.get('series')[seriesRawIdx];\n\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\n }, this);\n this._seriesIndices = newSeriesIndices;\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\n };\n\n GlobalModel.prototype.restoreData = function (payload) {\n reCreateSeriesIndices(this);\n var componentsMap = this._componentsMap;\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n if (ComponentModel.hasClass(componentType)) {\n componentTypes.push(componentType);\n }\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\n each(componentsMap.get(componentType), function (component) {\n if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) {\n component.restoreData();\n }\n });\n });\n };\n\n GlobalModel.internalField = function () {\n reCreateSeriesIndices = function (ecModel) {\n var seriesIndices = ecModel._seriesIndices = [];\n each(ecModel._componentsMap.get('series'), function (series) {\n // series may have been removed by `replaceMerge`.\n series && seriesIndices.push(series.componentIndex);\n });\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\n };\n\n assertSeriesInitialized = function (ecModel) {\n // Components that use _seriesIndices should depends on series component,\n // which make sure that their initialization is after series.\n if (process.env.NODE_ENV !== 'production') {\n if (!ecModel._seriesIndices) {\n throw new Error('Option should contains series.');\n }\n }\n };\n\n initBase = function (ecModel, baseOption) {\n // Using OPTION_INNER_KEY to mark that this option can not be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbiden.\n ecModel.option = {};\n ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; // Init with series: [], in case of calling findSeries method\n // before series initialized.\n\n ecModel._componentsMap = createHashMap({\n series: []\n });\n ecModel._componentsCount = createHashMap(); // If user spefied `option.aria`, aria will be enable. This detection should be\n // performed before theme and globalDefault merge.\n\n var airaOption = baseOption.aria;\n\n if (isObject(airaOption) && airaOption.enabled == null) {\n airaOption.enabled = true;\n }\n\n mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n\n ecModel._mergeOption(baseOption, null);\n };\n }();\n\n return GlobalModel;\n}(Model);\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seriesIndex;\n var id = payload.seriesId;\n var name_1 = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;\n }\n}\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // If it is component model mainType, the model handles that merge later.\n // otherwise, merge them here.\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction queryByIdOrName(attr, idOrName, cmpts) {\n // Here is a break from echarts4: string and number are\n // treated as equal.\n if (isArray(idOrName)) {\n var keyMap_1 = createHashMap();\n each(idOrName, function (idOrNameItem) {\n if (idOrNameItem != null) {\n var idName = modelUtil.convertOptionIdName(idOrNameItem, null);\n idName != null && keyMap_1.set(idOrNameItem, true);\n }\n });\n return filter(cmpts, function (cmpt) {\n return cmpt && keyMap_1.get(cmpt[attr]);\n });\n } else {\n var idName_1 = modelUtil.convertOptionIdName(idOrName, null);\n return filter(cmpts, function (cmpt) {\n return cmpt && idName_1 != null && cmpt[attr] === idName_1;\n });\n }\n}\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) {\n return cmpt && cmpt.subType === condition.subType;\n }) : components;\n}\n\nfunction normalizeSetOptionInput(opts) {\n var replaceMergeMainTypeMap = createHashMap();\n opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\n if (process.env.NODE_ENV !== 'production') {\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\n }\n\n replaceMergeMainTypeMap.set(mainType, true);\n });\n return {\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\n };\n}\n\nmixin(GlobalModel, PaletteMixin);\nexport default GlobalModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', // 'getModel',\n'getOption', // 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\n\nvar ExtensionAPI =\n/** @class */\nfunction () {\n function ExtensionAPI(ecInstance) {\n zrUtil.each(availableMethods, function (methodName) {\n this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n }, this);\n }\n\n return ExtensionAPI;\n}();\n\nexport default ExtensionAPI;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar coordinateSystemCreators = {};\n\nvar CoordinateSystemManager =\n/** @class */\nfunction () {\n function CoordinateSystemManager() {\n this._coordinateSystems = [];\n }\n\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creater, type) {\n var list = creater.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n };\n\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n };\n\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n return this._coordinateSystems.slice();\n };\n\n CoordinateSystemManager.register = function (type, creator) {\n coordinateSystemCreators[type] = creator;\n };\n\n CoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n };\n\n return CoordinateSystemManager;\n}();\n\nexport default CoordinateSystemManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { normalizeToArray // , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\n} from '../util/model';\nimport { each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject // , HashMap , createHashMap, extend, merge,\n} from 'zrender/lib/core/util';\nimport { error } from '../util/log';\nvar QUERY_REG = /^(min|max)?(.+)$/; // Key: mainType\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\n\n/**\n * TERM EXPLANATIONS:\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\n */\n\nvar OptionManager =\n/** @class */\nfunction () {\n // timeline.notMerge is not supported in ec3. Firstly there is rearly\n // case that notMerge is needed. Secondly supporting 'notMerge' requires\n // rawOption cloned and backuped when timeline changed, which does no\n // good to performance. What's more, that both timeline and setOption\n // method supply 'notMerge' brings complex and some problems.\n // Consider this case:\n // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n function OptionManager(api) {\n this._timelineOptions = [];\n this._mediaList = [];\n /**\n * -1, means default.\n * empty means no media.\n */\n\n this._currentMediaIndices = [];\n this._api = api;\n }\n\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\n if (rawOption) {\n // That set dat primitive is dangerous if user reuse the data when setOption again.\n each(normalizeToArray(rawOption.series), function (series) {\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\n });\n each(normalizeToArray(rawOption.dataset), function (dataset) {\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\n });\n } // Caution: some series modify option data, if do not clone,\n // it should ensure that the repeat modify correctly\n // (create a new object when modify itself).\n\n\n rawOption = clone(rawOption); // FIXME\n // If some property is set in timeline options or media option but\n // not set in baseOption, a warning should be given.\n\n var optionBackup = this._optionBackup;\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\n this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode);\n\n if (optionBackup) {\n // FIXME\n // the restore merge solution is essentially incorrect.\n // the mapping can not be 100% consistent with ecModel, which probably brings\n // potential bug!\n // The first merge is delayed, becuase in most cases, users do not call `setOption` twice.\n // let fakeCmptsMap = this._fakeCmptsMap;\n // if (!fakeCmptsMap) {\n // fakeCmptsMap = this._fakeCmptsMap = createHashMap();\n // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\n // }\n // mergeToBackupOption(\n // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\n // );\n // For simplicity, timeline options and media options do not support merge,\n // that is, if you `setOption` twice and both has timeline options, the latter\n // timeline opitons will not be merged to the formers, but just substitude them.\n if (newParsedOption.timelineOptions.length) {\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\n }\n\n if (newParsedOption.mediaList.length) {\n optionBackup.mediaList = newParsedOption.mediaList;\n }\n\n if (newParsedOption.mediaDefault) {\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\n }\n } else {\n this._optionBackup = newParsedOption;\n }\n };\n\n OptionManager.prototype.mountOption = function (isRecreate) {\n var optionBackup = this._optionBackup;\n this._timelineOptions = optionBackup.timelineOptions;\n this._mediaList = optionBackup.mediaList;\n this._mediaDefault = optionBackup.mediaDefault;\n this._currentMediaIndices = [];\n return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption`\n // called, and is merged into every new option by inner method `mergeToBackupOption`\n // each time `setOption` called, can be only used in `isRecreate`, because\n // its reliability is under suspicion. In other cases option merge is\n // performed by `model.mergeOption`.\n ? optionBackup.baseOption : this._newBaseOption);\n };\n\n OptionManager.prototype.getTimelineOption = function (ecModel) {\n var option;\n var timelineOptions = this._timelineOptions;\n\n if (timelineOptions.length) {\n // getTimelineOption can only be called after ecModel inited,\n // so we can get currentIndex from timelineModel.\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel) {\n option = clone( // FIXME:TS as TimelineModel or quivlant interface\n timelineOptions[timelineModel.getCurrentIndex()]);\n }\n }\n\n return option;\n };\n\n OptionManager.prototype.getMediaOption = function (ecModel) {\n var ecWidth = this._api.getWidth();\n\n var ecHeight = this._api.getHeight();\n\n var mediaList = this._mediaList;\n var mediaDefault = this._mediaDefault;\n var indices = [];\n var result = []; // No media defined.\n\n if (!mediaList.length && !mediaDefault) {\n return result;\n } // Multi media may be applied, the latter defined media has higher priority.\n\n\n for (var i = 0, len = mediaList.length; i < len; i++) {\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n indices.push(i);\n }\n } // FIXME\n // Whether mediaDefault should force users to provide? Otherwise\n // the change by media query can not be recorvered.\n\n\n if (!indices.length && mediaDefault) {\n indices = [-1];\n }\n\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n result = map(indices, function (index) {\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n });\n } // Otherwise return nothing.\n\n\n this._currentMediaIndices = indices;\n return result;\n };\n\n return OptionManager;\n}();\n/**\n * [RAW_OPTION_PATTERNS]\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\n *\n * (1) No prop \"baseOption\" declared:\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\n * ```js\n * option = {\n * series: [],\n * timeline: {},\n * options: [],\n * };\n * option = {\n * series: [],\n * media: {},\n * };\n * option = {\n * series: [],\n * timeline: {},\n * options: [],\n * media: {},\n * }\n * ```\n *\n * (2) Prop \"baseOption\" declared:\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\n * ```js\n * option = {\n * baseOption: {\n * timeline: {},\n * series: [],\n * },\n * options: []\n * };\n * option = {\n * baseOption: {\n * series: [],\n * },\n * media: []\n * };\n * option = {\n * baseOption: {\n * timeline: {},\n * series: [],\n * },\n * options: []\n * media: []\n * };\n * option = {\n * // ec3 compat ec2: allow (only) `timeline` declared\n * // outside baseOption. Keep this setting for compat.\n * timeline: {},\n * baseOption: {\n * series: [],\n * },\n * options: [],\n * media: []\n * };\n * ```\n */\n\n\nfunction parseRawOption( // `rawOption` May be modified\nrawOption, optionPreprocessorFuncs, isNew) {\n var mediaList = [];\n var mediaDefault;\n var baseOption;\n var declaredBaseOption = rawOption.baseOption; // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\n\n var timelineOnRoot = rawOption.timeline;\n var timelineOptionsOnRoot = rawOption.options;\n var mediaOnRoot = rawOption.media;\n var hasMedia = !!rawOption.media;\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);\n\n if (declaredBaseOption) {\n baseOption = declaredBaseOption; // For merge option.\n\n if (!baseOption.timeline) {\n baseOption.timeline = timelineOnRoot;\n }\n } // For convenience, enable to use the root option as the `baseOption`:\n // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\n else {\n if (hasTimeline || hasMedia) {\n rawOption.options = rawOption.media = null;\n }\n\n baseOption = rawOption;\n }\n\n if (hasMedia) {\n if (isArray(mediaOnRoot)) {\n each(mediaOnRoot, function (singleMedia) {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) {\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\n }\n }\n\n if (singleMedia && singleMedia.option) {\n if (singleMedia.query) {\n mediaList.push(singleMedia);\n } else if (!mediaDefault) {\n // Use the first media default.\n mediaDefault = singleMedia;\n }\n }\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\n }\n }\n }\n\n doPreprocess(baseOption);\n each(timelineOptionsOnRoot, function (option) {\n return doPreprocess(option);\n });\n each(mediaList, function (media) {\n return doPreprocess(media.option);\n });\n\n function doPreprocess(option) {\n each(optionPreprocessorFuncs, function (preProcess) {\n preProcess(option, isNew);\n });\n }\n\n return {\n baseOption: baseOption,\n timelineOptions: timelineOptionsOnRoot || [],\n mediaDefault: mediaDefault,\n mediaList: mediaList\n };\n}\n/**\n * @see <http://www.w3.org/TR/css3-mediaqueries/#media1>\n * Support: width, height, aspectRatio\n * Can use max or min as prefix.\n */\n\n\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n var realMap = {\n width: ecWidth,\n height: ecHeight,\n aspectratio: ecWidth / ecHeight // lowser case for convenientce.\n\n };\n var applicatable = true;\n each(query, function (value, attr) {\n var matched = attr.match(QUERY_REG);\n\n if (!matched || !matched[1] || !matched[2]) {\n return;\n }\n\n var operator = matched[1];\n var realAttr = matched[2].toLowerCase();\n\n if (!compare(realMap[realAttr], value, operator)) {\n applicatable = false;\n }\n });\n return applicatable;\n}\n\nfunction compare(real, expect, operator) {\n if (operator === 'min') {\n return real >= expect;\n } else if (operator === 'max') {\n return real <= expect;\n } else {\n // Equals\n return real === expect;\n }\n}\n\nfunction indicesEquals(indices1, indices2) {\n // indices is always order by asc and has only finite number.\n return indices1.join(',') === indices2.join(',');\n}\n/**\n * Consider case:\n * `chart.setOption(opt1);`\n * Then user do some interaction like dataZoom, dataView changing.\n * `chart.setOption(opt2);`\n * Then user press 'reset button' in toolbox.\n *\n * After doing that all of the interaction effects should be reset, the\n * chart should be the same as the result of invoke\n * `chart.setOption(opt1); chart.setOption(opt2);`.\n *\n * Although it is not able ensure that\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\n * `chart.setOption(merge(opt1, opt2));` exactly,\n * this might be the only simple way to implement that feature.\n *\n * MEMO: We've considered some other approaches:\n * 1. Each model handle its self restoration but not uniform treatment.\n * (Too complex in logic and error-prone)\n * 2. Use a shadow ecModel. (Performace expensive)\n *\n * FIXME: A possible solution:\n * Add a extra level of model for each component model. The inheritance chain would be:\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\n * And all of the actions can only modify the `componentActionModel` rather than\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\n */\n// function mergeToBackupOption(\n// fakeCmptsMap: FakeComponentsMap,\n// // `tarOption` Can be null/undefined, means init\n// tarOption: ECUnitOption,\n// newOption: ECUnitOption,\n// // Can be null/undefined\n// opt: InnerSetOptionOpts\n// ): void {\n// newOption = newOption || {} as ECUnitOption;\n// const notInit = !!tarOption;\n// each(newOption, function (newOptsInMainType, mainType) {\n// if (newOptsInMainType == null) {\n// return;\n// }\n// if (!ComponentModel.hasClass(mainType)) {\n// if (tarOption) {\n// tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\n// }\n// }\n// else {\n// const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\n// const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\n// const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\n// const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\n// const mappingResult = mappingToExists(\n// oldFakeCmptsInMainType,\n// normalizeToArray(newOptsInMainType),\n// (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\n// );\n// setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\n// each(mappingResult, function (resultItem, index) {\n// // The same logic as `Global.ts#_mergeOption`.\n// let fakeCmpt = resultItem.existing;\n// const newOption = resultItem.newOption;\n// const keyInfo = resultItem.keyInfo;\n// let fakeCmptOpt;\n// if (!newOption) {\n// fakeCmptOpt = oldTarOptsInMainType[index];\n// }\n// else {\n// if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\n// fakeCmpt.name = keyInfo.name;\n// if (notInit) {\n// fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\n// }\n// }\n// else {\n// fakeCmpt = extend({}, keyInfo);\n// if (notInit) {\n// fakeCmptOpt = clone(newOption);\n// }\n// }\n// }\n// if (fakeCmpt) {\n// notInit && resultTarOptsInMainType.push(fakeCmptOpt);\n// resultFakeCmptsInMainType.push(fakeCmpt);\n// }\n// else {\n// notInit && resultTarOptsInMainType.push(void 0);\n// resultFakeCmptsInMainType.push(void 0);\n// }\n// });\n// }\n// });\n// }\n\n\nexport default OptionManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\n\nfunction compatEC2ItemStyle(opt) {\n var itemStyleOpt = opt && opt.itemStyle;\n\n if (!itemStyleOpt) {\n return;\n }\n\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n var styleName = POSSIBLE_STYLES[i];\n var normalItemStyleOpt = itemStyleOpt.normal;\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].normal) {\n opt[styleName].normal = normalItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n }\n\n normalItemStyleOpt[styleName] = null;\n }\n\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].emphasis) {\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n }\n\n emphasisItemStyleOpt[styleName] = null;\n }\n }\n}\n\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n var normalOpt = opt[optType].normal;\n var emphasisOpt = opt[optType].emphasis;\n\n if (normalOpt) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\n } // Timeline controlStyle has other properties besides normal and emphasis\n\n\n if (useExtend) {\n opt[optType].normal = opt[optType].emphasis = null;\n zrUtil.defaults(opt[optType], normalOpt);\n } else {\n opt[optType] = normalOpt;\n }\n }\n\n if (emphasisOpt) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\n }\n\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[optType] = emphasisOpt; // Also compat the case user mix the style and focus together in ec3 style\n // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\n\n if (emphasisOpt.focus) {\n opt.emphasis.focus = emphasisOpt.focus;\n }\n\n if (emphasisOpt.blurScope) {\n opt.emphasis.blurScope = emphasisOpt.blurScope;\n }\n }\n }\n}\n\nfunction removeEC3NormalStatus(opt) {\n convertNormalEmphasis(opt, 'itemStyle');\n convertNormalEmphasis(opt, 'lineStyle');\n convertNormalEmphasis(opt, 'areaStyle');\n convertNormalEmphasis(opt, 'label');\n convertNormalEmphasis(opt, 'labelLine'); // treemap\n\n convertNormalEmphasis(opt, 'upperLabel'); // graph\n\n convertNormalEmphasis(opt, 'edgeLabel');\n}\n\nfunction compatTextStyle(opt, propName) {\n // Check whether is not object (string\\null\\undefined ...)\n var labelOptSingle = isObject(opt) && opt[propName];\n var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n\n if (textStyle) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\n }\n\n for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\n\n if (textStyle.hasOwnProperty(textPropName)) {\n labelOptSingle[textPropName] = textStyle[textPropName];\n }\n }\n }\n}\n\nfunction compatEC3CommonStyles(opt) {\n if (opt) {\n removeEC3NormalStatus(opt);\n compatTextStyle(opt, 'label');\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n }\n}\n\nfunction processSeries(seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n compatEC2ItemStyle(seriesOpt);\n removeEC3NormalStatus(seriesOpt);\n compatTextStyle(seriesOpt, 'label'); // treemap\n\n compatTextStyle(seriesOpt, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt, 'edgeLabel');\n\n if (seriesOpt.emphasis) {\n compatTextStyle(seriesOpt.emphasis, 'label'); // treemap\n\n compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n }\n\n var markPoint = seriesOpt.markPoint;\n\n if (markPoint) {\n compatEC2ItemStyle(markPoint);\n compatEC3CommonStyles(markPoint);\n }\n\n var markLine = seriesOpt.markLine;\n\n if (markLine) {\n compatEC2ItemStyle(markLine);\n compatEC3CommonStyles(markLine);\n }\n\n var markArea = seriesOpt.markArea;\n\n if (markArea) {\n compatEC3CommonStyles(markArea);\n }\n\n var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option,\n // then the backward compat based on option type will not be performed.\n\n if (seriesOpt.type === 'graph') {\n data = data || seriesOpt.nodes;\n var edgeData = seriesOpt.links || seriesOpt.edges;\n\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n for (var i = 0; i < edgeData.length; i++) {\n compatEC3CommonStyles(edgeData[i]);\n }\n }\n\n zrUtil.each(seriesOpt.categories, function (opt) {\n removeEC3NormalStatus(opt);\n });\n }\n\n if (data && !zrUtil.isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatEC3CommonStyles(data[i]);\n }\n } // mark point data\n\n\n markPoint = seriesOpt.markPoint;\n\n if (markPoint && markPoint.data) {\n var mpData = markPoint.data;\n\n for (var i = 0; i < mpData.length; i++) {\n compatEC3CommonStyles(mpData[i]);\n }\n } // mark line data\n\n\n markLine = seriesOpt.markLine;\n\n if (markLine && markLine.data) {\n var mlData = markLine.data;\n\n for (var i = 0; i < mlData.length; i++) {\n if (zrUtil.isArray(mlData[i])) {\n compatEC3CommonStyles(mlData[i][0]);\n compatEC3CommonStyles(mlData[i][1]);\n } else {\n compatEC3CommonStyles(mlData[i]);\n }\n }\n } // Series\n\n\n if (seriesOpt.type === 'gauge') {\n compatTextStyle(seriesOpt, 'axisLabel');\n compatTextStyle(seriesOpt, 'title');\n compatTextStyle(seriesOpt, 'detail');\n } else if (seriesOpt.type === 'treemap') {\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n zrUtil.each(seriesOpt.levels, function (opt) {\n removeEC3NormalStatus(opt);\n });\n } else if (seriesOpt.type === 'tree') {\n removeEC3NormalStatus(seriesOpt.leaves);\n } // sunburst starts from ec4, so it does not need to compat levels.\n\n}\n\nfunction toArr(o) {\n return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\n\nfunction toObj(o) {\n return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\n\nexport default function globalCompatStyle(option, isTheme) {\n each(toArr(option.series), function (seriesOpt) {\n isObject(seriesOpt) && processSeries(seriesOpt);\n });\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n each(axes, function (axisName) {\n each(toArr(option[axisName]), function (axisOpt) {\n if (axisOpt) {\n compatTextStyle(axisOpt, 'axisLabel');\n compatTextStyle(axisOpt.axisPointer, 'label');\n }\n });\n });\n each(toArr(option.parallel), function (parallelOpt) {\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n compatTextStyle(parallelAxisDefault, 'axisLabel');\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n });\n each(toArr(option.calendar), function (calendarOpt) {\n convertNormalEmphasis(calendarOpt, 'itemStyle');\n compatTextStyle(calendarOpt, 'dayLabel');\n compatTextStyle(calendarOpt, 'monthLabel');\n compatTextStyle(calendarOpt, 'yearLabel');\n }); // radar.name.textStyle\n\n each(toArr(option.radar), function (radarOpt) {\n compatTextStyle(radarOpt, 'name'); // Use axisName instead of name because component has name property\n\n if (radarOpt.name && radarOpt.axisName == null) {\n radarOpt.axisName = radarOpt.name;\n delete radarOpt.name;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('name property in radar component has been changed to axisName');\n }\n }\n\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\n radarOpt.axisNameGap = radarOpt.nameGap;\n delete radarOpt.nameGap;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\n }\n }\n });\n each(toArr(option.geo), function (geoOpt) {\n if (isObject(geoOpt)) {\n compatEC3CommonStyles(geoOpt);\n each(toArr(geoOpt.regions), function (regionObj) {\n compatEC3CommonStyles(regionObj);\n });\n }\n });\n each(toArr(option.timeline), function (timelineOpt) {\n compatEC3CommonStyles(timelineOpt);\n convertNormalEmphasis(timelineOpt, 'label');\n convertNormalEmphasis(timelineOpt, 'itemStyle');\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n var data = timelineOpt.data;\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n if (zrUtil.isObject(item)) {\n convertNormalEmphasis(item, 'label');\n convertNormalEmphasis(item, 'itemStyle');\n }\n });\n });\n each(toArr(option.toolbox), function (toolboxOpt) {\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\n each(toolboxOpt.feature, function (featureOpt) {\n convertNormalEmphasis(featureOpt, 'iconStyle');\n });\n });\n compatTextStyle(toObj(option.axisPointer), 'label');\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); // Clean logs\n // storedLogs = {};\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util';\nimport compatStyle from './helper/compatStyle';\nimport { normalizeToArray } from '../util/model';\nimport { deprecateLog, deprecateReplaceLog } from '../util/log';\n\nfunction get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}\n\nfunction set(opt, path, val, overwrite) {\n var pathArr = path.split(',');\n var obj = opt;\n var key;\n var i = 0;\n\n for (; i < pathArr.length - 1; i++) {\n key = pathArr[i];\n\n if (obj[key] == null) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n if (overwrite || obj[pathArr[i]] == null) {\n obj[pathArr[i]] = val;\n }\n}\n\nfunction compatLayoutProperties(option) {\n option && each(LAYOUT_PROPERTIES, function (prop) {\n if (prop[0] in option && !(prop[1] in option)) {\n option[prop[1]] = option[prop[0]];\n }\n });\n}\n\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\nvar BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];\n\nfunction compatBarItemStyle(option) {\n var itemStyle = option && option.itemStyle;\n\n if (itemStyle) {\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\n var newName = BAR_ITEM_STYLE_MAP[i][0];\n\n if (itemStyle[oldName] != null) {\n itemStyle[newName] = itemStyle[oldName];\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(oldName, newName);\n }\n }\n }\n }\n}\n\nfunction compatPieLabel(option) {\n if (!option) {\n return;\n }\n\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\n }\n\n option.edgeDistance = option.margin;\n }\n}\n\nfunction compatSunburstState(option) {\n if (!option) {\n return;\n }\n\n if (option.downplay && !option.blur) {\n option.blur = option.downplay;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\n }\n }\n}\n\nfunction compatGraphFocus(option) {\n if (!option) {\n return;\n }\n\n if (option.focusNodeAdjacency != null) {\n option.emphasis = option.emphasis || {};\n\n if (option.emphasis.focus == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\n }\n\n option.emphasis.focus = 'adjacency';\n }\n }\n}\n\nfunction traverseTree(data, cb) {\n if (data) {\n for (var i = 0; i < data.length; i++) {\n cb(data[i]);\n data[i] && traverseTree(data[i].children, cb);\n }\n }\n}\n\nexport default function globalBackwardCompat(option, isTheme) {\n compatStyle(option, isTheme); // Make sure series array for model initialization.\n\n option.series = normalizeToArray(option.series);\n each(option.series, function (seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n var seriesType = seriesOpt.type;\n\n if (seriesType === 'line') {\n if (seriesOpt.clipOverflow != null) {\n seriesOpt.clip = seriesOpt.clipOverflow;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\n }\n }\n } else if (seriesType === 'pie' || seriesType === 'gauge') {\n if (seriesOpt.clockWise != null) {\n seriesOpt.clockwise = seriesOpt.clockWise;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clockWise', 'clockwise');\n }\n }\n\n compatPieLabel(seriesOpt.label);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatPieLabel(data[i]);\n }\n }\n\n if (seriesOpt.hoverOffset != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis.scaleSize = null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\n }\n\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\n }\n }\n } else if (seriesType === 'gauge') {\n var pointerColor = get(seriesOpt, 'pointer.color');\n pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n } else if (seriesType === 'bar') {\n compatBarItemStyle(seriesOpt);\n compatBarItemStyle(seriesOpt.backgroundStyle);\n compatBarItemStyle(seriesOpt.emphasis);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n if (typeof data[i] === 'object') {\n compatBarItemStyle(data[i]);\n compatBarItemStyle(data[i] && data[i].emphasis);\n }\n }\n }\n } else if (seriesType === 'sunburst') {\n var highlightPolicy = seriesOpt.highlightPolicy;\n\n if (highlightPolicy) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (!seriesOpt.emphasis.focus) {\n seriesOpt.emphasis.focus = highlightPolicy;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\n }\n }\n }\n\n compatSunburstState(seriesOpt);\n traverseTree(seriesOpt.data, compatSunburstState);\n } else if (seriesType === 'graph' || seriesType === 'sankey') {\n compatGraphFocus(seriesOpt); // TODO nodes, edges?\n } else if (seriesType === 'map') {\n if (seriesOpt.mapType && !seriesOpt.map) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('mapType', 'map', 'map');\n }\n\n seriesOpt.map = seriesOpt.mapType;\n }\n\n if (seriesOpt.mapLocation) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('`mapLocation` is not used anymore.');\n }\n\n defaults(seriesOpt, seriesOpt.mapLocation);\n }\n }\n\n if (seriesOpt.hoverAnimation != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\n }\n\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\n }\n }\n\n compatLayoutProperties(seriesOpt);\n }); // dataRange has changed to visualMap\n\n if (option.dataRange) {\n option.visualMap = option.dataRange;\n }\n\n each(COMPATITABLE_COMPONENTS, function (componentName) {\n var options = option[componentName];\n\n if (options) {\n if (!isArray(options)) {\n options = [options];\n }\n\n each(options, function (option) {\n compatLayoutProperties(option);\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util'; // (1) [Caution]: the logic is correct based on the premises:\n// data processing stage is blocked in stream.\n// See <module:echarts/stream/Scheduler#performDataProcessorTasks>\n// (2) Only register once when import repeatly.\n// Should be executed after series filtered and before stack calculation.\n\nexport default function dataStack(ecModel) {\n var stackInfoMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack.\n\n if (stack) {\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n var data = seriesModel.getData();\n var stackInfo = {\n // Used for calculate axis extent automatically.\n // TODO: Type getCalculationInfo return more specific type?\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n stackedDimension: data.getCalculationInfo('stackedDimension'),\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n data: data,\n seriesModel: seriesModel\n }; // If stacked on axis that do not support data stack.\n\n if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n return;\n }\n\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\n stackInfoList.push(stackInfo);\n }\n });\n stackInfoMap.each(calculateStack);\n}\n\nfunction calculateStack(stackInfoList) {\n each(stackInfoList, function (targetStackInfo, idxInStack) {\n var resultVal = [];\n var resultNaN = [NaN, NaN];\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n var targetData = targetStackInfo.data;\n var isStackedByIndex = targetStackInfo.isStackedByIndex; // Should not write on raw data, because stack series model list changes\n // depending on legend selection.\n\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver\n // should also be NaN, to draw a appropriate belt area.\n\n if (isNaN(sum)) {\n return resultNaN;\n }\n\n var byValue;\n var stackedDataRawIndex;\n\n if (isStackedByIndex) {\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n } else {\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n } // If stackOver is NaN, chart view will render point on value start.\n\n\n var stackedOver = NaN;\n\n for (var j = idxInStack - 1; j >= 0; j--) {\n var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`.\n\n if (!isStackedByIndex) {\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n }\n\n if (stackedDataRawIndex >= 0) {\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data\n\n if (sum >= 0 && val > 0 || // Positive stack\n sum <= 0 && val < 0 // Negative stack\n ) {\n sum += val;\n stackedOver = val;\n break;\n }\n }\n }\n\n resultVal[0] = sum;\n resultVal[1] = stackedOver;\n return resultVal;\n });\n targetData.hostModel.setData(newData); // Update for consequent calculation\n\n targetStackInfo.data = newData;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString } from 'zrender/lib/core/util';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types';\nimport { getDataItemValue } from '../util/model';\n; // @inner\n\nvar SourceImpl =\n/** @class */\nfunction () {\n // readonly frozen: boolean;\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDefine = fields.dimensionsDefine;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.encodeDefine = fields.encodeDefine;\n this.metaRawOption = fields.metaRawOption;\n }\n\n return SourceImpl;\n}();\n\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\nexport function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat, encodeDefine // can be null\n) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n encodeDefine: makeEncodeDefine(encodeDefine),\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\n\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\n * Clone source but excludes source data.\n */\n\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount,\n encodeDefine: makeEncodeDefine(source.encodeDefine)\n });\n}\n\nfunction makeEncodeDefine(encodeDefine) {\n // null means user not specify `series.encode`.\n return encodeDefine ? createHashMap(encodeDefine) : null;\n}\n/**\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\n */\n\n\nexport function detectSourceFormat(data) {\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (isArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n\n return sourceFormat;\n}\n/**\n * Determine the source definitions from data standalone dimensions definitions\n * are not specified.\n */\n\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PEDING: could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data; // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val + '' : '';\n }, seriesLayoutBy, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n}\n\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n\n\n if (obj) {\n var dimensions_1 = [];\n each(obj, function (value, key) {\n dimensions_1.push(key);\n });\n return dimensions_1;\n }\n} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefiend or string.\n\n\nfunction normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}\n\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _a, _b, _c; // TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\n\n\nimport { isTypedArray, extend, assert, each, isObject, bind } from 'zrender/lib/core/util';\nimport { getDataItemValue } from '../../util/model';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types';\nvar providerMethods;\nvar mountMethods;\n/**\n * If normal array used, mutable chunk size is supported.\n * If typed array used, chunk size must be fixed.\n */\n\nvar DefaultDataProvider =\n/** @class */\nfunction () {\n function DefaultDataProvider(sourceParam, dimSize) {\n // let source: Source;\n var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source;\n\n this._source = source;\n var data = this._data = source.data; // Typed array. TODO IE10+?\n\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n if (dimSize == null) {\n throw new Error('Typed array data must specify dimension size');\n }\n }\n\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n\n mountMethods(this, data, source);\n }\n\n DefaultDataProvider.prototype.getSource = function () {\n return this._source;\n };\n\n DefaultDataProvider.prototype.count = function () {\n return 0;\n };\n\n DefaultDataProvider.prototype.getItem = function (idx, out) {\n return;\n };\n\n DefaultDataProvider.prototype.appendData = function (newData) {};\n\n DefaultDataProvider.prototype.clean = function () {};\n\n DefaultDataProvider.protoInitialize = function () {\n // PENDING: To avoid potential incompat (e.g., prototype\n // is visited somewhere), still init them on prototype.\n var proto = DefaultDataProvider.prototype;\n proto.pure = false;\n proto.persistent = true;\n }();\n\n DefaultDataProvider.internalField = function () {\n var _a;\n\n mountMethods = function (provider, data, source) {\n var sourceFormat = source.sourceFormat;\n var seriesLayoutBy = source.seriesLayoutBy;\n var startIndex = source.startIndex;\n var dimsDef = source.dimensionsDefine;\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n }\n\n extend(provider, methods);\n\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n provider.getItem = getItemForTypedArray;\n provider.count = countForTypedArray;\n provider.fillStorage = fillStorageForTypedArray;\n } else {\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n }\n };\n\n var getItemForTypedArray = function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var data = this._data;\n var dimSize = this._dimSize;\n var offset = dimSize * idx;\n\n for (var i = 0; i < dimSize; i++) {\n out[i] = data[offset + i];\n }\n\n return out;\n };\n\n var fillStorageForTypedArray = function (start, end, storage, extent) {\n var data = this._data;\n var dimSize = this._dimSize;\n\n for (var dim = 0; dim < dimSize; dim++) {\n var dimExtent = extent[dim];\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n var count = end - start;\n var arr = storage[dim];\n\n for (var i = 0; i < count; i++) {\n // appendData with TypedArray will always do replace in provider.\n var val = data[i * dimSize + dim];\n arr[start + i] = val;\n val < min && (min = val);\n val > max && (max = val);\n }\n\n dimExtent[0] = min;\n dimExtent[1] = max;\n }\n };\n\n var countForTypedArray = function () {\n return this._data ? this._data.length / this._dimSize : 0;\n };\n\n providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n pure: true,\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n pure: true,\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n }, _a[SOURCE_FORMAT_ORIGINAL] = {\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n persistent: false,\n pure: true,\n appendData: function (newData) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n }\n\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }, _a);\n\n function appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n }\n }();\n\n return DefaultDataProvider;\n}();\n\nexport { DefaultDataProvider };\n\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx];\n};\n\nvar rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx + startIndex];\n}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\n idx += startIndex;\n var item = [];\n var data = rawData;\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item.push(row ? row[idx] : null);\n }\n\n return item;\n}, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\n var item = [];\n\n for (var i = 0; i < dimsDef.length; i++) {\n var dimName = dimsDef[i].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n item.push(col ? col[idx] : null);\n }\n\n return item;\n}, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar countSimply = function (rawData, startIndex, dimsDef) {\n return rawData.length;\n};\n\nvar rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n return Math.max(0, rawData.length - startIndex);\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n var row = rawData[0];\n return row ? Math.max(0, row.length - startIndex) : 0;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n var dimName = dimsDef[0].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n return col ? col.length : 0;\n}, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar getRawValueSimply = function (dataItem, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\n};\n\nvar rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimName] : dataItem;\n}, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\n // FIXME: In some case (markpoint in geo (geo-map.html)),\n // dataItem is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return dimIndex == null || !(value instanceof Array) ? value : value[dimIndex];\n}, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);\nexport function getRawSourceValueGetter(sourceFormat) {\n var method = rawSourceValueGetterMap[sourceFormat];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\n }\n\n return method;\n}\n\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n} // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\n\n\nexport function retrieveRawValue(data, dataIndex, dim // If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\n) {\n if (!data) {\n return;\n } // Consider data may be not persistent.\n\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (dataItem == null) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n var dimName;\n var dimIndex;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (dimInfo) {\n dimName = dimInfo.name;\n dimIndex = dimInfo.index;\n }\n\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\n}\n/**\n * Compatible with some cases (in pie, map) like:\n * data: [{name: 'xx', value: 5, selected: true}, ...]\n * where only sourceFormat is 'original' and 'objectRows' supported.\n *\n * // TODO\n * Supported detail options in data item when using 'arrayRows'.\n *\n * @param data\n * @param dataIndex\n * @param attr like 'selected'\n */\n\nexport function retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n\n if (dataItem) {\n return dataItem[attr];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { retrieveRawValue } from '../../data/helper/dataProvider';\nimport { formatTpl } from '../../util/format';\nimport { makePrintable } from '../../util/log';\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\n\nvar DataFormatMixin =\n/** @class */\nfunction () {\n function DataFormatMixin() {}\n /**\n * Get params for formatter\n */\n\n\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\n var data = this.getData(dataType);\n var rawValue = this.getRawValue(dataIndex, dataType);\n var rawDataIndex = data.getRawIndex(dataIndex);\n var name = data.getName(dataIndex);\n var itemOpt = data.getRawDataItem(dataIndex);\n var style = data.getItemVisual(dataIndex, 'style');\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\n var borderColor = style && style.stroke;\n var mainType = this.mainType;\n var isSeries = mainType === 'series';\n var userOutput = data.userOutput;\n return {\n componentType: mainType,\n componentSubType: this.subType,\n componentIndex: this.componentIndex,\n seriesType: isSeries ? this.subType : null,\n seriesIndex: this.seriesIndex,\n seriesId: isSeries ? this.id : null,\n seriesName: isSeries ? this.name : null,\n name: name,\n dataIndex: rawDataIndex,\n data: itemOpt,\n dataType: dataType,\n value: rawValue,\n color: color,\n borderColor: borderColor,\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\n encode: userOutput ? userOutput.encode : null,\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n $vars: ['seriesName', 'name', 'value']\n };\n };\n /**\n * Format label\n * @param dataIndex\n * @param status 'normal' by default\n * @param dataType\n * @param labelDimIndex Only used in some chart that\n * use formatter in different dimensions, like radar.\n * @param formatter Formatter given outside.\n * @return return null/undefined if no formatter\n */\n\n\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\n status = status || 'normal';\n var data = this.getData(dataType);\n var params = this.getDataParams(dataIndex, dataType);\n\n if (extendParams) {\n params.value = extendParams.interpolatedValue;\n }\n\n if (labelDimIndex != null && zrUtil.isArray(params.value)) {\n params.value = params.value[labelDimIndex];\n }\n\n if (!formatter) {\n var itemModel = data.getItemModel(dataIndex); // @ts-ignore\n\n formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']);\n }\n\n if (typeof formatter === 'function') {\n params.status = status;\n params.dimensionIndex = labelDimIndex;\n return formatter(params);\n } else if (typeof formatter === 'string') {\n var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'.\n // Do not support '}' in dim name util have to.\n\n return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) {\n var len = dimStr.length;\n var dimLoose = dimStr.charAt(0) === '[' && dimStr.charAt(len - 1) === ']' ? +dimStr.slice(1, len - 1) // Also support: '[]' => 0\n : dimStr;\n var val = retrieveRawValue(data, dataIndex, dimLoose);\n\n if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\n var dimInfo = data.getDimensionInfo(dimLoose);\n\n if (dimInfo) {\n val = extendParams.interpolatedValue[dimInfo.index];\n }\n }\n\n return val != null ? val + '' : '';\n });\n }\n };\n /**\n * Get raw value in option\n */\n\n\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\n return retrieveRawValue(this.getData(dataType), idx);\n };\n /**\n * Should be implemented.\n * @param {number} dataIndex\n * @param {boolean} [multipleSeries=false]\n * @param {string} [dataType]\n */\n\n\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // Empty function\n return;\n };\n\n return DataFormatMixin;\n}();\n\nexport { DataFormatMixin };\n; // PENDING: previously we accept this type when calling `formatTooltip`,\n// but guess little chance has been used outside. Do we need to backward\n// compat it?\n// type TooltipFormatResultLegacyObject = {\n// // `html` means the markup language text, either in 'html' or 'richText'.\n// // The name `html` is not appropriate becuase in 'richText' it is not a HTML\n// // string. But still support it for backward compat.\n// html: string;\n// markers: Dictionary<ColorString>;\n// };\n\n/**\n * For backward compat, normalize the return from `formatTooltip`.\n */\n\nexport function normalizeTooltipFormatResult(result // markersExisting: Dictionary<ColorString>\n) {\n var markupText; // let markers: Dictionary<ColorString>;\n\n var markupFragment;\n\n if (zrUtil.isObject(result)) {\n if (result.type) {\n markupFragment = result;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\n }\n } // else {\n // markupText = (result as TooltipFormatResultLegacyObject).html;\n // markers = (result as TooltipFormatResultLegacyObject).markers;\n // if (markersExisting) {\n // markers = zrUtil.merge(markersExisting, markers);\n // }\n // }\n\n } else {\n markupText = result;\n }\n\n return {\n markupText: markupText,\n // markers: markers || markersExisting,\n markupFragment: markupFragment\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray } from 'zrender/lib/core/util';\n;\n/**\n * @param {Object} define\n * @return See the return of `createTask`.\n */\n\nexport function createTask(define) {\n return new Task(define);\n}\n\nvar Task =\n/** @class */\nfunction () {\n function Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true;\n }\n /**\n * @param step Specified step.\n * @param skip Skip customer perform call.\n * @param modBy Sampling window size.\n * @param modDataCount Sampling count.\n * @return whether unfinished.\n */\n\n\n Task.prototype.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip; // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n\n var planResult;\n\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n } // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n\n\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n\n return val;\n }\n\n var forceFirstProgress;\n\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = this._doReset(skip);\n }\n\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n\n if (upTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(upTask._outputDueEnd != null);\n }\n\n this._dueEnd = upTask._outputDueEnd;\n } // DataTask or overallTask\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._progress || this._count);\n }\n\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n } // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n\n\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n this._doProgress(progress[i], start, end, modBy, modDataCount);\n }\n } else {\n this._doProgress(progress, start, end, modBy, modDataCount);\n }\n }\n\n this._dueIndex = end; // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n\n if (process.env.NODE_ENV !== 'production') {\n // ??? Can not rollback.\n assert(outputDueEnd >= this._outputDueEnd);\n }\n\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n\n return this.unfinished();\n };\n\n Task.prototype.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n };\n\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n this._callingProgress = progress;\n\n this._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, this.context);\n };\n\n Task.prototype._doReset = function (skip) {\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n this._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n\n if (!skip && this._reset) {\n progress = this._reset(this.context);\n\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n } // To simplify no progress checking, array must has item.\n\n\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n\n this._progress = progress;\n this._modBy = this._modDataCount = null;\n var downstream = this._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n };\n\n Task.prototype.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n };\n /**\n * @param downTask The downstream task.\n * @return The downstream task.\n */\n\n\n Task.prototype.pipe = function (downTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(downTask && !downTask._disposed && downTask !== this);\n } // If already downstream, do not dirty downTask.\n\n\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n };\n\n Task.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n };\n\n Task.prototype.getUpstream = function () {\n return this._upstream;\n };\n\n Task.prototype.getDownstream = function () {\n return this._downstream;\n };\n\n Task.prototype.setOutputEnd = function (end) {\n // This only happend in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the setted end, in case\n // that the stub of dataZoom perform again and earse the\n // setted end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n };\n\n return Task;\n}();\n\nexport { Task };\n\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}(); ///////////////////////////////////////////////////////////\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// let props = [];\n// if (task.__pipeline) {\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: '__idxInPipeline/total', value: val});\n// } else {\n// let stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// let args = ['color: blue'];\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: green', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n// const pipeline = task.__pipeline;\n// let currTask = pipeline.head;\n// while (currTask) {\n// window.printTask(currTask, prefix);\n// currTask = currTask._downstream;\n// }\n// };\n// window.showChain = function (chainHeadTask) {\n// var chain = [];\n// var task = chainHeadTask;\n// while (task) {\n// chain.push({\n// task: task,\n// up: task._upstream,\n// down: task._downstream,\n// idxInPipeline: task.__idxInPipeline\n// });\n// task = task._downstream;\n// }\n// return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n// let chain = window.showChain(chainHeadTask);\n// let result = [];\n// for (let i = 0; i < chain.length; i++) {\n// let chainItem = chain[i];\n// if (chainItem.task === task) {\n// result.push(i);\n// }\n// }\n// return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n// let chainA = window.showChain(chainHeadTaskA);\n// for (let i = 0; i < chainA.length; i++) {\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\n// }\n// };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/lib/core/util';\nvar ECHARTS_PREFIX = '[ECharts] ';\nvar storedLogs = {};\nvar hasConsole = typeof console !== 'undefined' // eslint-disable-next-line\n&& console.warn && console.log;\nexport function log(str) {\n if (hasConsole) {\n // eslint-disable-next-line\n console.log(ECHARTS_PREFIX + str);\n }\n}\nexport function warn(str) {\n if (hasConsole) {\n console.warn(ECHARTS_PREFIX + str);\n }\n}\nexport function error(str) {\n if (hasConsole) {\n console.error(ECHARTS_PREFIX + str);\n }\n}\nexport function deprecateLog(str) {\n if (process.env.NODE_ENV !== 'production') {\n if (storedLogs[str]) {\n // Not display duplicate message.\n return;\n }\n\n if (hasConsole) {\n storedLogs[str] = true;\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\n }\n }\n}\nexport function deprecateReplaceLog(oldOpt, newOpt, scope) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\n }\n}\nexport function consoleLog() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (process.env.NODE_ENV !== 'production') {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && console.log) {\n console.log.apply(console, args);\n }\n /* eslint-enable no-console */\n\n }\n}\n/**\n * If in __DEV__ environment, get console printable message for users hint.\n * Parameters are separated by ' '.\n * @usuage\n * makePrintable('This is an error on', someVar, someObj);\n *\n * @param hintInfo anything about the current execution context to hint users.\n * @throws Error\n */\n\nexport function makePrintable() {\n var hintInfo = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n hintInfo[_i] = arguments[_i];\n }\n\n var msg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Fuzzy stringify for print.\n // This code only exist in dev environment.\n var makePrintableStringIfPossible_1 = function (val) {\n return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null;\n };\n\n msg = map(hintInfo, function (arg) {\n if (isString(arg)) {\n // Print without quotation mark for some statement.\n return arg;\n } else {\n var printableStr = makePrintableStringIfPossible_1(arg);\n\n if (printableStr != null) {\n return printableStr;\n } else if (typeof JSON !== 'undefined' && JSON.stringify) {\n try {\n return JSON.stringify(arg, function (n, val) {\n var printableStr = makePrintableStringIfPossible_1(val);\n return printableStr == null ? val : printableStr;\n }); // In most cases the info object is small, so do not line break.\n } catch (err) {\n return '?';\n }\n } else {\n return '?';\n }\n }\n }).join(' ');\n }\n\n return msg;\n}\n/**\n * @throws Error\n */\n\nexport function throwError(msg) {\n throw new Error(msg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseDate, numericToNumber } from '../../util/number';\nimport { createHashMap, trim, hasOwn } from 'zrender/lib/core/util';\nimport { throwError } from '../../util/log';\n/**\n * Convert raw the value in to inner value in List.\n *\n * [Performance sensitive]\n *\n * [Caution]: this is the key logic of user value parser.\n * For backward compatibiliy, do not modify it until have to!\n */\n\nexport function parseDataValue(value, // For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n var ordinalMeta = opt && opt.ordinalMeta;\n return ordinalMeta ? ordinalMeta.parseAndCollect(value) : value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && typeof value !== 'number' && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have by defualt `numericToNumber`.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return typeof val === 'string' ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\n\nvar FilterOrderComparator =\n/** @class */\nfunction () {\n function FilterOrderComparator(op, rval) {\n if (typeof rval !== 'number') {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n\n throwError(errMsg);\n }\n\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return typeof lval === 'number' ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n\n return FilterOrderComparator;\n}();\n\nvar SortOrderComparator =\n/** @class */\nfunction () {\n /**\n * @param order by defualt: 'asc'\n * @param incomparable by defualt: Always on the tail.\n * That is, if 'asc' => 'max', if 'desc' => 'min'\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE]\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n } // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n\n\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalTypeof = typeof lval;\n var rvalTypeof = typeof rval;\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = lvalTypeof === 'string';\n var rvalIsStr = rvalTypeof === 'string';\n\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n\n return SortOrderComparator;\n}();\n\nexport { SortOrderComparator };\n\nvar FilterEqualityComparator =\n/** @class */\nfunction () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n\n return this._isEQ ? eqResult : !eqResult;\n };\n\n return FilterEqualityComparator;\n}();\n/**\n * [FILTER_COMPARISON_RULE]\n * `lt`|`lte`|`gt`|`gte`:\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\n * `eq`:\n * + If same type, compare with `===`.\n * + If there is one number, convert to number (`numericToNumber`) to compare.\n * + Else return `false`.\n * `ne`:\n * + Not `eq`.\n *\n *\n * [SORT_COMPARISON_RULE]\n * All the values are grouped into three categories:\n * + \"numeric\" (number and numeric string)\n * + \"non-numeric-string\" (string that excluding numeric string)\n * + \"others\"\n * \"numeric\" vs \"numeric\": values are ordered by number order.\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\n * \"others\" vs \"others\": do not change order (always return 0).\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\n * MEMO:\n * non-numeric string sort make sence when need to put the items with the same tag together.\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\n *\n *\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\n * + Do not support string comparison until required. And also need to\n * void the misleading of \"2\" > \"12\".\n * + Should avoid the misleading case:\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\n * See `util/number.ts#numericToNumber`.\n *\n * @return If `op` is not `RelationalOperator`, return null;\n */\n\n\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types';\nimport { normalizeToArray } from '../../util/model';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend } from 'zrender/lib/core/util';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider';\nimport { parseDataValue } from './dataValueHelper';\nimport { consoleLog, makePrintable, throwError } from '../../util/log';\nimport { createSource, detectSourceFormat } from '../Source';\n/**\n * TODO: disable writable.\n * This structure will be exposed to users.\n */\n\nvar ExternalSource =\n/** @class */\nfunction () {\n function ExternalSource() {}\n\n ExternalSource.prototype.getRawData = function () {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.cloneRawData = function () {\n return;\n };\n /**\n * @return If dimension not found, return null/undefined.\n */\n\n\n ExternalSource.prototype.getDimensionInfo = function (dim) {\n return;\n };\n /**\n * dimensions defined if and only if either:\n * (a) dataset.dimensions are declared.\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\n * the defined dimensions.\n * Otherwise, `dimensionInfoAll` is determined by data columns.\n * @return Always return an array (even empty array).\n */\n\n\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\n return;\n };\n\n ExternalSource.prototype.count = function () {\n return;\n };\n /**\n * Only support by dimension index.\n * No need to support by dimension name in transform function,\n * becuase transform function is not case-specific, no need to use name literally.\n */\n\n\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n return parseDataValue(rawVal, dimInfo);\n };\n\n return ExternalSource;\n}();\n\nexport { ExternalSource };\n\nfunction createExternalSource(internalSource, externalTransform) {\n var extSource = new ExternalSource();\n var data = internalSource.data;\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n var sourceHeaderCount = internalSource.startIndex;\n var errMsg = '';\n\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n // For the logic simplicity in transformer, only 'culumn' is\n // supported in data transform. Otherwise, the `dimensionsDefine`\n // might be detected by 'row', which probably confuses users.\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n }\n\n throwError(errMsg);\n } // [MEMO]\n // Create a new dimensions structure for exposing.\n // Do not expose all dimension info to users directly.\n // Becuase the dimension is probably auto detected from data and not might reliable.\n // Should not lead the transformers to think that is relialbe and return it.\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n\n\n var dimensions = [];\n var dimsByName = {};\n var dimsDef = internalSource.dimensionsDefine;\n\n if (dimsDef) {\n each(dimsDef, function (dimDef, idx) {\n var name = dimDef.name;\n var dimDefExt = {\n index: idx,\n name: name,\n displayName: dimDef.displayName\n };\n dimensions.push(dimDefExt); // Users probably not sepcify dimension name. For simplicity, data transform\n // do not generate dimension name.\n\n if (name != null) {\n // Dimension name should not be duplicated.\n // For simplicity, data transform forbid name duplication, do not generate\n // new name like module `completeDimensions.ts` did, but just tell users.\n var errMsg_1 = '';\n\n if (hasOwn(dimsByName, name)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n }\n\n throwError(errMsg_1);\n }\n\n dimsByName[name] = dimDefExt;\n }\n });\n } // If dimension definitions are not defined and can not be detected.\n // e.g., pure data `[[11, 22], ...]`.\n else {\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n // Do not generete name or anything others. The consequence process in\n // `transform` or `series` probably have there own name generation strategry.\n dimensions.push({\n index: i\n });\n }\n } // Implement public methods:\n\n\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n\n if (externalTransform.__isBuiltIn) {\n extSource.getRawDataItem = function (dataIndex) {\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n };\n\n extSource.getRawData = bind(getRawData, null, internalSource);\n }\n\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n\n extSource.retrieveValue = function (dataIndex, dimIndex) {\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n return retrieveValueFromItem(rawItem, dimIndex);\n };\n\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n if (dataItem == null) {\n return;\n }\n\n var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n\n if (dimDef) {\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\n }\n };\n\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n return extSource;\n}\n\nfunction getRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n return upstream.data;\n}\n\nfunction cloneRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n var data = upstream.data;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(data[i].slice());\n }\n\n return result;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(extend({}, data[i]));\n }\n\n return result;\n }\n}\n\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n if (dim == null) {\n return;\n } // Keep the same logic as `List::getDimension` did.\n\n\n if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n return dimensions[dim];\n } else if (hasOwn(dimsByName, dim)) {\n return dimsByName[dim];\n }\n}\n\nfunction cloneAllDimensionInfo(dimensions) {\n return clone(dimensions);\n}\n\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n externalTransform = clone(externalTransform);\n var type = externalTransform.type;\n var errMsg = '';\n\n if (!type) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have a `type` when `registerTransform`.';\n }\n\n throwError(errMsg);\n }\n\n var typeParsed = type.split(':');\n\n if (typeParsed.length !== 2) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Name must include namespace like \"ns:regression\".';\n }\n\n throwError(errMsg);\n } // Namespace 'echarts:xxx' is official namespace, where the transforms should\n // be called directly via 'xxx' rather than 'echarts:xxx'.\n\n\n var isBuiltIn = false;\n\n if (typeParsed[0] === 'echarts') {\n type = typeParsed[1];\n isBuiltIn = true;\n }\n\n externalTransform.__isBuiltIn = isBuiltIn;\n externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n var pipedTransOption = normalizeToArray(rawTransOption);\n var pipeLen = pipedTransOption.length;\n var errMsg = '';\n\n if (!pipeLen) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'If `transform` declared, it should at least contain one transform.';\n }\n\n throwError(errMsg);\n }\n\n for (var i = 0, len = pipeLen; i < len; i++) {\n var transOption = pipedTransOption[i];\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one.\n // piped transform only support single output, except the last one.\n\n if (i !== len - 1) {\n sourceList.length = Math.max(sourceList.length, 1);\n }\n }\n\n return sourceList;\n}\n\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, // If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n var errMsg = '';\n\n if (!upSourceList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have at least one upstream dataset.';\n }\n\n throwError(errMsg);\n }\n\n if (!isObject(transOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n }\n\n throwError(errMsg);\n }\n\n var transType = transOption.type;\n var externalTransform = externalTransformMap.get(transType);\n\n if (!externalTransform) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not find transform on type \"' + transType + '\".';\n }\n\n throwError(errMsg);\n } // Prepare source\n\n\n var extUpSourceList = map(upSourceList, function (upSource) {\n return createExternalSource(upSource, externalTransform);\n });\n var resultList = normalizeToArray(externalTransform.transform({\n upstream: extUpSourceList[0],\n upstreamList: extUpSourceList,\n config: clone(transOption.config)\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n if (transOption.print) {\n var printStrArr = map(resultList, function (extSource) {\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n }).join('\\n');\n consoleLog(printStrArr);\n }\n }\n\n return map(resultList, function (result, resultIndex) {\n var errMsg = '';\n\n if (!isObject(result)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'A transform should not return some empty results.';\n }\n\n throwError(errMsg);\n }\n\n if (!result.data) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be not be null or undefined';\n }\n\n throwError(errMsg);\n }\n\n var sourceFormat = detectSourceFormat(result.data);\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be array rows or object rows.';\n }\n\n throwError(errMsg);\n }\n\n var resultMetaRawOption;\n var firstUpSource = upSourceList[0];\n /**\n * Intuitively, the end users known the content of the original `dataset.source`,\n * calucating the transform result in mind.\n * Suppose the original `dataset.source` is:\n * ```js\n * [\n * ['product', '2012', '2013', '2014', '2015'],\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\n * ]\n * ```\n * The dimension info have to be detected from the source data.\n * Some of the transformers (like filter, sort) will follow the dimension info\n * of upstream, while others use new dimensions (like aggregate).\n * Transformer can output a field `dimensions` to define the its own output dimensions.\n * We also allow transformers to ignore the output `dimensions` field, and\n * inherit the upstream dimensions definition. It can reduce the burden of handling\n * dimensions in transformers.\n *\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n */\n\n if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different\n // dimensions definitions. We do not inherit anything from upstream.\n && !result.dimensions) {\n var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result becuase:\n // (1) The returned data always does not contain header line and can not be used\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n // So the original detected header should be add to the result, otherwise they can not be read.\n\n if (startIndex) {\n result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n }\n\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: startIndex,\n dimensions: firstUpSource.metaRawOption.dimensions\n };\n } else {\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: 0,\n dimensions: result.dimensions\n };\n }\n\n return createSource(result.data, resultMetaRawOption, null, null);\n });\n}\n\nfunction isSupportedSourceFormat(sourceFormat) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util';\nimport { createSource, cloneSourceShallow } from '../Source';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper';\nimport { applyDataTransform } from './transform';\n/**\n * [REQUIREMENT_MEMO]:\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\n * `root-dataset`. Them on `series` has higher priority.\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\n * confuse users: whether those props indicate how to visit the upstream source or visit\n * the transform result source, and some transforms has nothing to do with these props,\n * and some transforms might have multiple upstream.\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\n * declared in `root-dataset`.\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\n * That is for reducing complexity in transfroms.\n * PENDING: Whether to provide transposition transform?\n *\n * [IMPLEMENTAION_MEMO]:\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\n * They will not be calculated until `source` is about to be visited (to prevent from\n * duplicate calcuation). `source` is visited only in series and input to transforms.\n *\n * [DIMENSION_INHERIT_RULE]:\n * By default the dimensions are inherited from ancestors, unless a transform return\n * a new dimensions definition.\n * Consider the case:\n * ```js\n * dataset: [{\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * dataset: [{\n * dimension: ['Product', 'Sales', 'Prise'],\n * source: [ ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * ```\n * The two types of option should have the same behavior after transform.\n *\n *\n * [SCENARIO]:\n * (1) Provide source data directly:\n * ```js\n * series: {\n * encode: {...},\n * dimensions: [...]\n * seriesLayoutBy: 'row',\n * data: [[...]]\n * }\n * ```\n * (2) Series refer to dataset.\n * ```js\n * series: [{\n * encode: {...}\n * // Ignore datasetIndex means `datasetIndex: 0`\n * // and the dimensions defination in dataset is used\n * }, {\n * encode: {...},\n * seriesLayoutBy: 'column',\n * datasetIndex: 1\n * }]\n * ```\n * (3) dataset transform\n * ```js\n * dataset: [{\n * source: [...]\n * }, {\n * source: [...]\n * }, {\n * // By default from 0.\n * transform: { type: 'filter', config: {...} }\n * }, {\n * // Piped.\n * transform: [\n * { type: 'filter', config: {...} },\n * { type: 'sort', config: {...} }\n * ]\n * }, {\n * id: 'regressionData',\n * fromDatasetIndex: 1,\n * // Third-party transform\n * transform: { type: 'ecStat:regression', config: {...} }\n * }, {\n * // retrieve the extra result.\n * id: 'regressionFormula',\n * fromDatasetId: 'regressionData',\n * fromTransformResult: 1\n * }]\n * ```\n */\n\nvar SourceManager =\n/** @class */\nfunction () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = []; // version sign of each upstream source manager.\n\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._sourceHost = sourceHost;\n }\n /**\n * Mark dirty.\n */\n\n\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n };\n\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\n * For detecting whether the upstream source is dirty, so that\n * the local cached source (in `_sourceList`) should be discarded.\n */\n\n\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\n * Always return a source instance. Otherwise throw error.\n */\n\n\n SourceManager.prototype.prepareSource = function () {\n // For the case that call `setOption` multiple time but no data changed,\n // cache the result source to prevent from repeating transform.\n if (this._isDirty()) {\n this._createSource();\n }\n };\n\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n\n var sourceHost = this._sourceHost;\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0; // Has upstream dataset\n\n if (hasUpstream) {\n var upSourceMgr = upSourceMgrList[0];\n upSourceMgr.prepareSource();\n upSource = upSourceMgr.getSource();\n data = upSource.data;\n sourceFormat = upSource.sourceFormat;\n upstreamSignList = [upSourceMgr._getVersionSign()];\n } // Series data is from own.\n else {\n data = seriesModel.get('data', true);\n sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n upstreamSignList = [];\n } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n\n\n var newMetaRawOption = this._getSourceMetaRawOption();\n\n var upMetaRawOption = upSource ? upSource.metaRawOption : null;\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption ? upMetaRawOption.seriesLayoutBy : null);\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption ? upMetaRawOption.sourceHeader : null); // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n // but series need `seriesLayoutBy: 'row'`.\n\n var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption ? upMetaRawOption.dimensions : null);\n resultSourceList = [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat, seriesModel.get('encode', true))];\n } else {\n var datasetModel = sourceHost; // Has upstream dataset.\n\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n } // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, // Note: dataset option does not have `encode`.\n null)];\n upstreamSignList = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n\n this._setLocalSource(resultSourceList, upstreamSignList);\n };\n\n SourceManager.prototype._applyTransform = function (upMgrList) {\n var datasetModel = this._sourceHost;\n var transformOption = datasetModel.get('transform', true);\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n\n if (fromTransformResult != null) {\n var errMsg = '';\n\n if (upMgrList.length !== 1) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n }\n\n doThrow(errMsg);\n }\n }\n\n var sourceList;\n var upSourceList = [];\n var upstreamSignList = [];\n each(upMgrList, function (upMgr) {\n upMgr.prepareSource();\n var upSource = upMgr.getSource(fromTransformResult || 0);\n var errMsg = '';\n\n if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n\n doThrow(errMsg);\n }\n\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\n });\n\n if (transformOption) {\n sourceList = applyDataTransform(transformOption, upSourceList, {\n datasetIndex: datasetModel.componentIndex\n });\n } else if (fromTransformResult != null) {\n sourceList = [cloneSourceShallow(upSourceList[0])];\n }\n\n return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n\n SourceManager.prototype._isDirty = function () {\n var sourceList = this._sourceList;\n\n if (!sourceList.length) {\n return true;\n } // All sourceList is from the some upsteam.\n\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n\n if ( // Consider the case that there is ancestor diry, call it recursively.\n // The performance is probably not an issue because usually the chain is not long.\n upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n return true;\n }\n }\n };\n /**\n * @param sourceIndex By defualt 0, means \"main source\".\n * Most cases there is only one source.\n */\n\n\n SourceManager.prototype.getSource = function (sourceIndex) {\n return this._sourceList[sourceIndex || 0];\n };\n /**\n * PEDING: Is it fast enough?\n * If no upstream, return empty array.\n */\n\n\n SourceManager.prototype._getUpstreamSourceManagers = function () {\n // Always get the relationship from the raw option.\n // Do not cache the link of the dependency graph, so that\n // no need to update them when change happen.\n var sourceHost = this._sourceHost;\n\n if (isSeries(sourceHost)) {\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\n } else {\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n return datasetModel.getSourceManager();\n });\n }\n };\n\n SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n else if (!this._getUpstreamSourceManagers().length) {\n var model = sourceHost;\n seriesLayoutBy = model.get('seriesLayoutBy', true);\n sourceHeader = model.get('sourceHeader', true);\n dimensions = model.get('dimensions', true);\n }\n\n return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n\n return SourceManager;\n}();\n\nexport { SourceManager }; // Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transfrom clone from rawOption.\n\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\n\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\n\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getTooltipMarker, encodeHTML, makeValueReadable, convertToColorString } from '../../util/format';\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/lib/core/util';\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper';\nimport { getRandomIdBase } from '../../util/number';\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; // TODO: more textStyle option\n\nfunction getTooltipTextStyle(textStyle, renderMode) {\n var nameFontColor = textStyle.color || '#6e7079';\n var nameFontSize = textStyle.fontSize || 12;\n var nameFontWeight = textStyle.fontWeight || '400';\n var valueFontColor = textStyle.color || '#464646';\n var valueFontSize = textStyle.fontSize || 14;\n var valueFontWeight = textStyle.fontWeight || '900';\n\n if (renderMode === 'html') {\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\n return {\n // eslint-disable-next-line max-len\n nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n // eslint-disable-next-line max-len\n valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n };\n } else {\n return {\n nameStyle: {\n fontSize: nameFontSize,\n fill: nameFontColor,\n fontWeight: nameFontWeight\n },\n valueStyle: {\n fontSize: valueFontSize,\n fill: valueFontColor,\n fontWeight: valueFontWeight\n }\n };\n }\n} // See `TooltipMarkupLayoutIntent['innerGapLevel']`.\n// (value from UI design)\n\n\nvar HTML_GAPS = [0, 10, 20, 30];\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n']; // eslint-disable-next-line max-len\n\nexport function createTooltipMarkup(type, option) {\n option.type = type;\n return option;\n}\n\nfunction getBuilder(fragment) {\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\n}\n\nvar builderMap = {\n /**\n * A `section` block is like:\n * ```\n * header\n * subBlock\n * subBlock\n * ...\n * ```\n */\n section: {\n planLayout: function (fragment) {\n var subBlockLen = fragment.blocks.length;\n var thisBlockHasInnerGap = subBlockLen > 1 || subBlockLen > 0 && !fragment.noHeader;\n var thisGapLevelBetweenSubBlocks = 0;\n each(fragment.blocks, function (subBlock) {\n getBuilder(subBlock).planLayout(subBlock);\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks; // If the some of the sub-blocks have some gaps (like 10px) inside, this block\n // should use a larger gap (like 20px) to distinguish those sub-blocks.\n\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\n thisGapLevelBetweenSubBlocks = subGapLevel + (thisBlockHasInnerGap && ( // 0 always can not be readable gap level.\n !subGapLevel // If no header, always keep the sub gap level. Otherwise\n // look weird in case `multipleSeries`.\n || subBlock.type === 'section' && !subBlock.noHeader) ? 1 : 0);\n }\n });\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\n },\n build: function (ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var noHeader = fragment.noHeader;\n var gaps = getGap(fragment);\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html, toolTipTextStyle);\n\n if (noHeader) {\n return subMarkupText;\n }\n\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\n var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;\n\n if (ctx.renderMode === 'richText') {\n return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;\n } else {\n return wrapBlockHTML(\"<div style=\\\"\" + nameStyle + \";\" + TOOLTIP_LINE_HEIGHT_CSS + \";\\\">\" + encodeHTML(displayableHeader) + '</div>' + subMarkupText, topMarginForOuterGap);\n }\n }\n },\n\n /**\n * A `nameValue` block is like:\n * ```\n * marker name value\n * ```\n */\n nameValue: {\n planLayout: function (fragment) {\n fragment.__gapLevelBetweenSubBlocks = 0;\n },\n build: function (ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var renderMode = ctx.renderMode;\n var noName = fragment.noName;\n var noValue = fragment.noValue;\n var noMarker = !fragment.markerType;\n var name = fragment.name;\n var value = fragment.value;\n var useUTC = ctx.useUTC;\n\n if (noName && noValue) {\n return;\n }\n\n var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\n var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC);\n var valueTypeOption = fragment.valueType;\n var readableValueList = noValue ? [] : isArray(value) ? map(value, function (val, idx) {\n return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);\n }) : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)];\n var valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker.\n\n var valueCloseToMarker = !noMarker && noName;\n\n var _a = getTooltipTextStyle(toolTipTextStyle, renderMode),\n nameStyle = _a.nameStyle,\n valueStyle = _a.valueStyle;\n\n return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) // Value has commas inside, so use ' ' as delimiter for multiple values.\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);\n }\n }\n};\n\nfunction buildSubBlocks(ctx, fragment, topMarginForOuterGap, tooltipTextStyle) {\n var subMarkupTextList = [];\n var subBlocks = fragment.blocks || [];\n assert(!subBlocks || isArray(subBlocks));\n subBlocks = subBlocks || [];\n var orderMode = ctx.orderMode;\n\n if (fragment.sortBlocks && orderMode) {\n subBlocks = subBlocks.slice();\n var orderMap = {\n valueAsc: 'asc',\n valueDesc: 'desc'\n };\n\n if (hasOwn(orderMap, orderMode)) {\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\n subBlocks.sort(function (a, b) {\n return comparator_1.evaluate(a.sortParam, b.sortParam);\n });\n } // FIXME 'seriesDesc' necessary?\n else if (orderMode === 'seriesDesc') {\n subBlocks.reverse();\n }\n }\n\n var gaps = getGap(fragment);\n each(subBlocks, function (subBlock, idx) {\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0, tooltipTextStyle);\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\n });\n\n if (!subMarkupTextList.length) {\n return;\n }\n\n return ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\n}\n/**\n * @return markupText. null/undefined means no content.\n */\n\n\nexport function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {\n if (!fragment) {\n return;\n }\n\n var builder = getBuilder(fragment);\n builder.planLayout(fragment);\n var ctx = {\n useUTC: useUTC,\n renderMode: renderMode,\n orderMode: orderMode,\n markupStyleCreator: markupStyleCreator\n };\n return builder.build(ctx, fragment, 0, toolTipTextStyle);\n}\n\nfunction getGap(fragment) {\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\n return {\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\n };\n}\n\nfunction wrapBlockHTML(encodedContent, topGap) {\n var clearfix = '<div style=\"clear:both\"></div>';\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\n return \"<div style=\\\"\" + marginCSS + \";\" + TOOLTIP_LINE_HEIGHT_CSS + \";\\\">\" + encodedContent + clearfix + '</div>';\n}\n\nfunction wrapInlineNameHTML(name, leftHasMarker, style) {\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\n return \"<span style=\\\"\" + style + \";\" + marginCss + \"\\\">\" + encodeHTML(name) + '</span>';\n}\n\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {\n // Do not too close to marker, considering there are multiple values separated by spaces.\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\n return \"<span style=\\\"\" + alignCSS + \";\" + style + \"\\\">\" // Value has commas inside, so use ' ' as delimiter for multiple values.\n + map(valueList, function (value) {\n return encodeHTML(value);\n }).join(' ') + '</span>';\n}\n\nfunction wrapInlineNameRichText(ctx, name, style) {\n return ctx.markupStyleCreator.wrapRichTextStyle(name, style);\n}\n\nfunction wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker, style) {\n var styles = [style];\n var paddingLeft = valueCloseToMarker ? 10 : 20;\n alignRight && styles.push({\n padding: [0, 0, 0, paddingLeft],\n align: 'right'\n }); // Value has commas inside, so use ' ' as delimiter for multiple values.\n\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\n}\n\nexport function retrieveVisualColorForTooltipMarker(series, dataIndex) {\n var style = series.getData().getItemVisual(dataIndex, 'style');\n var color = style[series.visualDrawType];\n return convertToColorString(color);\n}\nexport function getPaddingFromTooltipModel(model, renderMode) {\n var padding = model.get('padding');\n return padding != null ? padding // We give slightly different to look pretty.\n : renderMode === 'richText' ? [8, 10] : 10;\n}\n/**\n * The major feature is generate styles for `renderMode: 'richText'`.\n * But it also serves `renderMode: 'html'` to provide\n * \"renderMode-independent\" API.\n */\n\nvar TooltipMarkupStyleCreator =\n/** @class */\nfunction () {\n function TooltipMarkupStyleCreator() {\n this.richTextStyles = {}; // Notice that \"generate a style name\" usuall happens repeatly when mouse moving and\n // displaying a tooltip. So we put the `_nextStyleNameId` as a member of each creator\n // rather than static shared by all creators (which will cause it increase to fast).\n\n this._nextStyleNameId = getRandomIdBase();\n }\n\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\n return '__EC_aUTo_' + this._nextStyleNameId++;\n };\n\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\n var markerId = renderMode === 'richText' ? this._generateStyleName() : null;\n var marker = getTooltipMarker({\n color: colorStr,\n type: markerType,\n renderMode: renderMode,\n markerId: markerId\n });\n\n if (isString(marker)) {\n return marker;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(markerId);\n }\n\n this.richTextStyles[markerId] = marker.style;\n return marker.content;\n }\n };\n /**\n * @usage\n * ```ts\n * const styledText = markupStyleCreator.wrapRichTextStyle([\n * // The styles will be auto merged.\n * {\n * fontSize: 12,\n * color: 'blue'\n * },\n * {\n * padding: 20\n * }\n * ]);\n * ```\n */\n\n\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\n var finalStl = {};\n\n if (isArray(styles)) {\n each(styles, function (stl) {\n return extend(finalStl, stl);\n });\n } else {\n extend(finalStl, styles);\n }\n\n var styleName = this._generateStyleName();\n\n this.richTextStyles[styleName] = finalStl;\n return \"{\" + styleName + \"|\" + text + \"}\";\n };\n\n return TooltipMarkupStyleCreator;\n}();\n\nexport { TooltipMarkupStyleCreator };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { trim, isArray, each, reduce } from 'zrender/lib/core/util';\nimport { retrieveVisualColorForTooltipMarker, createTooltipMarkup } from './tooltipMarkup';\nimport { retrieveRawValue } from '../../data/helper/dataProvider';\nimport { isNameSpecified } from '../../util/model';\nexport function defaultSeriesFormatTooltip(opt) {\n var series = opt.series;\n var dataIndex = opt.dataIndex;\n var multipleSeries = opt.multipleSeries;\n var data = series.getData();\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\n var tooltipDimLen = tooltipDims.length;\n var value = series.getRawValue(dataIndex);\n var isValueArr = isArray(value);\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); // Complicated rule for pretty tooltip.\n\n var inlineValue;\n var inlineValueType;\n var subBlocks;\n var sortParam;\n\n if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\n inlineValue = formatArrResult.inlineValues;\n inlineValueType = formatArrResult.inlineValueTypes;\n subBlocks = formatArrResult.blocks; // Only support tooltip sort by the first inline value. It's enough in most cases.\n\n sortParam = formatArrResult.inlineValues[0];\n } else if (tooltipDimLen) {\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\n inlineValueType = dimInfo.type;\n } else {\n sortParam = inlineValue = isValueArr ? value[0] : value;\n } // Do not show generated series name. It might not be readable.\n\n\n var seriesNameSpecified = isNameSpecified(series);\n var seriesName = seriesNameSpecified && series.name || '';\n var itemName = data.getName(dataIndex);\n var inlineName = multipleSeries ? seriesName : itemName;\n return createTooltipMarkup('section', {\n header: seriesName,\n // When series name not specified, do not show a header line with only '-'.\n // This case alway happen in tooltip.trigger: 'item'.\n noHeader: multipleSeries || !seriesNameSpecified,\n sortParam: sortParam,\n blocks: [createTooltipMarkup('nameValue', {\n markerType: 'item',\n markerColor: markerColor,\n // Do not mix display seriesName and itemName in one tooltip,\n // which might confuses users.\n name: inlineName,\n // name dimension might be auto assigned, where the name might\n // be not readable. So we check trim here.\n noName: !trim(inlineName),\n value: inlineValue,\n valueType: inlineValueType\n })].concat(subBlocks || [])\n });\n}\n\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\n // check: category-no-encode-has-axis-data in dataset.html\n var data = series.getData();\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\n var dimItem = data.getDimensionInfo(idx);\n return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n }, false);\n var inlineValues = [];\n var inlineValueTypes = [];\n var blocks = [];\n tooltipDims.length ? each(tooltipDims, function (dim) {\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n }) // By default, all dims is used on tooltip.\n : each(value, setEachItem);\n\n function setEachItem(val, dim) {\n var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip.\n\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n return;\n }\n\n if (isValueMultipleLine) {\n blocks.push(createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: colorStr,\n name: dimInfo.displayName,\n value: val,\n valueType: dimInfo.type\n }));\n } else {\n inlineValues.push(val);\n inlineValueTypes.push(dimInfo.type);\n }\n }\n\n return {\n inlineValues: inlineValues,\n inlineValueTypes: inlineValueTypes,\n blocks: blocks\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends, __spreadArrays } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport * as modelUtil from '../util/model';\nimport ComponentModel from './Component';\nimport { PaletteMixin } from './mixin/palette';\nimport { DataFormatMixin } from '../model/mixin/dataFormat';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout';\nimport { createTask } from '../core/task';\nimport { mountExtend } from '../util/clazz';\nimport { SourceManager } from '../data/helper/sourceManager';\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip';\nvar inner = modelUtil.makeInner();\n\nfunction getSelectionKey(data, dataIndex) {\n return data.getName(dataIndex) || data.getId(dataIndex);\n}\n\nvar SeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SeriesModel, _super);\n\n function SeriesModel() {\n // [Caution]: Becuase this class or desecendants can be used as `XXX.extend(subProto)`,\n // the class members must not be initialized in constructor or declaration place.\n // Otherwise there is bad case:\n // class A {xxx = 1;}\n // enableClassExtend(A);\n // class B extends A {}\n // var C = B.extend({xxx: 5});\n // var c = new C();\n // console.log(c.xxx); // expect 5 but always 1.\n var _this = _super !== null && _super.apply(this, arguments) || this; // ---------------------------------------\n // Props about data selection\n // ---------------------------------------\n\n\n _this._selectedDataIndicesMap = {};\n return _this;\n }\n\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\n this.seriesIndex = this.componentIndex;\n this.dataTask = createTask({\n count: dataTaskCount,\n reset: dataTaskReset\n });\n this.dataTask.context = {\n model: this\n };\n this.mergeDefaultAndTheme(option, ecModel);\n var sourceManager = inner(this).sourceManager = new SourceManager(this);\n sourceManager.prepareSource();\n var data = this.getInitialData(option, ecModel);\n wrapData(data, this);\n this.dataTask.context.data = data;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(data, 'getInitialData returned invalid data.');\n }\n\n inner(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make\n // dataBeforeProcessed by cloneShallow), cloneShallow will\n // cause data.graph.data !== data when using\n // module:echarts/data/Graph or module:echarts/data/Tree.\n // See module:echarts/data/helper/linkList\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n // init or merge stage, because the data can be restored. So we do not `restoreData`\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n // Call `seriesModel.getRawData()` instead.\n // this.restoreData();\n\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n /**\n * Util for merge default and theme to option\n */\n\n\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme.\n // But if name duplicate between series subType\n // (for example: parallel) add component mainType,\n // add suffix 'Series'.\n\n var themeSubType = this.subType;\n\n if (ComponentModel.hasClass(themeSubType)) {\n themeSubType += 'Series';\n }\n\n zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n zrUtil.merge(option, this.getDefaultOption()); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n this.fillDataTextStyle(option.data);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\n // this.settingTask.dirty();\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n this.fillDataTextStyle(newSeriesOption.data);\n var layoutMode = fetchLayoutMode(this);\n\n if (layoutMode) {\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n }\n\n var sourceManager = inner(this).sourceManager;\n sourceManager.dirty();\n sourceManager.prepareSource();\n var data = this.getInitialData(newSeriesOption, ecModel);\n wrapData(data, this);\n this.dataTask.dirty();\n this.dataTask.context.data = data;\n inner(this).dataBeforeProcessed = data;\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n\n SeriesModel.prototype.fillDataTextStyle = function (data) {\n // Default data label emphasis `show`\n // FIXME Tree structure data ?\n // FIXME Performance ?\n if (data && !zrUtil.isTypedArray(data)) {\n var props = ['show'];\n\n for (var i = 0; i < data.length; i++) {\n if (data[i] && data[i].label) {\n modelUtil.defaultEmphasis(data[i], 'label', props);\n }\n }\n }\n };\n /**\n * Init a data structure from data related option in series\n * Must be overriden.\n */\n\n\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\n return;\n };\n /**\n * Append data to list\n */\n\n\n SeriesModel.prototype.appendData = function (params) {\n // FIXME ???\n // (1) If data from dataset, forbidden append.\n // (2) support append data of dataset.\n var data = this.getRawData();\n data.appendData(params.data);\n };\n /**\n * Consider some method like `filter`, `map` need make new data,\n * We should make sure that `seriesModel.getData()` get correct\n * data in the stream procedure. So we fetch data from upstream\n * each time `task.perform` called.\n */\n\n\n SeriesModel.prototype.getData = function (dataType) {\n var task = getCurrentTask(this);\n\n if (task) {\n var data = task.context.data;\n return dataType == null ? data : data.getLinkedData(dataType);\n } else {\n // When series is not alive (that may happen when click toolbox\n // restore or setOption with not merge mode), series data may\n // be still need to judge animation or something when graphic\n // elements want to know whether fade out.\n return inner(this).data;\n }\n };\n\n SeriesModel.prototype.getAllData = function () {\n var mainData = this.getData();\n return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{\n data: mainData\n }];\n };\n\n SeriesModel.prototype.setData = function (data) {\n var task = getCurrentTask(this);\n\n if (task) {\n var context = task.context; // Consider case: filter, data sample.\n // FIXME:TS never used, so comment it\n // if (context.data !== data && task.modifyOutputEnd) {\n // task.setOutputEnd(data.count());\n // }\n\n context.outputData = data; // Caution: setData should update context.data,\n // Because getData may be called multiply in a\n // single stage and expect to get the data just\n // set. (For example, AxisProxy, x y both call\n // getData and setDate sequentially).\n // So the context.data should be fetched from\n // upstream each time when a stage starts to be\n // performed.\n\n if (task !== this.dataTask) {\n context.data = data;\n }\n }\n\n inner(this).data = data;\n };\n\n SeriesModel.prototype.getSource = function () {\n return inner(this).sourceManager.getSource();\n };\n /**\n * Get data before processed\n */\n\n\n SeriesModel.prototype.getRawData = function () {\n return inner(this).dataBeforeProcessed;\n };\n /**\n * Get base axis if has coordinate system and has axis.\n * By default use coordSys.getBaseAxis();\n * Can be overrided for some chart.\n * @return {type} description\n */\n\n\n SeriesModel.prototype.getBaseAxis = function () {\n var coordSys = this.coordinateSystem; // @ts-ignore\n\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n };\n /**\n * Default tooltip formatter\n *\n * @param dataIndex\n * @param multipleSeries\n * @param dataType\n * @param renderMode valid values: 'html'(by default) and 'richText'.\n * 'html' is used for rendering tooltip in extra DOM form, and the result\n * string is used as DOM HTML content.\n * 'richText' is used for rendering tooltip in rich text form, for those where\n * DOM operation is not supported.\n * @return formatted tooltip with `html` and `markers`\n * Notice: The override method can also return string\n */\n\n\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n return defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n };\n\n SeriesModel.prototype.isAnimationEnabled = function () {\n if (env.node) {\n return false;\n }\n\n var animationEnabled = this.getShallow('animation');\n\n if (animationEnabled) {\n if (this.getData().count() > this.getShallow('animationThreshold')) {\n animationEnabled = false;\n }\n }\n\n return !!animationEnabled;\n };\n\n SeriesModel.prototype.restoreData = function () {\n this.dataTask.dirty();\n };\n\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\n var ecModel = this.ecModel; // PENDING\n\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\n\n if (!color) {\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n }\n\n return color;\n };\n /**\n * Use `data.mapDimensionsAll(coordDim)` instead.\n * @deprecated\n */\n\n\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\n return this.getRawData().mapDimensionsAll(coordDim);\n };\n /**\n * Get progressive rendering count each step\n */\n\n\n SeriesModel.prototype.getProgressive = function () {\n return this.get('progressive');\n };\n /**\n * Get progressive rendering count each step\n */\n\n\n SeriesModel.prototype.getProgressiveThreshold = function () {\n return this.get('progressiveThreshold');\n }; // PENGING If selectedMode is null ?\n\n\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\n this._innerSelect(this.getData(dataType), innerDataIndices);\n };\n\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return;\n }\n\n var data = this.getData(dataType);\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n var dataIndex = innerDataIndices[i];\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = false;\n this._selectedDataIndicesMap[nameOrId] = -1;\n }\n };\n\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\n var tmpArr = [];\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n tmpArr[0] = innerDataIndices[i];\n this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType);\n }\n };\n\n SeriesModel.prototype.getSelectedDataIndices = function () {\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\n var nameOrIds = zrUtil.keys(selectedDataIndicesMap);\n var dataIndices = [];\n\n for (var i = 0; i < nameOrIds.length; i++) {\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\n\n if (dataIndex >= 0) {\n dataIndices.push(dataIndex);\n }\n }\n\n return dataIndices;\n };\n\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return false;\n }\n\n var data = this.getData(dataType);\n var nameOrId = getSelectionKey(data, dataIndex);\n return selectedMap[nameOrId] || false;\n };\n\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\n var _a, _b;\n\n var selectedMode = this.option.selectedMode;\n var len = innerDataIndices.length;\n\n if (!selectedMode || !len) {\n return;\n }\n\n if (selectedMode === 'multiple') {\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\n\n for (var i = 0; i < len; i++) {\n var dataIndex = innerDataIndices[i]; // TODO diffrent types of data share same object.\n\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = true;\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\n }\n } else if (selectedMode === 'single' || selectedMode === true) {\n var lastDataIndex = innerDataIndices[len - 1];\n var nameOrId = getSelectionKey(data, lastDataIndex);\n this.option.selectedMap = (_a = {}, _a[nameOrId] = true, _a);\n this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b);\n }\n };\n\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\n // Ignore select info in data if selectedMap exists.\n // NOTE It's only for legacy usage. edge data is not supported.\n if (this.option.selectedMap) {\n return;\n }\n\n var dataIndices = [];\n\n if (data.hasItemOption) {\n data.each(function (idx) {\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem.selected) {\n dataIndices.push(idx);\n }\n });\n }\n\n if (dataIndices.length > 0) {\n this._innerSelect(data, dataIndices);\n }\n }; // /**\n // * @see {module:echarts/stream/Scheduler}\n // */\n // abstract pipeTask: null\n\n\n SeriesModel.registerClass = function (clz) {\n return ComponentModel.registerClass(clz);\n };\n\n SeriesModel.protoInitialize = function () {\n var proto = SeriesModel.prototype;\n proto.type = 'series.__base__';\n proto.seriesIndex = 0;\n proto.useColorPaletteOnData = false;\n proto.ignoreStyleOnData = false;\n proto.hasSymbolVisual = false;\n proto.defaultSymbol = 'circle'; // Make sure the values can be accessed!\n\n proto.visualStyleAccessPath = 'itemStyle';\n proto.visualDrawType = 'fill';\n }();\n\n return SeriesModel;\n}(ComponentModel);\n\nzrUtil.mixin(SeriesModel, DataFormatMixin);\nzrUtil.mixin(SeriesModel, PaletteMixin);\nmountExtend(SeriesModel, ComponentModel);\n/**\n * MUST be called after `prepareSource` called\n * Here we need to make auto series, especially for auto legend. But we\n * do not modify series.name in option to avoid side effects.\n */\n\nfunction autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}\n\nfunction getSeriesAutoName(seriesModel) {\n var data = seriesModel.getRawData();\n var dataDims = data.mapDimensionsAll('seriesName');\n var nameArr = [];\n zrUtil.each(dataDims, function (dataDim) {\n var dimInfo = data.getDimensionInfo(dataDim);\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\n });\n return nameArr.join(' ');\n}\n\nfunction dataTaskCount(context) {\n return context.model.getRawData().count();\n}\n\nfunction dataTaskReset(context) {\n var seriesModel = context.model;\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\n return dataTaskProgress;\n}\n\nfunction dataTaskProgress(param, context) {\n // Avoid repead cloneShallow when data just created in reset.\n if (context.outputData && param.end > context.outputData.count()) {\n context.model.getRawData().cloneShallow(context.outputData);\n }\n} // TODO refactor\n\n\nfunction wrapData(data, seriesModel) {\n zrUtil.each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(onDataChange, seriesModel));\n });\n}\n\nfunction onDataChange(seriesModel, newList) {\n var task = getCurrentTask(seriesModel);\n\n if (task) {\n // Consider case: filter, selectRange\n task.setOutputEnd((newList || this).count());\n }\n\n return newList;\n}\n\nfunction getCurrentTask(seriesModel) {\n var scheduler = (seriesModel.ecModel || {}).scheduler;\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n\n if (pipeline) {\n // When pipline finished, the currrentTask keep the last\n // task (renderTask).\n var task = pipeline.currentTask;\n\n if (task) {\n var agentStubMap = task.agentStubMap;\n\n if (agentStubMap) {\n task = agentStubMap.get(seriesModel.uid);\n }\n }\n\n return task;\n }\n}\n\nexport default SeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Group from 'zrender/lib/graphic/Group';\nimport * as componentUtil from '../util/component';\nimport * as clazzUtil from '../util/clazz';\n\nvar ComponentView =\n/** @class */\nfunction () {\n function ComponentView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewComponent');\n }\n\n ComponentView.prototype.init = function (ecModel, api) {};\n\n ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n\n ComponentView.prototype.dispose = function (ecModel, api) {};\n\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing;\n };\n /**\n * Hook for blur target series.\n * Can be used in marker for blur the markers\n */\n\n\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {// Do nothing;\n };\n\n return ComponentView;\n}();\n\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model';\n/**\n * @return {string} If large mode changed, return string 'reset';\n */\n\nexport default function createRenderPlanner() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = !!fields.large;\n var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util';\nimport Group from 'zrender/lib/graphic/Group';\nimport * as componentUtil from '../util/component';\nimport * as clazzUtil from '../util/clazz';\nimport * as modelUtil from '../util/model';\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit } from '../util/states';\nimport { createTask } from '../core/task';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\nvar inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\n\nvar ChartView =\n/** @class */\nfunction () {\n function ChartView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewChart');\n this.renderTask = createTask({\n plan: renderTaskPlan,\n reset: renderTaskReset\n });\n this.renderTask.context = {\n view: this\n };\n }\n\n ChartView.prototype.init = function (ecModel, api) {};\n\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) {};\n /**\n * Highlight series or specified data item.\n */\n\n\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\n };\n /**\n * Downplay series or specified data item.\n */\n\n\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n toggleHighlight(seriesModel.getData(), payload, 'normal');\n };\n /**\n * Remove self.\n */\n\n\n ChartView.prototype.remove = function (ecModel, api) {\n this.group.removeAll();\n };\n /**\n * Dispose self.\n */\n\n\n ChartView.prototype.dispose = function (ecModel, api) {};\n\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n\n ChartView.markUpdateMethod = function (payload, methodName) {\n inner(payload).updateMethod = methodName;\n };\n\n ChartView.protoInitialize = function () {\n var proto = ChartView.prototype;\n proto.type = 'chart';\n }();\n\n return ChartView;\n}();\n\n;\n/**\n * Set state of single element\n */\n\nfunction elSetState(el, state, highlightDigit) {\n if (el) {\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\n }\n}\n\nfunction toggleHighlight(data, payload, state) {\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;\n\n if (dataIndex != null) {\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n });\n } else {\n data.eachItemGraphicEl(function (el) {\n elSetState(el, state, highlightDigit);\n });\n }\n}\n\nclazzUtil.enableClassExtend(ChartView, ['dispose']);\nclazzUtil.enableClassManagement(ChartView);\n\nfunction renderTaskPlan(context) {\n return renderPlanner(context.model);\n}\n\nfunction renderTaskReset(context) {\n var seriesModel = context.model;\n var ecModel = context.ecModel;\n var api = context.api;\n var payload = context.payload; // FIXME: remove updateView updateVisual\n\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n var view = context.view;\n var updateMethod = payload && inner(payload).updateMethod;\n var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount\n // is less than progressive threshold.\n : 'render';\n\n if (methodName !== 'render') {\n view[methodName](seriesModel, ecModel, api, payload);\n }\n\n return progressMethodMap[methodName];\n}\n\nvar progressMethodMap = {\n incrementalPrepareRender: {\n progress: function (params, context) {\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n }\n },\n render: {\n // Put view.render in `progress` to support appendData. But in this case\n // view.render should not be called in reset, otherwise it will be called\n // twise. Use `forceFirstProgress` to make sure that view.render is called\n // in any cases.\n forceFirstProgress: true,\n progress: function (params, context) {\n context.view.render(context.model, context.ecModel, context.api, context.payload);\n }\n }\n};\nexport default ChartView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n;\n/**\n * @public\n * @param {(Function)} fn\n * @param {number} [delay=0] Unit: ms.\n * @param {boolean} [debounce=false]\n * true: If call interval less than `delay`, only the last call works.\n * false: If call interval less than `delay, call works on fixed rate.\n * @return {(Function)} throttled fn.\n */\n\nexport function throttle(fn, delay, debounce) {\n var currCall;\n var lastCall = 0;\n var lastExec = 0;\n var timer = null;\n var diff;\n var scope;\n var args;\n var debounceNextCall;\n delay = delay || 0;\n\n function exec() {\n lastExec = new Date().getTime();\n timer = null;\n fn.apply(scope, args || []);\n }\n\n var cb = function () {\n var cbArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n cbArgs[_i] = arguments[_i];\n }\n\n currCall = new Date().getTime();\n scope = this;\n args = cbArgs;\n var thisDelay = debounceNextCall || delay;\n var thisDebounce = debounceNextCall || debounce;\n debounceNextCall = null;\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later\n // than a new call of `cb`, that is, preserving the command order. Consider\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n // happens, either the `exec` is called dierectly, or the call is delayed.\n // But the delayed call should never be later than next call of `cb`. Under\n // this assurance, we can simply update view state each time `dispatchAction`\n // triggered by user roaming, but not need to add extra code to avoid the\n // state being \"rolled-back\".\n\n if (thisDebounce) {\n timer = setTimeout(exec, thisDelay);\n } else {\n if (diff >= 0) {\n exec();\n } else {\n timer = setTimeout(exec, -diff);\n }\n }\n\n lastCall = currCall;\n };\n /**\n * Clear throttle.\n * @public\n */\n\n\n cb.clear = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n };\n /**\n * Enable debounce once.\n */\n\n\n cb.debounceNextCall = function (debounceDelay) {\n debounceNextCall = debounceDelay;\n };\n\n return cb;\n}\n/**\n * Create throttle method or update throttle rate.\n *\n * @example\n * ComponentView.prototype.render = function () {\n * ...\n * throttle.createOrUpdate(\n * this,\n * '_dispatchAction',\n * this.model.get('throttle'),\n * 'fixRate'\n * );\n * };\n * ComponentView.prototype.remove = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n * ComponentView.prototype.dispose = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n *\n */\n\nexport function createOrUpdate(obj, fnAttr, rate, throttleType) {\n var fn = obj[fnAttr];\n\n if (!fn) {\n return;\n }\n\n var originFn = fn[ORIGIN_METHOD] || fn;\n var lastThrottleType = fn[THROTTLE_TYPE];\n var lastRate = fn[RATE];\n\n if (lastRate !== rate || lastThrottleType !== throttleType) {\n if (rate == null || !throttleType) {\n return obj[fnAttr] = originFn;\n }\n\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n fn[ORIGIN_METHOD] = originFn;\n fn[THROTTLE_TYPE] = throttleType;\n fn[RATE] = rate;\n }\n\n return fn;\n}\n/**\n * Clear throttle. Example see throttle.createOrUpdate.\n */\n\nexport function clear(obj, fnAttr) {\n var fn = obj[fnAttr];\n\n if (fn && fn[ORIGIN_METHOD]) {\n obj[fnAttr] = fn[ORIGIN_METHOD];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, extend, createHashMap } from 'zrender/lib/core/util';\nimport makeStyleMapper from '../model/mixin/makeStyleMapper';\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle';\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle';\nimport Model from '../model/Model';\nimport { makeInner } from '../util/model';\nvar inner = makeInner();\nvar defaultStyleMappers = {\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\n};\nvar defaultColorKey = {\n lineStyle: 'stroke',\n itemStyle: 'fill'\n};\n\nfunction getStyleMapper(seriesModel, stylePath) {\n var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];\n\n if (!styleMapper) {\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\n return defaultStyleMappers.itemStyle;\n }\n\n return styleMapper;\n}\n\nfunction getDefaultColorKey(seriesModel, stylePath) {\n // return defaultColorKey[stylePath] ||\n var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];\n\n if (!colorKey) {\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\n return 'fill';\n }\n\n return colorKey;\n}\n\nvar seriesStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var styleModel = seriesModel.getModel(stylePath);\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var globalStyle = getStyle(styleModel);\n var decalOption = styleModel.getShallow('decal');\n\n if (decalOption) {\n data.setVisual('decal', decalOption);\n decalOption.dirty = true;\n } // TODO\n\n\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n var color = globalStyle[colorKey]; // TODO style callback\n\n var colorCallback = isFunction(color) ? color : null;\n var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default.\n\n if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\n // Note: if some series has color specified (e.g., by itemStyle.color), we DO NOT\n // make it effect palette. Bacause some scenarios users need to make some series\n // transparent or as background, which should better not effect the palette.\n var colorPalette = seriesModel.getColorFromPalette( // TODO series count changed.\n seriesModel.name, null, ecModel.getSeriesCount());\n\n if (!globalStyle[colorKey]) {\n globalStyle[colorKey] = colorPalette;\n data.setVisual('colorFromPalette', true);\n }\n\n globalStyle.fill = globalStyle.fill === 'auto' || typeof globalStyle.fill === 'function' ? colorPalette : globalStyle.fill;\n globalStyle.stroke = globalStyle.stroke === 'auto' || typeof globalStyle.stroke === 'function' ? colorPalette : globalStyle.stroke;\n }\n\n data.setVisual('style', globalStyle);\n data.setVisual('drawType', colorKey); // Only visible series has each data be visual encoded\n\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\n data.setVisual('colorFromPalette', false);\n return {\n dataEach: function (data, idx) {\n var dataParams = seriesModel.getDataParams(idx);\n var itemStyle = extend({}, globalStyle);\n itemStyle[colorKey] = colorCallback(dataParams);\n data.setItemVisual(idx, 'style', itemStyle);\n }\n };\n }\n }\n};\nvar sharedModel = new Model();\nvar dataStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var colorKey = data.getVisual('drawType');\n return {\n dataEach: data.hasItemOption ? function (data, idx) {\n // Not use getItemModel for performance considuration\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem[stylePath]) {\n sharedModel.option = rawItem[stylePath];\n var style = getStyle(sharedModel);\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n if (sharedModel.option.decal) {\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\n sharedModel.option.decal.dirty = true;\n }\n\n if (colorKey in style) {\n data.setItemVisual(idx, 'colorFromPalette', false);\n }\n }\n } : null\n };\n }\n}; // Pick color from palette for the data which has not been set with color yet.\n// Note: do not support stream rendering. No such cases yet.\n\nvar dataColorPaletteTask = {\n performRawSeries: true,\n overallReset: function (ecModel) {\n // Each type of series use one scope.\n // Pie and funnel are using diferrent scopes\n var paletteScopeGroupByType = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n if (!seriesModel.useColorPaletteOnData) {\n return;\n }\n\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\n\n if (!colorScope) {\n colorScope = {};\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\n }\n\n inner(seriesModel).scope = colorScope;\n });\n ecModel.eachSeries(function (seriesModel) {\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n var colorScope = inner(seriesModel).scope;\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n }); // Iterate on data before filtered. To make sure color from palette can be\n // Consistent when toggling legend.\n\n dataAll.each(function (rawIdx) {\n var idx = idxMap[rawIdx];\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); // Get color from palette for each data only when the color is inherited from series color, which is\n // also picked from color palette. So following situation is not in the case:\n // 1. series.itemStyle.color is set\n // 2. color is encoded by visualMap\n\n if (fromPalette) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n var name_1 = dataAll.getName(rawIdx) || rawIdx + '';\n var dataCount = dataAll.count();\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\n }\n });\n });\n }\n};\nexport { seriesStyleTask, dataStyleTask, dataColorPaletteTask };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../util/graphic';\nvar PI = Math.PI;\n/**\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} [opts]\n * @param {string} [opts.text]\n * @param {string} [opts.color]\n * @param {string} [opts.textColor]\n * @return {module:zrender/Element}\n */\n\nexport default function defaultLoading(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: 12,\n fontWeight: 'normal',\n fontStyle: 'normal',\n fontFamily: 'sans-serif',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#5470c6',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var textContent = new graphic.Text({\n style: {\n text: opts.text,\n fill: opts.textColor,\n fontSize: opts.fontSize,\n fontWeight: opts.fontWeight,\n fontStyle: opts.fontStyle,\n fontFamily: opts.fontFamily\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none'\n },\n textContent: textContent,\n textConfig: {\n position: 'right',\n distance: 10\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n var arc;\n\n if (opts.showSpinner) {\n arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n } // Inject resize\n\n\n group.resize = function () {\n var textWidth = textContent.getBoundingRect().width;\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\n + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\n + (textWidth ? 0 : r);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n group.resize();\n return group;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util';\nimport { createTask } from './task';\nimport { getUID } from '../util/component';\nimport GlobalModel from '../model/Global';\nimport ExtensionAPI from './ExtensionAPI';\nimport { normalizeToArray } from '../util/model';\n;\n\nvar Scheduler =\n/** @class */\nfunction () {\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n // key: handlerUID\n this._stageTaskMap = createHashMap();\n this.ecInstance = ecInstance;\n this.api = api; // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n }\n\n Scheduler.prototype.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n }; // If seriesModel provided, incremental threshold is check by series data.\n\n\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n };\n\n Scheduler.prototype.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n };\n /**\n * Current, progressive rendering starts from visual and layout.\n * Always detect render mode in the same stage, avoiding that incorrect\n * detection caused by data filtering.\n * Caution:\n * `updateStreamModes` use `seriesModel.getData()`.\n */\n\n\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n\n var data = seriesModel.getData();\n var dataLen = data.count(); // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n };\n\n Scheduler.prototype.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n\n scheduler._pipe(seriesModel, seriesModel.dataTask);\n });\n };\n\n Scheduler.prototype.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.api.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Currently do not need to support to sepecify them both.\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n }\n\n assert(!(handler.reset && handler.overallReset), errMsg);\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n }, this);\n };\n\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n\n this._pipe(model, renderTask);\n };\n\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n };\n\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n };\n\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished = false;\n var scheduler = this;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n\n if (overallTask) {\n var overallNeedDirty_1;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty_1 = true;\n }\n });\n overallNeedDirty_1 && overallTask.dirty();\n scheduler.updatePayload(overallTask, payload);\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n\n agentStubMap.each(function (stub) {\n stub.perform(performArgs_1);\n });\n\n if (overallTask.perform(performArgs_1)) {\n unfinished = true;\n }\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n\n var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME\n // if intending to decalare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because is a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operaions\n // and stream-independent operations should better not be mixed.\n\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n scheduler.updatePayload(task, payload);\n\n if (task.perform(performArgs)) {\n unfinished = true;\n }\n });\n }\n });\n\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished = seriesModel.dataTask.perform() || unfinished;\n });\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n\n task = task.getUpstream();\n } while (task);\n });\n };\n\n Scheduler.prototype.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n };\n\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n\n function create(seriesModel) {\n var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n // PENDING: `useClearVisual` not used?\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n\n scheduler._pipe(seriesModel, task);\n }\n };\n\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n };\n var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", ' + 'becuase it will block all streams.';\n }\n\n assert(!stageHandler.createOnAllSeries, errMsg);\n\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n } // Otherwise, (usually it is legancy case), the overall task will only be\n // executed when upstream dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upsteam.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n shouldOverallTaskDirty = true, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })));\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress // FIXME:TS never used, so comment it\n // modifyOutputEnd: modifyOutputEnd\n\n };\n stub.agent = overallTask;\n stub.__block = overallProgress;\n\n scheduler._pipe(seriesModel, stub);\n }\n\n if (shouldOverallTaskDirty) {\n overallTask.dirty();\n }\n };\n\n Scheduler.prototype._pipe = function (seriesModel, task) {\n var pipelineId = seriesModel.uid;\n\n var pipeline = this._pipelineMap.get(pipelineId);\n\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n };\n\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n };\n\n ;\n return Scheduler;\n}();\n\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\n\nfunction stubReset(context) {\n return context.overallProgress && stubProgress;\n}\n\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\n\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\n\nfunction seriesTaskPlan(context) {\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\n\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\n\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\n\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\n\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n/**\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\n * To ensure that they can work normally, they should work in block mode, that is,\n * they should not be started util the previous tasks finished. So they cause the\n * progressive rendering disabled. We try to detect the series type, to narrow down\n * the block range to only the series type they concern, but not all series.\n */\n\n\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return seriesType;\n}\n\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\n\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\n\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\n\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name_1 in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name_1] = noop;\n }\n /* eslint-enable */\n\n}\n\nexport default Scheduler;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];\nexport default {\n color: colorAll,\n colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll]\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar contrastColor = '#B9B8CE';\nvar backgroundColor = '#100C2A';\n\nvar axisCommon = function () {\n return {\n axisLine: {\n lineStyle: {\n color: contrastColor\n }\n },\n splitLine: {\n lineStyle: {\n color: '#484753'\n }\n },\n splitArea: {\n areaStyle: {\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\n }\n },\n minorSplitLine: {\n lineStyle: {\n color: '#20203B'\n }\n }\n };\n};\n\nvar colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff'];\nvar theme = {\n darkMode: true,\n color: colorPalette,\n backgroundColor: backgroundColor,\n axisPointer: {\n lineStyle: {\n color: '#817f91'\n },\n crossStyle: {\n color: '#817f91'\n },\n label: {\n // TODO Contrast of label backgorundColor\n color: '#fff'\n }\n },\n legend: {\n textStyle: {\n color: contrastColor\n }\n },\n textStyle: {\n color: contrastColor\n },\n title: {\n textStyle: {\n color: '#EEF1FA'\n },\n subtextStyle: {\n color: '#B9B8CE'\n }\n },\n toolbox: {\n iconStyle: {\n borderColor: contrastColor\n }\n },\n dataZoom: {\n borderColor: '#71708A',\n textStyle: {\n color: contrastColor\n },\n brushStyle: {\n color: 'rgba(135,163,206,0.3)'\n },\n handleStyle: {\n color: '#353450',\n borderColor: '#C5CBE3'\n },\n moveHandleStyle: {\n color: '#B0B6C3',\n opacity: 0.3\n },\n fillerColor: 'rgba(135,163,206,0.2)',\n emphasis: {\n handleStyle: {\n borderColor: '#91B7F2',\n color: '#4D587D'\n },\n moveHandleStyle: {\n color: '#636D9A',\n opacity: 0.7\n }\n },\n dataBackground: {\n lineStyle: {\n color: '#71708A',\n width: 1\n },\n areaStyle: {\n color: '#71708A'\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#87A3CE'\n },\n areaStyle: {\n color: '#87A3CE'\n }\n }\n },\n visualMap: {\n textStyle: {\n color: contrastColor\n }\n },\n timeline: {\n lineStyle: {\n color: contrastColor\n },\n label: {\n color: contrastColor\n },\n controlStyle: {\n color: contrastColor,\n borderColor: contrastColor\n }\n },\n calendar: {\n itemStyle: {\n color: backgroundColor\n },\n dayLabel: {\n color: contrastColor\n },\n monthLabel: {\n color: contrastColor\n },\n yearLabel: {\n color: contrastColor\n }\n },\n timeAxis: axisCommon(),\n logAxis: axisCommon(),\n valueAxis: axisCommon(),\n categoryAxis: axisCommon(),\n line: {\n symbol: 'circle'\n },\n graph: {\n color: colorPalette\n },\n gauge: {\n title: {\n color: contrastColor\n },\n axisLine: {\n lineStyle: {\n color: [[1, 'rgba(207,212,219,0.2)']]\n }\n },\n axisLabel: {\n color: contrastColor\n },\n detail: {\n color: '#EEF1FA'\n }\n },\n candlestick: {\n itemStyle: {\n color: '#f64e56',\n color0: '#54ea92',\n borderColor: '#f64e56',\n borderColor0: '#54ea92' // borderColor: '#ca2824',\n // borderColor0: '#09a443'\n\n }\n }\n};\ntheme.categoryAxis.splitLine.show = false;\nexport default theme;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parseClassType } from './clazz';\n/**\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n * `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */\n\nvar ECEventProcessor =\n/** @class */\nfunction () {\n function ECEventProcessor() {}\n\n ECEventProcessor.prototype.normalizeQuery = function (query) {\n var cptQuery = {};\n var dataQuery = {};\n var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component.\n\n if (zrUtil.isString(query)) {\n var condCptType = parseClassType(query); // `.main` and `.sub` may be ''.\n\n cptQuery.mainType = condCptType.main || null;\n cptQuery.subType = condCptType.sub || null;\n } // `query` is an object, convert to {mainType, index, name, id}.\n else {\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n // can not be used in `compomentModel.filterForExposedEvent`.\n var suffixes_1 = ['Index', 'Name', 'Id'];\n var dataKeys_1 = {\n name: 1,\n dataIndex: 1,\n dataType: 1\n };\n zrUtil.each(query, function (val, key) {\n var reserved = false;\n\n for (var i = 0; i < suffixes_1.length; i++) {\n var propSuffix = suffixes_1[i];\n var suffixPos = key.lastIndexOf(propSuffix);\n\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n var mainType = key.slice(0, suffixPos); // Consider `dataIndex`.\n\n if (mainType !== 'data') {\n cptQuery.mainType = mainType;\n cptQuery[propSuffix.toLowerCase()] = val;\n reserved = true;\n }\n }\n }\n\n if (dataKeys_1.hasOwnProperty(key)) {\n dataQuery[key] = val;\n reserved = true;\n }\n\n if (!reserved) {\n otherQuery[key] = val;\n }\n });\n }\n\n return {\n cptQuery: cptQuery,\n dataQuery: dataQuery,\n otherQuery: otherQuery\n };\n };\n\n ECEventProcessor.prototype.filter = function (eventType, query) {\n // They should be assigned before each trigger call.\n var eventInfo = this.eventInfo;\n\n if (!eventInfo) {\n return true;\n }\n\n var targetEl = eventInfo.targetEl;\n var packedEvent = eventInfo.packedEvent;\n var model = eventInfo.model;\n var view = eventInfo.view; // For event like 'globalout'.\n\n if (!model || !view) {\n return true;\n }\n\n var cptQuery = query.cptQuery;\n var dataQuery = query.dataQuery;\n return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\n\n function check(query, host, prop, propOnHost) {\n return query[prop] == null || host[propOnHost || prop] === query[prop];\n }\n };\n\n ECEventProcessor.prototype.afterTrigger = function () {\n // Make sure the eventInfo wont be used in next trigger.\n this.eventInfo = null;\n };\n\n return ECEventProcessor;\n}();\n\nexport { ECEventProcessor };\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction } from 'zrender/lib/core/util'; // Encoding visual for all series include which is filtered for legend drawing\n\nvar seriesSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n\n if (seriesModel.legendSymbol) {\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\n }\n\n if (!seriesModel.hasSymbolVisual) {\n return;\n }\n\n var symbolType = seriesModel.get('symbol');\n var symbolSize = seriesModel.get('symbolSize');\n var keepAspect = seriesModel.get('symbolKeepAspect');\n var symbolRotate = seriesModel.get('symbolRotate');\n var symbolOffset = seriesModel.get('symbolOffset');\n var hasSymbolTypeCallback = isFunction(symbolType);\n var hasSymbolSizeCallback = isFunction(symbolSize);\n var hasSymbolRotateCallback = isFunction(symbolRotate);\n var hasSymbolOffsetCallback = isFunction(symbolOffset);\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback || hasSymbolOffsetCallback;\n var seriesSymbol = !hasSymbolTypeCallback && symbolType ? symbolType : seriesModel.defaultSymbol;\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\n var seriesSymbolOffset = !hasSymbolOffsetCallback ? symbolOffset : null;\n data.setVisual({\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\n // If seting callback functions on `symbol` or `symbolSize`, for simplicity and avoiding\n // to bring trouble, we do not pick a reuslt from one of its calling on data item here,\n // but just use the default value. Callback on `symbol` or `symbolSize` is convenient in\n // some cases but generally it is not recommanded.\n symbol: seriesSymbol,\n symbolSize: seriesSymbolSize,\n symbolKeepAspect: keepAspect,\n symbolRotate: seriesSymbolRotate,\n symbolOffset: seriesSymbolOffset\n }); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n function dataEach(data, idx) {\n var rawValue = seriesModel.getRawValue(idx);\n var params = seriesModel.getDataParams(idx);\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\n hasSymbolOffsetCallback && data.setItemVisual(idx, 'symbolOffset', symbolOffset(rawValue, params));\n }\n\n return {\n dataEach: hasCallback ? dataEach : null\n };\n }\n};\nvar dataSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (!seriesModel.hasSymbolVisual) {\n return;\n } // Only visible series has each data be visual encoded\n\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var itemSymbolType = itemModel.getShallow('symbol', true);\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\n var itemSymbolOffset = itemModel.getShallow('symbolOffset', true);\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true); // If has item symbol\n\n if (itemSymbolType != null) {\n data.setItemVisual(idx, 'symbol', itemSymbolType);\n }\n\n if (itemSymbolSize != null) {\n // PENDING Transform symbolSize ?\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\n }\n\n if (itemSymbolRotate != null) {\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\n }\n\n if (itemSymbolOffset != null) {\n data.setItemVisual(idx, 'symbolOffset', itemSymbolOffset);\n }\n\n if (itemSymbolKeepAspect != null) {\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\n }\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport { seriesSymbolTask, dataSymbolTask };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getItemVisualFromData(data, dataIndex, key) {\n switch (key) {\n case 'color':\n var style = data.getItemVisual(dataIndex, 'style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getItemVisual(dataIndex, 'style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getItemVisual(dataIndex, key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function getVisualFromData(data, key) {\n switch (key) {\n case 'color':\n var style = data.getVisual('style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getVisual('style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getVisual(key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function setItemVisualFromData(data, dataIndex, key, value) {\n switch (key) {\n case 'color':\n // Make sure not sharing style object.\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\n style[data.getVisual('drawType')] = value; // Mark the color has been changed, not from palette anymore\n\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\n break;\n\n case 'opacity':\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\n break;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n data.setItemVisual(dataIndex, key, value);\n break;\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { Point, Path, Polyline } from '../util/graphic';\nimport PathProxy from 'zrender/lib/core/PathProxy';\nimport { normalizeRadian } from 'zrender/lib/contain/util';\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/lib/core/curve';\nimport { defaults, retrieve2 } from 'zrender/lib/core/util';\nimport { invert } from 'zrender/lib/core/matrix';\nimport * as vector from 'zrender/lib/core/vector';\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states';\nvar PI2 = Math.PI * 2;\nvar CMD = PathProxy.CMD;\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\n\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\n var width = rect.width;\n var height = rect.height;\n\n switch (pos) {\n case 'top':\n outPt.set(rect.x + width / 2, rect.y - distance);\n outDir.set(0, -1);\n break;\n\n case 'bottom':\n outPt.set(rect.x + width / 2, rect.y + height + distance);\n outDir.set(0, 1);\n break;\n\n case 'left':\n outPt.set(rect.x - distance, rect.y + height / 2);\n outDir.set(-1, 0);\n break;\n\n case 'right':\n outPt.set(rect.x + width + distance, rect.y + height / 2);\n outDir.set(1, 0);\n break;\n }\n}\n\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n x /= d;\n y /= d; // Intersect point.\n\n var ox = x * r + cx;\n var oy = y * r + cy;\n\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n var angle = Math.atan2(y, x);\n\n if (angle < 0) {\n angle += PI2;\n }\n\n if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n // Project point is on the arc.\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n\n var x1 = r * Math.cos(startAngle) + cx;\n var y1 = r * Math.sin(startAngle) + cy;\n var x2 = r * Math.cos(endAngle) + cx;\n var y2 = r * Math.sin(endAngle) + cy;\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\n\n if (d1 < d2) {\n out[0] = x1;\n out[1] = y1;\n return Math.sqrt(d1);\n } else {\n out[0] = x2;\n out[1] = y2;\n return Math.sqrt(d2);\n }\n}\n\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\n var dx = x - x1;\n var dy = y - y1;\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n dx1 /= lineLen;\n dy1 /= lineLen; // dot product\n\n var projectedLen = dx * dx1 + dy * dy1;\n var t = projectedLen / lineLen;\n\n if (limitToEnds) {\n t = Math.min(Math.max(t, 0), 1);\n }\n\n t *= lineLen;\n var ox = out[0] = x1 + t * dx1;\n var oy = out[1] = y1 + t * dy1;\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\n if (width < 0) {\n x1 = x1 + width;\n width = -width;\n }\n\n if (height < 0) {\n y1 = y1 + height;\n height = -height;\n }\n\n var x2 = x1 + width;\n var y2 = y1 + height;\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nvar tmpPt = [];\n\nfunction nearestPointOnRect(pt, rect, out) {\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\n out.set(tmpPt[0], tmpPt[1]);\n return dist;\n}\n/**\n * Calculate min distance corresponding point.\n * This method won't evaluate if point is in the path.\n */\n\n\nfunction nearestPointOnPath(pt, path, out) {\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n var minDist = Infinity;\n var data = path.data;\n var x = pt.x;\n var y = pt.y;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n\n if (i === 1) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n var d = minDist;\n\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n\n case CMD.L:\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++]; // TODO Arc 旋转\n\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令\n\n if (i <= 1) {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n\n\n var _x = (x - cx) * ry / rx + cx;\n\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\n break;\n\n case CMD.Z:\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\n xi = x0;\n yi = y0;\n break;\n }\n\n if (d < minDist) {\n minDist = d;\n out.set(tmpPt[0], tmpPt[1]);\n }\n }\n\n return minDist;\n} // Temporal varible for intermediate usage.\n\n\nvar pt0 = new Point();\nvar pt1 = new Point();\nvar pt2 = new Point();\nvar dir = new Point();\nvar dir2 = new Point();\n/**\n * Calculate a proper guide line based on the label position and graphic element definition\n * @param label\n * @param labelRect\n * @param target\n * @param targetRect\n */\n\nexport function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent(); // Needs to create text guide in each charts.\n\n if (!(label && labelLine)) {\n return;\n }\n\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && invert([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\n pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\n if (dist < minDist) {\n minDist = dist; // Transform back to global space.\n\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n} // Temporal variable for the limitTurnAngle function\n\nvar tmpArr = [];\nvar tmpProjPoint = new Point();\n/**\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\n * @param linePoints\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\n */\n\nexport function limitTurnAngle(linePoints, minTurnAngle) {\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\n return;\n }\n\n minTurnAngle = minTurnAngle / 180 * Math.PI; // The line points can be\n // /pt1----pt2 (label)\n // /\n // pt0/\n\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt0, pt1);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(dir2);\n var minTurnAngleCos = Math.cos(minTurnAngle);\n\n if (minTurnAngleCos < angleCos) {\n // Smaller than minTurnAngle\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr); // Calculate new projected length with limited minTurnAngle and get the new connect point\n\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n/**\n * Limit the angle of line and the surface\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\n */\n\nexport function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\n return;\n }\n\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt1, pt0);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(surfaceNormal);\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\n\n if (angleCos < maxSurfaceAngleCos) {\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr);\n var HALF_PI = Math.PI / 2;\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\n\n if (newAngle >= HALF_PI) {\n // parallel\n Point.copy(tmpProjPoint, pt2);\n } else {\n // Calculate new projected length with limited minTurnAngle and get the new connect point\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\n var isNormal = stateName === 'normal';\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); // Make sure display.\n\n stateObj.ignore = ignore; // Set smooth\n\n var smooth = stateModel.get('smooth');\n\n if (smooth && smooth === true) {\n smooth = 0.3;\n }\n\n stateObj.shape = stateObj.shape || {};\n\n if (smooth > 0) {\n stateObj.shape.smooth = smooth;\n }\n\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\n}\n\nfunction buildLabelLinePath(path, shape) {\n var smooth = shape.smooth;\n var points = shape.points;\n\n if (!points) {\n return;\n }\n\n path.moveTo(points[0][0], points[0][1]);\n\n if (smooth > 0 && points.length >= 3) {\n var len1 = vector.dist(points[0], points[1]);\n var len2 = vector.dist(points[1], points[2]);\n\n if (!len1 || !len2) {\n path.lineTo(points[1][0], points[1][1]);\n path.lineTo(points[2][0], points[2][1]);\n return;\n }\n\n var moveLen = Math.min(len1, len2) * smooth;\n var midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\n var midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\n var midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\n } else {\n for (var i = 1; i < points.length; i++) {\n path.lineTo(points[i][0], points[i][1]);\n }\n }\n}\n/**\n * Create a label line if necessary and set it's style.\n */\n\n\nexport function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n\n return;\n }\n\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateName = DISPLAY_STATES[i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states.normal;\n\n if (stateObj) {\n stateObj.ignore = true;\n }\n\n continue;\n } // Create labelLine if not exists\n\n\n if (!labelLine) {\n labelLine = new Polyline();\n targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n } // Use same state proxy.\n\n\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n\n if (labelLine) {\n defaults(labelLine.style, defaultStyle); // Not fill.\n\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\n labelLine.buildPath = buildLabelLinePath;\n }\n}\nexport function getLabelLineStatesModels(itemModel, labelLineName) {\n labelLineName = labelLineName || 'labelLine';\n var statesModels = {\n normal: itemModel.getModel(labelLineName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\n }\n\n return statesModels;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { BoundingRect, OrientedBoundingRect } from '../util/graphic';\nexport function prepareLayoutList(input) {\n var list = [];\n\n for (var i = 0; i < input.length; i++) {\n var rawItem = input[i];\n\n if (rawItem.defaultAttr.ignore) {\n continue;\n }\n\n var label = rawItem.label;\n var transform = label.getComputedTransform(); // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el.\n\n var localRect = label.getBoundingRect();\n var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5;\n var minMargin = label.style.margin || 0;\n var globalRect = localRect.clone();\n globalRect.applyTransform(transform);\n globalRect.x -= minMargin / 2;\n globalRect.y -= minMargin / 2;\n globalRect.width += minMargin;\n globalRect.height += minMargin;\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\n list.push({\n label: label,\n labelLine: rawItem.labelLine,\n rect: globalRect,\n localRect: localRect,\n obb: obb,\n priority: rawItem.priority,\n defaultAttr: rawItem.defaultAttr,\n layoutOption: rawItem.computedLayoutOption,\n axisAligned: isAxisAligned,\n transform: transform\n });\n }\n\n return list;\n}\n\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\n var len = list.length;\n\n if (len < 2) {\n return;\n }\n\n list.sort(function (a, b) {\n return a.rect[xyDim] - b.rect[xyDim];\n });\n var lastPos = 0;\n var delta;\n var adjusted = false;\n var shifts = [];\n var totalShifts = 0;\n\n for (var i = 0; i < len; i++) {\n var item = list[i];\n var rect = item.rect;\n delta = rect[xyDim] - lastPos;\n\n if (delta < 0) {\n // shiftForward(i, len, -delta);\n rect[xyDim] -= delta;\n item.label[xyDim] -= delta;\n adjusted = true;\n }\n\n var shift = Math.max(-delta, 0);\n shifts.push(shift);\n totalShifts += shift;\n lastPos = rect[xyDim] + rect[sizeDim];\n }\n\n if (totalShifts > 0 && balanceShift) {\n // Shift back to make the distribution more equally.\n shiftList(-totalShifts / len, 0, len);\n } // TODO bleedMargin?\n\n\n var first = list[0];\n var last = list[len - 1];\n var minGap;\n var maxGap;\n updateMinMaxGap(); // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\n\n minGap < 0 && squeezeGaps(-minGap, 0.8);\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\n updateMinMaxGap();\n takeBoundsGap(minGap, maxGap, 1);\n takeBoundsGap(maxGap, minGap, -1); // Handle bailout when there is not enough space.\n\n updateMinMaxGap();\n\n if (minGap < 0) {\n squeezeWhenBailout(-minGap);\n }\n\n if (maxGap < 0) {\n squeezeWhenBailout(maxGap);\n }\n\n function updateMinMaxGap() {\n minGap = first.rect[xyDim] - minBound;\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\n }\n\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\n if (gapThisBound < 0) {\n // Move from other gap if can.\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\n\n if (moveFromMaxGap > 0) {\n shiftList(moveFromMaxGap * moveDir, 0, len);\n var remained = moveFromMaxGap + gapThisBound;\n\n if (remained < 0) {\n squeezeGaps(-remained * moveDir, 1);\n }\n } else {\n squeezeGaps(-gapThisBound * moveDir, 1);\n }\n }\n }\n\n function shiftList(delta, start, end) {\n if (delta !== 0) {\n adjusted = true;\n }\n\n for (var i = start; i < end; i++) {\n var item = list[i];\n var rect = item.rect;\n rect[xyDim] += delta;\n item.label[xyDim] += delta;\n }\n } // Squeeze gaps if the labels exceed margin.\n\n\n function squeezeGaps(delta, maxSqeezePercent) {\n var gaps = [];\n var totalGaps = 0;\n\n for (var i = 1; i < len; i++) {\n var prevItemRect = list[i - 1].rect;\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\n gaps.push(gap);\n totalGaps += gap;\n }\n\n if (!totalGaps) {\n return;\n }\n\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\n\n if (delta > 0) {\n for (var i = 0; i < len - 1; i++) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i] * squeezePercent; // Forward\n\n shiftList(movement, 0, i + 1);\n }\n } else {\n // Backward\n for (var i = len - 1; i > 0; i--) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i - 1] * squeezePercent;\n shiftList(-movement, i, len);\n }\n }\n }\n /**\n * Squeeze to allow overlap if there is no more space available.\n * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\n */\n\n\n function squeezeWhenBailout(delta) {\n var dir = delta < 0 ? -1 : 1;\n delta = Math.abs(delta);\n var moveForEachLabel = Math.ceil(delta / (len - 1));\n\n for (var i = 0; i < len - 1; i++) {\n if (dir > 0) {\n // Forward\n shiftList(moveForEachLabel, 0, i + 1);\n } else {\n // Backward\n shiftList(-moveForEachLabel, len - i - 1, len);\n }\n\n delta -= moveForEachLabel;\n\n if (delta <= 0) {\n return;\n }\n }\n }\n\n return adjusted;\n}\n/**\n * Adjust labels on x direction to avoid overlap.\n */\n\n\nexport function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n}\n/**\n * Adjust labels on y direction to avoid overlap.\n */\n\nexport function shiftLayoutOnY(list, topBound, bottomBound, // If average the shifts on all labels and add them to 0\nbalanceShift) {\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\n}\nexport function hideOverlap(labelList) {\n var displayedLabels = []; // TODO, render overflow visible first, put in the displayedLabels.\n\n labelList.sort(function (a, b) {\n return b.priority - a.priority;\n });\n var globalRect = new BoundingRect(0, 0, 0, 0);\n\n function hideEl(el) {\n if (!el.ignore) {\n // Show on emphasis.\n var emphasisState = el.ensureState('emphasis');\n\n if (emphasisState.ignore == null) {\n emphasisState.ignore = false;\n }\n }\n\n el.ignore = true;\n }\n\n for (var i = 0; i < labelList.length; i++) {\n var labelItem = labelList[i];\n var isAxisAligned = labelItem.axisAligned;\n var localRect = labelItem.localRect;\n var transform = labelItem.transform;\n var label = labelItem.label;\n var labelLine = labelItem.labelLine;\n globalRect.copy(labelItem.rect); // Add a threshold because layout may be aligned precisely.\n\n globalRect.width -= 0.1;\n globalRect.height -= 0.1;\n globalRect.x += 0.05;\n globalRect.y += 0.05;\n var obb = labelItem.obb;\n var overlapped = false;\n\n for (var j = 0; j < displayedLabels.length; j++) {\n var existsTextCfg = displayedLabels[j]; // Fast rejection.\n\n if (!globalRect.intersect(existsTextCfg.rect)) {\n continue;\n }\n\n if (isAxisAligned && existsTextCfg.axisAligned) {\n // Is overlapped\n overlapped = true;\n break;\n }\n\n if (!existsTextCfg.obb) {\n // If self is not axis aligned. But other is.\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\n }\n\n if (!obb) {\n // If self is axis aligned. But other is not.\n obb = new OrientedBoundingRect(localRect, transform);\n }\n\n if (obb.intersect(existsTextCfg.obb)) {\n overlapped = true;\n break;\n }\n } // TODO Callback to determine if this overlap should be handled?\n\n\n if (overlapped) {\n hideEl(label);\n labelLine && hideEl(labelLine);\n } else {\n label.attr('ignore', labelItem.defaultAttr.ignore);\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\n displayedLabels.push(labelItem);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO: move labels out of viewport.\nimport { BoundingRect, updateProps, initProps, isElementRemoved } from '../util/graphic';\nimport { getECData } from '../util/innerStore';\nimport { parsePercent } from '../util/number';\nimport Transformable from 'zrender/lib/core/Transformable';\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper';\nimport { makeInner } from '../util/model';\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/lib/core/util';\nimport { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper';\nimport { labelInner, animateLabelValue } from './labelStyle';\n\nfunction cloneArr(points) {\n if (points) {\n var newPoints = [];\n\n for (var i = 0; i < points.length; i++) {\n newPoints.push(points[i].slice());\n }\n\n return newPoints;\n }\n}\n\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\n var label = labelItem.label;\n var labelLine = hostEl && hostEl.getTextGuideLine();\n return {\n dataIndex: labelItem.dataIndex,\n dataType: labelItem.dataType,\n seriesIndex: labelItem.seriesModel.seriesIndex,\n text: labelItem.label.style.text,\n rect: labelItem.hostRect,\n labelRect: labelItem.rect,\n // x: labelAttr.x,\n // y: labelAttr.y,\n align: label.style.align,\n verticalAlign: label.style.verticalAlign,\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\n };\n}\n\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\nvar dummyTransformable = new Transformable();\nvar labelLayoutInnerStore = makeInner();\nvar labelLineAnimationStore = makeInner();\n\nfunction extendWithKeys(target, source, keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (source[key] != null) {\n target[key] = source[key];\n }\n }\n}\n\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\n\nvar LabelManager =\n/** @class */\nfunction () {\n function LabelManager() {\n this._labelList = [];\n this._chartViewList = [];\n }\n\n LabelManager.prototype.clearLabels = function () {\n this._labelList = [];\n this._chartViewList = [];\n };\n /**\n * Add label to manager\n */\n\n\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\n var labelStyle = label.style;\n var hostEl = label.__hostTarget;\n var textConfig = hostEl.textConfig || {}; // TODO: If label is in other state.\n\n var labelTransform = label.getComputedTransform();\n var labelRect = label.getBoundingRect().plain();\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\n\n if (labelTransform) {\n dummyTransformable.setLocalTransform(labelTransform);\n } else {\n // Identity transform.\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\n }\n\n var host = label.__hostTarget;\n var hostRect;\n\n if (host) {\n hostRect = host.getBoundingRect().plain();\n var transform = host.getComputedTransform();\n BoundingRect.applyTransform(hostRect, hostRect, transform);\n }\n\n var labelGuide = hostRect && host.getTextGuideLine();\n\n this._labelList.push({\n label: label,\n labelLine: labelGuide,\n seriesModel: seriesModel,\n dataIndex: dataIndex,\n dataType: dataType,\n layoutOption: layoutOption,\n computedLayoutOption: null,\n rect: labelRect,\n hostRect: hostRect,\n // Label with lower priority will be hidden when overlapped\n // Use rect size as default priority\n priority: hostRect ? hostRect.width * hostRect.height : 0,\n // Save default label attributes.\n // For restore if developers want get back to default value in callback.\n defaultAttr: {\n ignore: label.ignore,\n labelGuideIgnore: labelGuide && labelGuide.ignore,\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY,\n rotation: dummyTransformable.rotation,\n style: {\n x: labelStyle.x,\n y: labelStyle.y,\n align: labelStyle.align,\n verticalAlign: labelStyle.verticalAlign,\n width: labelStyle.width,\n height: labelStyle.height,\n fontSize: labelStyle.fontSize\n },\n cursor: label.cursor,\n attachedPos: textConfig.position,\n attachedRot: textConfig.rotation\n }\n });\n };\n\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\n var _this = this;\n\n this._chartViewList.push(chartView);\n\n var seriesModel = chartView.__model;\n var layoutOption = seriesModel.get('labelLayout');\n /**\n * Ignore layouting if it's not specified anything.\n */\n\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\n return;\n }\n\n chartView.group.traverse(function (child) {\n if (child.ignore) {\n return true; // Stop traverse descendants.\n } // Only support label being hosted on graphic elements.\n\n\n var textEl = child.getTextContent();\n var ecData = getECData(child); // Can only attach the text on the element with dataIndex\n\n if (textEl && !textEl.disableLabelLayout) {\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\n }\n });\n };\n\n LabelManager.prototype.updateLayoutConfig = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n\n function createDragHandler(el, labelLineModel) {\n return function () {\n updateLabelLinePoints(el, labelLineModel);\n };\n }\n\n for (var i = 0; i < this._labelList.length; i++) {\n var labelItem = this._labelList[i];\n var label = labelItem.label;\n var hostEl = label.__hostTarget;\n var defaultLabelAttr = labelItem.defaultAttr;\n var layoutOption = void 0; // TODO A global layout option?\n\n if (typeof labelItem.layoutOption === 'function') {\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\n } else {\n layoutOption = labelItem.layoutOption;\n }\n\n layoutOption = layoutOption || {};\n labelItem.computedLayoutOption = layoutOption;\n var degreeToRadian = Math.PI / 180; // TODO hostEl should always exists.\n // Or label should not have parent because the x, y is all in global space.\n\n if (hostEl) {\n hostEl.setTextConfig({\n // Force to set local false.\n local: false,\n // Ignore position and rotation config on the host el if x or y is changed.\n position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,\n // Ignore rotation config on the host el if rotation is changed.\n rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\n });\n }\n\n var needsUpdateLabelLine = false;\n\n if (layoutOption.x != null) {\n // TODO width of chart view.\n label.x = parsePercent(layoutOption.x, width);\n label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\n\n needsUpdateLabelLine = true;\n } else {\n label.x = defaultLabelAttr.x;\n label.setStyle('x', defaultLabelAttr.style.x);\n }\n\n if (layoutOption.y != null) {\n // TODO height of chart view.\n label.y = parsePercent(layoutOption.y, height);\n label.setStyle('y', 0); // Ignore movement in style.\n\n needsUpdateLabelLine = true;\n } else {\n label.y = defaultLabelAttr.y;\n label.setStyle('y', defaultLabelAttr.style.y);\n }\n\n if (layoutOption.labelLinePoints) {\n var guideLine = hostEl.getTextGuideLine();\n\n if (guideLine) {\n guideLine.setShape({\n points: layoutOption.labelLinePoints\n }); // Not update\n\n needsUpdateLabelLine = false;\n }\n }\n\n var labelLayoutStore = labelLayoutInnerStore(label);\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\n label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\n label.scaleX = defaultLabelAttr.scaleX;\n label.scaleY = defaultLabelAttr.scaleY;\n\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\n }\n\n if (layoutOption.draggable) {\n label.draggable = true;\n label.cursor = 'move';\n\n if (hostEl) {\n var hostModel = labelItem.seriesModel;\n\n if (labelItem.dataIndex != null) {\n var data = labelItem.seriesModel.getData(labelItem.dataType);\n hostModel = data.getItemModel(labelItem.dataIndex);\n }\n\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\n }\n } else {\n // TODO Other drag functions?\n label.off('drag');\n label.cursor = defaultLabelAttr.cursor;\n }\n }\n };\n\n LabelManager.prototype.layout = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n var labelList = prepareLayoutList(this._labelList);\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftX';\n });\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftY';\n });\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\n return item.layoutOption.hideOverlap;\n });\n hideOverlap(labelsNeedsHideOverlap);\n };\n /**\n * Process all labels. Not only labels with layoutOption.\n */\n\n\n LabelManager.prototype.processLabelsOverall = function () {\n var _this = this;\n\n each(this._chartViewList, function (chartView) {\n var seriesModel = chartView.__model;\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\n var animationEnabled = seriesModel.isAnimationEnabled();\n chartView.group.traverse(function (child) {\n if (child.ignore) {\n return true; // Stop traverse descendants.\n }\n\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\n var label = child.getTextContent();\n\n if (!needsUpdateLabelLine && label) {\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\n }\n\n if (needsUpdateLabelLine) {\n _this._updateLabelLine(child, seriesModel);\n }\n\n if (animationEnabled) {\n _this._animateLabels(child, seriesModel);\n }\n });\n });\n };\n\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\n // Only support label being hosted on graphic elements.\n var textEl = el.getTextContent(); // Update label line style.\n\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex; // Only support labelLine on the labels represent data.\n\n if (textEl && dataIndex != null) {\n var data = seriesModel.getData(ecData.dataType);\n var itemModel = data.getItemModel(dataIndex);\n var defaultStyle = {};\n var visualStyle = data.getItemVisual(dataIndex, 'style');\n var visualType = data.getVisual('drawType'); // Default to be same with main color\n\n defaultStyle.stroke = visualStyle[visualType];\n var labelLineModel = itemModel.getModel('labelLine');\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\n updateLabelLinePoints(el, labelLineModel);\n }\n };\n\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\n var textEl = el.getTextContent();\n var guideLine = el.getTextGuideLine(); // Animate\n\n if (textEl && !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el)) {\n var layoutStore = labelLayoutInnerStore(textEl);\n var oldLayout = layoutStore.oldLayout;\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n var newProps = {\n x: textEl.x,\n y: textEl.y,\n rotation: textEl.rotation\n };\n var data = seriesModel.getData(ecData.dataType);\n\n if (!oldLayout) {\n textEl.attr(newProps); // Disable fade in animation if value animation is enabled.\n\n if (!labelInner(textEl).valueAnimation) {\n var oldOpacity = retrieve2(textEl.style.opacity, 1); // Fade in animation\n\n textEl.style.opacity = 0;\n initProps(textEl, {\n style: {\n opacity: oldOpacity\n }\n }, seriesModel, dataIndex);\n }\n } else {\n textEl.attr(oldLayout); // Make sure the animation from is in the right status.\n\n var prevStates = el.prevStates;\n\n if (prevStates) {\n if (indexOf(prevStates, 'select') >= 0) {\n textEl.attr(layoutStore.oldLayoutSelect);\n }\n\n if (indexOf(prevStates, 'emphasis') >= 0) {\n textEl.attr(layoutStore.oldLayoutEmphasis);\n }\n }\n\n updateProps(textEl, newProps, seriesModel, dataIndex);\n }\n\n layoutStore.oldLayout = newProps;\n\n if (textEl.states.select) {\n var layoutSelect = layoutStore.oldLayoutSelect = {};\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\n }\n\n if (textEl.states.emphasis) {\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\n }\n\n animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\n }\n\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\n var layoutStore = labelLineAnimationStore(guideLine);\n var oldLayout = layoutStore.oldLayout;\n var newLayout = {\n points: guideLine.shape.points\n };\n\n if (!oldLayout) {\n guideLine.setShape(newLayout);\n guideLine.style.strokePercent = 0;\n initProps(guideLine, {\n style: {\n strokePercent: 1\n }\n }, seriesModel);\n } else {\n guideLine.attr({\n shape: oldLayout\n });\n updateProps(guideLine, {\n shape: newLayout\n }, seriesModel);\n }\n\n layoutStore.oldLayout = newLayout;\n }\n };\n\n return LabelManager;\n}();\n\nexport default LabelManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, each, isArray } from 'zrender/lib/core/util';\nimport { deprecateReplaceLog, deprecateLog } from '../util/log';\nimport { queryDataIndex } from '../util/model'; // Legacy data selection action.\n// Inlucdes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\n\nexport function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\n function getSeriesIndices(ecModel, payload) {\n var seriesIndices = [];\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n seriesIndices.push(seriesModel.seriesIndex);\n });\n return seriesIndices;\n }\n\n each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(payload.type, eventsMap[1]);\n }\n\n api.dispatchAction(extend(payload, {\n type: eventsMap[1],\n seriesIndex: getSeriesIndices(ecModel, payload)\n }));\n });\n });\n}\n\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\n var legacyEventName = type + eventPostfix;\n\n if (!ecIns.isSilent(legacyEventName)) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\n }\n\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'pie'\n }, function (seriesModel) {\n var seriesIndex = seriesModel.seriesIndex;\n var selected = payload.selected;\n\n for (var i = 0; i < selected.length; i++) {\n if (selected[i].seriesIndex === seriesIndex) {\n var data = seriesModel.getData();\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\n ecIns.trigger(legacyEventName, {\n type: legacyEventName,\n seriesId: seriesModel.id,\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\n selected: extend({}, seriesModel.option.selectedMap)\n });\n }\n }\n });\n }\n}\n\nexport function handleLegacySelectEvents(messageCenter, ecIns, api) {\n messageCenter.on('selectchanged', function (params) {\n var ecModel = api.getModel();\n\n if (params.isFromClick) {\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\n } else if (params.fromAction === 'select') {\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\n } else if (params.fromAction === 'unselect') {\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function findEventDispatcher(target, det, returnFirstMatch) {\n var found;\n\n while (target) {\n if (det(target)) {\n found = target;\n\n if (returnFirstMatch) {\n break;\n }\n }\n\n target = target.__hostTarget || target.parent;\n }\n\n return found;\n}","var wmUniqueIndex = Math.round(Math.random() * 9);\nvar WeakMap = (function () {\n function WeakMap() {\n this._id = '__ec_inner_' + wmUniqueIndex++;\n }\n WeakMap.prototype.get = function (key) {\n return this._guard(key)[this._id];\n };\n WeakMap.prototype.set = function (key, value) {\n var target = this._guard(key);\n if (typeof Object.defineProperty === 'function') {\n Object.defineProperty(target, this._id, {\n value: value,\n enumerable: false,\n configurable: true\n });\n }\n else {\n target[this._id] = value;\n }\n return this;\n };\n WeakMap.prototype[\"delete\"] = function (key) {\n if (this.has(key)) {\n delete this._guard(key)[this._id];\n return true;\n }\n return false;\n };\n WeakMap.prototype.has = function (key) {\n return !!this._guard(key)[this._id];\n };\n WeakMap.prototype._guard = function (key) {\n if (key !== Object(key)) {\n throw TypeError('Value of WeakMap is not a non-null object.');\n }\n return key;\n };\n return WeakMap;\n}());\nexport default WeakMap;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Symbol factory\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from './graphic';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { calculateTextPosition } from 'zrender/lib/contain/text';\n/**\n * Triangle shape\n * @inner\n */\n\nvar Triangle = graphic.Path.extend({\n type: 'triangle',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy + height);\n path.lineTo(cx - width, cy + height);\n path.closePath();\n }\n});\n/**\n * Diamond shape\n * @inner\n */\n\nvar Diamond = graphic.Path.extend({\n type: 'diamond',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy);\n path.lineTo(cx, cy + height);\n path.lineTo(cx - width, cy);\n path.closePath();\n }\n});\n/**\n * Pin shape\n * @inner\n */\n\nvar Pin = graphic.Path.extend({\n type: 'pin',\n shape: {\n // x, y on the cusp\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var x = shape.x;\n var y = shape.y;\n var w = shape.width / 5 * 3; // Height must be larger than width\n\n var h = Math.max(w, shape.height);\n var r = w / 2; // Dist on y with tangent point and circle center\n\n var dy = r * r / (h - r);\n var cy = y - h + r + dy;\n var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center\n\n var dx = Math.cos(angle) * r;\n var tanX = Math.sin(angle);\n var tanY = Math.cos(angle);\n var cpLen = r * 0.6;\n var cpLen2 = r * 0.7;\n path.moveTo(x - dx, cy + dy);\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n path.closePath();\n }\n});\n/**\n * Arrow shape\n * @inner\n */\n\nvar Arrow = graphic.Path.extend({\n type: 'arrow',\n shape: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var height = shape.height;\n var width = shape.width;\n var x = shape.x;\n var y = shape.y;\n var dx = width / 3 * 2;\n ctx.moveTo(x, y);\n ctx.lineTo(x + dx, y + height);\n ctx.lineTo(x, y + height / 4 * 3);\n ctx.lineTo(x - dx, y + height);\n ctx.lineTo(x, y);\n ctx.closePath();\n }\n});\n/**\n * Map of path contructors\n */\n// TODO Use function to build symbol path.\n\nvar symbolCtors = {\n line: graphic.Line,\n rect: graphic.Rect,\n roundRect: graphic.Rect,\n square: graphic.Rect,\n circle: graphic.Circle,\n diamond: Diamond,\n pin: Pin,\n arrow: Arrow,\n triangle: Triangle\n};\nvar symbolShapeMakers = {\n line: function (x, y, w, h, shape) {\n shape.x1 = x;\n shape.y1 = y + h / 2;\n shape.x2 = x + w;\n shape.y2 = y + h / 2;\n },\n rect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n },\n roundRect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n shape.r = Math.min(w, h) / 4;\n },\n square: function (x, y, w, h, shape) {\n var size = Math.min(w, h);\n shape.x = x;\n shape.y = y;\n shape.width = size;\n shape.height = size;\n },\n circle: function (x, y, w, h, shape) {\n // Put circle in the center of square\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.r = Math.min(w, h) / 2;\n },\n diamond: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n pin: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n arrow: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n triangle: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n }\n};\nexport var symbolBuildProxies = {};\nzrUtil.each(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, config, rect) {\n var res = calculateTextPosition(out, config, rect);\n var shape = this.shape;\n\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (!proxySymbol) {\n // Default rect\n symbolType = 'rect';\n proxySymbol = symbolBuildProxies[symbolType];\n }\n\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n }\n }\n}); // Provide setColor helper method to avoid determine if set the fill or stroke outside\n\nfunction symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView\n\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n\n this.markRedraw();\n }\n}\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n */\n\n\nexport function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\nkeepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n\n var symbolPath;\n\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n\n symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor\n\n symbolPath.setColor = symbolPathSetColor;\n\n if (color) {\n symbolPath.setColor(color);\n }\n\n return symbolPath;\n}","export function createLinearGradient(ctx, obj, rect) {\n var x = obj.x == null ? 0 : obj.x;\n var x2 = obj.x2 == null ? 1 : obj.x2;\n var y = obj.y == null ? 0 : obj.y;\n var y2 = obj.y2 == null ? 0 : obj.y2;\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n }\n x = isNaN(x) ? 0 : x;\n x2 = isNaN(x2) ? 1 : x2;\n y = isNaN(y) ? 0 : y;\n y2 = isNaN(y2) ? 0 : y2;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\nexport function createRadialGradient(ctx, obj, rect) {\n var width = rect.width;\n var height = rect.height;\n var min = Math.min(width, height);\n var x = obj.x == null ? 0.5 : obj.x;\n var y = obj.y == null ? 0.5 : obj.y;\n var r = obj.r == null ? 0.5 : obj.r;\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\nexport function getCanvasGradient(ctx, obj, rect) {\n var canvasGradient = obj.type === 'radial'\n ? createRadialGradient(ctx, obj, rect)\n : createLinearGradient(ctx, obj, rect);\n var colorStops = obj.colorStops;\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n return canvasGradient;\n}\nexport function isClipPathChanged(clipPaths, prevClipPaths) {\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n return false;\n }\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n return true;\n }\n for (var i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n return false;\n}\n","import { isArray, isNumber } from '../../core/util';\nexport function normalizeLineDash(lineType, lineWidth) {\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n return null;\n }\n lineWidth = lineWidth || 1;\n return lineType === 'dashed'\n ? [4 * lineWidth, 2 * lineWidth]\n : lineType === 'dotted'\n ? [lineWidth]\n : isNumber(lineType)\n ? [lineType] : isArray(lineType) ? lineType : null;\n}\n","import { DEFAULT_COMMON_STYLE } from '../graphic/Displayable';\nimport PathProxy from '../core/PathProxy';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image';\nimport { getCanvasGradient, isClipPathChanged } from './helper';\nimport Path from '../graphic/Path';\nimport ZRImage from '../graphic/Image';\nimport TSpan from '../graphic/TSpan';\nimport { DEFAULT_FONT } from '../contain/text';\nimport { map } from '../core/util';\nimport { normalizeLineDash } from '../graphic/helper/dashStyle';\nimport Element from '../Element';\nimport IncrementalDisplayable from '../graphic/IncrementalDisplayable';\nvar pathProxyForDraw = new PathProxy(true);\nfunction styleHasStroke(style) {\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\nfunction styleHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx, style) {\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.fill();\n }\n}\nfunction doStrokePath(ctx, style) {\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.stroke();\n }\n}\nexport function createCanvasPattern(ctx, pattern, el) {\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\n if (isImageReady(image)) {\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n if (typeof DOMMatrix === 'function'\n && canvasPattern.setTransform) {\n var matrix = new DOMMatrix();\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n canvasPattern.setTransform(matrix);\n }\n return canvasPattern;\n }\n}\nfunction brushPath(ctx, el, style, inBatch) {\n var hasStroke = styleHasStroke(style);\n var hasFill = styleHasFill(style);\n var strokePercent = style.strokePercent;\n var strokePart = strokePercent < 1;\n var firstDraw = !el.path;\n if ((!el.silent || strokePart) && firstDraw) {\n el.createPathProxy();\n }\n var path = el.path || pathProxyForDraw;\n if (!inBatch) {\n var fill = style.fill;\n var stroke = style.stroke;\n var hasFillGradient = hasFill && !!fill.colorStops;\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n var hasFillPattern = hasFill && !!fill.image;\n var hasStrokePattern = hasStroke && !!stroke.image;\n var fillGradient = void 0;\n var strokeGradient = void 0;\n var fillPattern = void 0;\n var strokePattern = void 0;\n var rect = void 0;\n if (hasFillGradient || hasStrokeGradient) {\n rect = el.getBoundingRect();\n }\n if (hasFillGradient) {\n fillGradient = el.__dirty\n ? getCanvasGradient(ctx, fill, rect)\n : el.__canvasFillGradient;\n el.__canvasFillGradient = fillGradient;\n }\n if (hasStrokeGradient) {\n strokeGradient = el.__dirty\n ? getCanvasGradient(ctx, stroke, rect)\n : el.__canvasStrokeGradient;\n el.__canvasStrokeGradient = strokeGradient;\n }\n if (hasFillPattern) {\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\n ? createCanvasPattern(ctx, fill, el)\n : el.__canvasFillPattern;\n el.__canvasFillPattern = fillPattern;\n }\n if (hasStrokePattern) {\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\n ? createCanvasPattern(ctx, stroke, el)\n : el.__canvasStrokePattern;\n el.__canvasStrokePattern = fillPattern;\n }\n if (hasFillGradient) {\n ctx.fillStyle = fillGradient;\n }\n else if (hasFillPattern) {\n if (fillPattern) {\n ctx.fillStyle = fillPattern;\n }\n else {\n hasFill = false;\n }\n }\n if (hasStrokeGradient) {\n ctx.strokeStyle = strokeGradient;\n }\n else if (hasStrokePattern) {\n if (strokePattern) {\n ctx.strokeStyle = strokePattern;\n }\n else {\n hasStroke = false;\n }\n }\n }\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n var lineDashOffset = style.lineDashOffset;\n var ctxLineDash = !!ctx.setLineDash;\n var scale = el.getGlobalScale();\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n if (lineDash) {\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale_1 && lineScale_1 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale_1;\n });\n lineDashOffset /= lineScale_1;\n }\n }\n var needsRebuild = true;\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\n || (lineDash && !ctxLineDash && hasStroke)) {\n path.setDPR(ctx.dpr);\n if (strokePart) {\n path.setContext(null);\n }\n else {\n path.setContext(ctx);\n needsRebuild = false;\n }\n path.reset();\n if (lineDash && !ctxLineDash) {\n path.setLineDash(lineDash);\n path.setLineDashOffset(lineDashOffset);\n }\n el.buildPath(path, el.shape, inBatch);\n path.toStatic();\n el.pathUpdated();\n }\n if (needsRebuild) {\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n }\n if (lineDash && ctxLineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (!inBatch) {\n if (style.strokeFirst) {\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n if (hasFill) {\n doFillPath(ctx, style);\n }\n }\n else {\n if (hasFill) {\n doFillPath(ctx, style);\n }\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n }\n }\n if (lineDash && ctxLineDash) {\n ctx.setLineDash([]);\n }\n}\nfunction brushImage(ctx, el, style) {\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\n if (!image || !isImageReady(image)) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var width = el.getWidth();\n var height = el.getHeight();\n var aspect = image.width / image.height;\n if (width == null && height != null) {\n width = height * aspect;\n }\n else if (height == null && width != null) {\n height = width / aspect;\n }\n else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n }\n if (style.sWidth && style.sHeight) {\n var sx = style.sx || 0;\n var sy = style.sy || 0;\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n }\n else if (style.sx && style.sy) {\n var sx = style.sx;\n var sy = style.sy;\n var sWidth = width - sx;\n var sHeight = height - sy;\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n }\n else {\n ctx.drawImage(image, x, y, width, height);\n }\n}\nfunction brushText(ctx, el, style) {\n var text = style.text;\n text != null && (text += '');\n if (text) {\n ctx.font = style.font || DEFAULT_FONT;\n ctx.textAlign = style.textAlign;\n ctx.textBaseline = style.textBaseline;\n var hasLineDash = void 0;\n if (ctx.setLineDash) {\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n var lineDashOffset = style.lineDashOffset;\n if (lineDash) {\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale_2 && lineScale_2 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale_2;\n });\n lineDashOffset /= lineScale_2;\n }\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n hasLineDash = true;\n }\n }\n if (style.strokeFirst) {\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n }\n else {\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n }\n if (hasLineDash) {\n ctx.setLineDash([]);\n }\n }\n}\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nvar STROKE_PROPS = [\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n];\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\n var styleChanged = false;\n if (!forceSetAll) {\n prevStyle = prevStyle || {};\n if (style === prevStyle) {\n return false;\n }\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n var opacity = Math.max(Math.min(style.opacity, 1), 0);\n ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n }\n if (forceSetAll || style.blend !== prevStyle.blend) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n }\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n var propName = SHADOW_NUMBER_PROPS[i];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = ctx.dpr * (style[propName] || 0);\n }\n }\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n }\n return styleChanged;\n}\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\n var style = getStyle(el, scope.inHover);\n var prevStyle = forceSetAll\n ? null\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\n if (style === prevStyle) {\n return false;\n }\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n if (forceSetAll || style.fill !== prevStyle.fill) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.fillStyle = style.fill;\n }\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.strokeStyle = style.stroke;\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n if (el.hasStroke()) {\n var lineWidth = style.lineWidth;\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\n if (ctx.lineWidth !== newLineWidth) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.lineWidth = newLineWidth;\n }\n }\n for (var i = 0; i < STROKE_PROPS.length; i++) {\n var prop = STROKE_PROPS[i];\n var propName = prop[0];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = style[propName] || prop[1];\n }\n }\n return styleChanged;\n}\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\n}\nfunction setContextTransform(ctx, el) {\n var m = el.transform;\n var dpr = ctx.dpr || 1;\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n }\n else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n}\nfunction updateClipStatus(clipPaths, ctx, scope) {\n var allClipped = false;\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n allClipped = allClipped || clipPath.isZeroArea();\n setContextTransform(ctx, clipPath);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip();\n }\n scope.allClipped = allClipped;\n}\nfunction isTransformChanged(m0, m1) {\n if (m0 && m1) {\n return m0[0] !== m1[0]\n || m0[1] !== m1[1]\n || m0[2] !== m1[2]\n || m0[3] !== m1[3]\n || m0[4] !== m1[4]\n || m0[5] !== m1[5];\n }\n else if (!m0 && !m1) {\n return false;\n }\n return true;\n}\nvar DRAW_TYPE_PATH = 1;\nvar DRAW_TYPE_IMAGE = 2;\nvar DRAW_TYPE_TEXT = 3;\nvar DRAW_TYPE_INCREMENTAL = 4;\nfunction canPathBatch(style) {\n var hasFill = styleHasFill(style);\n var hasStroke = styleHasStroke(style);\n return !(style.lineDash\n || !(+hasFill ^ +hasStroke)\n || (hasFill && typeof style.fill !== 'string')\n || (hasStroke && typeof style.stroke !== 'string')\n || style.strokePercent < 1\n || style.strokeOpacity < 1\n || style.fillOpacity < 1);\n}\nfunction flushPathDrawn(ctx, scope) {\n scope.batchFill && ctx.fill();\n scope.batchStroke && ctx.stroke();\n scope.batchFill = '';\n scope.batchStroke = '';\n}\nfunction getStyle(el, inHover) {\n return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\nexport function brushSingle(ctx, el) {\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\nexport function brush(ctx, el, scope, isLast) {\n var m = el.transform;\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n el.__dirty &= ~Element.REDARAW_BIT;\n el.__isRendered = false;\n return;\n }\n var clipPaths = el.__clipPaths;\n var prevElClipPaths = scope.prevElClipPaths;\n var forceSetTransform = false;\n var forceSetStyle = false;\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n if (prevElClipPaths && prevElClipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.restore();\n forceSetStyle = forceSetTransform = true;\n scope.prevElClipPaths = null;\n scope.allClipped = false;\n scope.prevEl = null;\n }\n if (clipPaths && clipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.save();\n updateClipStatus(clipPaths, ctx, scope);\n forceSetTransform = true;\n }\n scope.prevElClipPaths = clipPaths;\n }\n if (scope.allClipped) {\n el.__isRendered = false;\n return;\n }\n el.beforeBrush && el.beforeBrush();\n el.innerBeforeBrush();\n var prevEl = scope.prevEl;\n if (!prevEl) {\n forceSetStyle = forceSetTransform = true;\n }\n var canBatchPath = el instanceof Path\n && el.autoBatch\n && canPathBatch(el.style);\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n flushPathDrawn(ctx, scope);\n setContextTransform(ctx, el);\n }\n else if (!canBatchPath) {\n flushPathDrawn(ctx, scope);\n }\n var style = getStyle(el, scope.inHover);\n if (el instanceof Path) {\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_PATH;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n ctx.beginPath();\n }\n brushPath(ctx, el, style, canBatchPath);\n if (canBatchPath) {\n scope.batchFill = style.fill || '';\n scope.batchStroke = style.stroke || '';\n }\n }\n else {\n if (el instanceof TSpan) {\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_TEXT;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushText(ctx, el, style);\n }\n else if (el instanceof ZRImage) {\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_IMAGE;\n }\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushImage(ctx, el, style);\n }\n else if (el instanceof IncrementalDisplayable) {\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n }\n brushIncremental(ctx, el, scope);\n }\n }\n if (canBatchPath && isLast) {\n flushPathDrawn(ctx, scope);\n }\n el.innerAfterBrush();\n el.afterBrush && el.afterBrush();\n scope.prevEl = el;\n el.__dirty = 0;\n el.__isRendered = true;\n}\nfunction brushIncremental(ctx, el, scope) {\n var displayables = el.getDisplayables();\n var temporalDisplayables = el.getTemporalDisplayables();\n ctx.save();\n var innerScope = {\n prevElClipPaths: null,\n prevEl: null,\n allClipped: false,\n viewWidth: scope.viewWidth,\n viewHeight: scope.viewHeight,\n inHover: scope.inHover\n };\n var i;\n var len;\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n var displayable = displayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\n var displayable = temporalDisplayables[i_1];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n el.clearTemporalDisplayables();\n el.notClear = true;\n ctx.restore();\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport WeakMap from 'zrender/lib/core/WeakMap';\nimport LRU from 'zrender/lib/core/LRU';\nimport { defaults, createCanvas, map, isArray } from 'zrender/lib/core/util';\nimport { getLeastCommonMultiple } from './number';\nimport { createSymbol } from './symbol';\nimport { brushSingle } from 'zrender/lib/canvas/graphic';\nvar decalMap = new WeakMap();\nvar decalCache = new LRU(100);\nvar decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight'];\n/**\n * Create or update pattern image from decal options\n *\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\n * @return {Pattern} pattern with generated image, null if no decal\n */\n\nexport function createOrUpdatePatternFromDecal(decalObject, api) {\n if (decalObject === 'none') {\n return null;\n }\n\n var dpr = api.getDevicePixelRatio();\n var zr = api.getZr();\n var isSVG = zr.painter.type === 'svg';\n\n if (decalObject.dirty) {\n decalMap[\"delete\"](decalObject);\n }\n\n var oldPattern = decalMap.get(decalObject);\n\n if (oldPattern) {\n return oldPattern;\n }\n\n var decalOpt = defaults(decalObject, {\n symbol: 'rect',\n symbolSize: 1,\n symbolKeepAspect: true,\n color: 'rgba(0, 0, 0, 0.2)',\n backgroundColor: null,\n dashArrayX: 5,\n dashArrayY: 5,\n rotation: 0,\n maxTileWidth: 512,\n maxTileHeight: 512\n });\n\n if (decalOpt.backgroundColor === 'none') {\n decalOpt.backgroundColor = null;\n }\n\n var pattern = {\n repeat: 'repeat'\n };\n setPatternnSource(pattern);\n pattern.rotation = decalOpt.rotation;\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\n decalMap.set(decalObject, pattern);\n decalObject.dirty = false;\n return pattern;\n\n function setPatternnSource(pattern) {\n var keys = [dpr];\n var isValidKey = true;\n\n for (var i = 0; i < decalKeys.length; ++i) {\n var value = decalOpt[decalKeys[i]];\n var valueType = typeof value;\n\n if (value != null && !isArray(value) && valueType !== 'string' && valueType !== 'number' && valueType !== 'boolean') {\n isValidKey = false;\n break;\n }\n\n keys.push(value);\n }\n\n var cacheKey;\n\n if (isValidKey) {\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\n var cache = decalCache.get(cacheKey);\n\n if (cache) {\n isSVG ? pattern.svgElement = cache : pattern.image = cache;\n }\n }\n\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\n var canvas = !isSVG && createCanvas();\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\n var pSize = getPatternSize();\n var ctx;\n\n if (canvas) {\n canvas.width = pSize.width * dpr;\n canvas.height = pSize.height * dpr;\n ctx = canvas.getContext('2d');\n }\n\n brushDecal();\n\n if (isValidKey) {\n decalCache.put(cacheKey, canvas || svgRoot);\n }\n\n pattern.image = canvas;\n pattern.svgElement = svgRoot;\n pattern.svgWidth = pSize.width;\n pattern.svgHeight = pSize.height;\n /**\n * Get minumum length that can make a repeatable pattern.\n *\n * @return {Object} pattern width and height\n */\n\n function getPatternSize() {\n /**\n * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\n * |--- --- --- --- --- ...\n * |-- -- -- -- -- -- -- -- ...\n * |--- --- --- --- --- ...\n * |-- -- -- -- -- -- -- -- ...\n * So the minumum length of X is 15,\n * which is the least common multiple of `3 + 2` and `2 + 1`\n * |--- --- --- |--- --- ...\n * |-- -- -- -- -- |-- -- -- ...\n */\n var width = 1;\n\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\n }\n\n var symbolRepeats = 1;\n\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\n }\n\n width *= symbolRepeats;\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\n\n if (process.env.NODE_ENV !== 'production') {\n var warn = function (attrName) {\n /* eslint-disable-next-line */\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\n };\n\n if (width > decalOpt.maxTileWidth) {\n warn('maxTileWidth');\n }\n\n if (height > decalOpt.maxTileHeight) {\n warn('maxTileHeight');\n }\n }\n\n return {\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\n };\n }\n\n function brushDecal() {\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (decalOpt.backgroundColor) {\n ctx.fillStyle = decalOpt.backgroundColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n }\n\n var ySum = 0;\n\n for (var i = 0; i < dashArrayY.length; ++i) {\n ySum += dashArrayY[i];\n }\n\n if (ySum <= 0) {\n // dashArrayY is 0, draw nothing\n return;\n }\n\n var y = -lineBlockLengthY;\n var yId = 0;\n var yIdTotal = 0;\n var xId0 = 0;\n\n while (y < pSize.height) {\n if (yId % 2 === 0) {\n var symbolYId = yIdTotal / 2 % symbolArray.length;\n var x = 0;\n var xId1 = 0;\n var xId1Total = 0;\n\n while (x < pSize.width * 2) {\n var xSum = 0;\n\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\n xSum += dashArrayX[xId0][i];\n }\n\n if (xSum <= 0) {\n // Skip empty line\n break;\n } // E.g., [15, 5, 20, 5] draws only for 15 and 20\n\n\n if (xId1 % 2 === 0) {\n var size = (1 - decalOpt.symbolSize) * 0.5;\n var left = x + dashArrayX[xId0][xId1] * size;\n var top_1 = y + dashArrayY[yId] * size;\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\n var height = dashArrayY[yId] * decalOpt.symbolSize;\n var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\n }\n\n x += dashArrayX[xId0][xId1];\n ++xId1Total;\n ++xId1;\n\n if (xId1 === dashArrayX[xId0].length) {\n xId1 = 0;\n }\n }\n\n ++xId0;\n\n if (xId0 === dashArrayX.length) {\n xId0 = 0;\n }\n }\n\n y += dashArrayY[yId];\n ++yIdTotal;\n ++yId;\n\n if (yId === dashArrayY.length) {\n yId = 0;\n }\n }\n\n function brushSymbol(x, y, width, height, symbolType) {\n var scale = isSVG ? 1 : dpr;\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\n\n if (isSVG) {\n svgRoot.appendChild(zr.painter.paintOne(symbol));\n } else {\n // Paint to canvas for all other renderers.\n brushSingle(ctx, symbol);\n }\n }\n }\n }\n}\n/**\n * Convert symbol array into normalized array\n *\n * @param {string | (string | string[])[]} symbol symbol input\n * @return {string[][]} normolized symbol array\n */\n\nfunction normalizeSymbolArray(symbol) {\n if (!symbol || symbol.length === 0) {\n return [['rect']];\n }\n\n if (typeof symbol === 'string') {\n return [[symbol]];\n }\n\n var isAllString = true;\n\n for (var i = 0; i < symbol.length; ++i) {\n if (typeof symbol[i] !== 'string') {\n isAllString = false;\n break;\n }\n }\n\n if (isAllString) {\n return normalizeSymbolArray([symbol]);\n }\n\n var result = [];\n\n for (var i = 0; i < symbol.length; ++i) {\n if (typeof symbol[i] === 'string') {\n result.push([symbol[i]]);\n } else {\n result.push(symbol[i]);\n }\n }\n\n return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayX} dash dash input\n * @return {number[][]} normolized dash array\n */\n\n\nfunction normalizeDashArrayX(dash) {\n if (!dash || dash.length === 0) {\n return [[0, 0]];\n }\n\n if (typeof dash === 'number') {\n var dashValue = Math.ceil(dash);\n return [[dashValue, dashValue]];\n }\n /**\n * [20, 5] should be normalized into [[20, 5]],\n * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\n */\n\n\n var isAllNumber = true;\n\n for (var i = 0; i < dash.length; ++i) {\n if (typeof dash[i] !== 'number') {\n isAllNumber = false;\n break;\n }\n }\n\n if (isAllNumber) {\n return normalizeDashArrayX([dash]);\n }\n\n var result = [];\n\n for (var i = 0; i < dash.length; ++i) {\n if (typeof dash[i] === 'number') {\n var dashValue = Math.ceil(dash[i]);\n result.push([dashValue, dashValue]);\n } else {\n var dashValue = map(dash[i], function (n) {\n return Math.ceil(n);\n });\n\n if (dashValue.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // so normalize it to be [4, 2, 1, 4, 2, 1]\n result.push(dashValue.concat(dashValue));\n } else {\n result.push(dashValue);\n }\n }\n }\n\n return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayY} dash dash input\n * @return {number[]} normolized dash array\n */\n\n\nfunction normalizeDashArrayY(dash) {\n if (!dash || typeof dash === 'object' && dash.length === 0) {\n return [0, 0];\n }\n\n if (typeof dash === 'number') {\n var dashValue_1 = Math.ceil(dash);\n return [dashValue_1, dashValue_1];\n }\n\n var dashValue = map(dash, function (n) {\n return Math.ceil(n);\n });\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\n}\n/**\n * Get block length of each line. A block is the length of dash line and space.\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\n * that, so the block length of this line is 5.\n *\n * @param {number[][]} dash dash arrary of X or Y\n * @return {number[]} block length of each line\n */\n\n\nfunction getLineBlockLengthX(dash) {\n return map(dash, function (line) {\n return getLineBlockLengthY(line);\n });\n}\n\nfunction getLineBlockLengthY(dash) {\n var blockLength = 0;\n\n for (var i = 0; i < dash.length; ++i) {\n blockLength += dash[i];\n }\n\n if (dash.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // So total length is (4 + 2 + 1) * 2\n return blockLength * 2;\n }\n\n return blockLength;\n}","import Group from '../graphic/Group';\nimport ZRImage from '../graphic/Image';\nimport Circle from '../graphic/shape/Circle';\nimport Rect from '../graphic/shape/Rect';\nimport Ellipse from '../graphic/shape/Ellipse';\nimport Line from '../graphic/shape/Line';\nimport Polygon from '../graphic/shape/Polygon';\nimport Polyline from '../graphic/shape/Polyline';\nimport * as matrix from '../core/matrix';\nimport { createFromString } from './path';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util';\nimport LinearGradient from '../graphic/LinearGradient';\nimport RadialGradient from '../graphic/RadialGradient';\nimport TSpan from '../graphic/TSpan';\nimport { parseXML } from './parseXML';\n;\nvar nodeParsers;\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-anchor': 'textAlign',\n 'visibility': 'visibility',\n 'display': 'display'\n};\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\nvar SELF_STYLE_ATTRIBUTES_MAP = {\n 'alignment-baseline': 'textBaseline',\n 'stop-color': 'stopColor'\n};\nvar SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\nvar SVGParser = (function () {\n function SVGParser() {\n this._defs = {};\n this._root = null;\n }\n SVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n if (!svg) {\n throw new Error('Illegal svg');\n }\n this._defsUsePending = [];\n var root = new Group();\n this._root = root;\n var named = [];\n var viewBox = svg.getAttribute('viewBox') || '';\n var width = parseFloat((svg.getAttribute('width') || opt.width));\n var height = parseFloat((svg.getAttribute('height') || opt.height));\n isNaN(width) && (width = null);\n isNaN(height) && (height = null);\n parseAttributes(svg, root, null, true, false);\n var child = svg.firstChild;\n while (child) {\n this._parseNode(child, root, named, null, false, false);\n child = child.nextSibling;\n }\n applyDefs(this._defs, this._defsUsePending);\n this._defsUsePending = [];\n var viewBoxRect;\n var viewBoxTransform;\n if (viewBox) {\n var viewBoxArr = splitNumberSequence(viewBox);\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat((viewBoxArr[0] || 0)),\n y: parseFloat((viewBoxArr[1] || 0)),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n if (!opt.ignoreViewBox) {\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n elRoot.x = viewBoxTransform.x;\n elRoot.y = viewBoxTransform.y;\n }\n }\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: { x: 0, y: 0, width: width, height: height }\n }));\n }\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform,\n named: named\n };\n };\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {\n var nodeName = xmlNode.nodeName.toLowerCase();\n var el;\n var namedFromForSub = namedFrom;\n if (nodeName === 'defs') {\n isInDefs = true;\n }\n if (nodeName === 'text') {\n isInText = true;\n }\n if (nodeName === 'defs' || nodeName === 'switch') {\n el = parentGroup;\n }\n else {\n if (!isInDefs) {\n var parser_1 = nodeParsers[nodeName];\n if (parser_1 && hasOwn(nodeParsers, nodeName)) {\n el = parser_1.call(this, xmlNode, parentGroup);\n var nameAttr = xmlNode.getAttribute('name');\n if (nameAttr) {\n var newNamed = {\n name: nameAttr,\n namedFrom: null,\n svgNodeTagLower: nodeName,\n el: el\n };\n named.push(newNamed);\n if (nodeName === 'g') {\n namedFromForSub = newNamed;\n }\n }\n else if (namedFrom) {\n named.push({\n name: namedFrom.name,\n namedFrom: namedFrom,\n svgNodeTagLower: nodeName,\n el: el\n });\n }\n parentGroup.add(el);\n }\n }\n var parser = paintServerParsers[nodeName];\n if (parser && hasOwn(paintServerParsers, nodeName)) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n if (id) {\n this._defs[id] = def;\n }\n }\n }\n if (el && el.isGroup) {\n var child = xmlNode.firstChild;\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);\n }\n else if (child.nodeType === 3 && isInText) {\n this._parseText(child, el);\n }\n child = child.nextSibling;\n }\n }\n };\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n var text = new TSpan({\n style: {\n text: xmlNode.textContent\n },\n silent: true,\n x: this._textX || 0,\n y: this._textY || 0\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n applyTextAlignment(text, parentGroup);\n var textStyle = text.style;\n var fontSize = textStyle.fontSize;\n if (fontSize && fontSize < 9) {\n textStyle.fontSize = 9;\n text.scaleX *= fontSize / 9;\n text.scaleY *= fontSize / 9;\n }\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\n textStyle.fontStyle,\n textStyle.fontWeight,\n (textStyle.fontSize || 12) + 'px',\n textStyle.fontFamily || 'sans-serif'\n ].join(' ');\n textStyle.font = font;\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n };\n SVGParser.internalField = (function () {\n nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\n height: parseFloat(xmlNode.getAttribute('height') || '0')\n });\n rect.silent = true;\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n r: parseFloat(xmlNode.getAttribute('r') || '0')\n });\n circle.silent = true;\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n });\n line.silent = true;\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n });\n ellipse.silent = true;\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polygon = new Polygon({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polyline = new Polyline({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polyline);\n parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZRImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href'),\n x: +xmlNode.getAttribute('x'),\n y: +xmlNode.getAttribute('y'),\n width: +xmlNode.getAttribute('width'),\n height: +xmlNode.getAttribute('height')\n });\n img.silent = true;\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || '0';\n var y = xmlNode.getAttribute('y') || '0';\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n if (x != null) {\n this._textX = parseFloat(x);\n }\n if (y != null) {\n this._textY = parseFloat(y);\n }\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n var d = xmlNode.getAttribute('d') || '';\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n path.silent = true;\n return path;\n }\n };\n })();\n return SVGParser;\n}());\nvar paintServerParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n },\n 'radialgradient': function (xmlNode) {\n var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n var r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n var gradient = new RadialGradient(cx, cy, r);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n }\n};\nfunction parsePaintServerUnit(xmlNode, gradient) {\n var gradientUnits = xmlNode.getAttribute('gradientUnits');\n if (gradientUnits === 'userSpaceOnUse') {\n gradient.global = true;\n }\n}\nfunction parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n while (stop) {\n if (stop.nodeType === 1\n && stop.nodeName.toLocaleLowerCase() === 'stop') {\n var offsetStr = stop.getAttribute('offset');\n var offset = void 0;\n if (offsetStr && offsetStr.indexOf('%') > 0) {\n offset = parseInt(offsetStr, 10) / 100;\n }\n else if (offsetStr) {\n offset = parseFloat(offsetStr);\n }\n else {\n offset = 0;\n }\n var styleVals = {};\n parseInlineStyle(stop, styleVals, styleVals);\n var stopColor = styleVals.stopColor\n || stop.getAttribute('stop-color')\n || '#000000';\n gradient.colorStops.push({\n offset: offset,\n color: stopColor\n });\n }\n stop = stop.nextSibling;\n }\n}\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\nfunction parsePoints(pointsString) {\n var list = splitNumberSequence(pointsString);\n var points = [];\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n return points;\n}\nfunction parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {\n var disp = el;\n var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n var selfStyle = {};\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n if (!onlyInlineStyle) {\n parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n }\n }\n disp.style = disp.style || {};\n if (inheritedStyle.fill != null) {\n disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n }\n if (inheritedStyle.stroke != null) {\n disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n }\n each([\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = parseFloat(inheritedStyle[propName]);\n }\n });\n each([\n 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = inheritedStyle[propName];\n }\n });\n if (isTextGroup) {\n disp.__selfStyle = selfStyle;\n }\n if (inheritedStyle.lineDash) {\n disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n return parseFloat(str);\n });\n }\n if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n disp.invisible = true;\n }\n if (inheritedStyle.display === 'none') {\n disp.ignore = true;\n }\n disp.z = -10000;\n disp.z2 = -1000;\n}\nfunction applyTextAlignment(text, parentGroup) {\n var parentSelfStyle = parentGroup.__selfStyle;\n if (parentSelfStyle) {\n var textBaseline = parentSelfStyle.textBaseline;\n var zrTextBaseline = textBaseline;\n if (!textBaseline || textBaseline === 'auto') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'baseline') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n zrTextBaseline = 'top';\n }\n else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n zrTextBaseline = 'bottom';\n }\n else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n zrTextBaseline = 'middle';\n }\n text.style.textBaseline = zrTextBaseline;\n }\n var parentInheritedStyle = parentGroup.__inheritedStyle;\n if (parentInheritedStyle) {\n var textAlign = parentInheritedStyle.textAlign;\n var zrTextAlign = textAlign;\n if (textAlign) {\n if (textAlign === 'middle') {\n zrTextAlign = 'center';\n }\n text.style.textAlign = zrTextAlign;\n }\n }\n}\nvar urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(el, method, str, defsUsePending) {\n var urlMatch = str && str.match(urlRegex);\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n defsUsePending.push([el, method, url]);\n return;\n }\n if (str === 'none') {\n str = null;\n }\n return str;\n}\nfunction applyDefs(defs, defsUsePending) {\n for (var i = 0; i < defsUsePending.length; i++) {\n var item = defsUsePending[i];\n item[0].style[item[1]] = defs[item[2]];\n }\n}\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr) {\n return rawStr.match(numberReg) || [];\n}\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var transformOps_1 = [];\n var mt = null;\n transform.replace(transformRegex, function (str, type, value) {\n transformOps_1.push(type, value);\n return '';\n });\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\n var value = transformOps_1[i];\n var type = transformOps_1[i - 1];\n var valueArr = void 0;\n mt = mt || matrix.create();\n switch (type) {\n case 'translate':\n valueArr = splitNumberSequence(value);\n matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n break;\n case 'scale':\n valueArr = splitNumberSequence(value);\n matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n break;\n case 'rotate':\n valueArr = splitNumberSequence(value);\n matrix.rotate(mt, mt, -parseFloat(valueArr[0]) / 180 * Math.PI);\n break;\n case 'skew':\n valueArr = splitNumberSequence(value);\n console.warn('Skew transform is not supported yet');\n break;\n case 'matrix':\n valueArr = splitNumberSequence(value);\n mt[0] = parseFloat(valueArr[0]);\n mt[1] = parseFloat(valueArr[1]);\n mt[2] = parseFloat(valueArr[2]);\n mt[3] = parseFloat(valueArr[3]);\n mt[4] = parseFloat(valueArr[4]);\n mt[5] = parseFloat(valueArr[5]);\n break;\n }\n }\n node.setLocalTransform(mt);\n }\n}\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n var style = xmlNode.getAttribute('style');\n if (!style) {\n return;\n }\n styleRegex.lastIndex = 0;\n var styleRegResult;\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n var svgStlAttr = styleRegResult[1];\n var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrInheritableStlAttr) {\n inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n }\n var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrSelfStlAttr) {\n selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n }\n }\n}\nfunction parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n}\nexport function makeViewBoxTransform(viewBoxRect, boundingRect) {\n var scaleX = boundingRect.width / viewBoxRect.width;\n var scaleY = boundingRect.height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY);\n return {\n scale: scale,\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n };\n}\nexport function parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\nexport { parseXML };\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createOrUpdatePatternFromDecal } from '../util/decal';\nexport default function decalVisual(ecModel, api) {\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n if (data.hasItemVisual()) {\n data.each(function (idx) {\n var decal = data.getItemVisual(idx, 'decal');\n\n if (decal) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n }\n\n var decal = data.getVisual('decal');\n\n if (decal) {\n var style = data.getVisual('style');\n style.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n}","import { isString } from '../core/util';\nexport function parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n }\n var svgNode = svg;\n if (svgNode.nodeType === 9) {\n svgNode = svgNode.firstChild;\n }\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n svgNode = svgNode.nextSibling;\n }\n return svgNode;\n}\n","import windingLine from './windingLine';\nvar EPSILON = 1e-8;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nexport function contain(points, x, y) {\n var w = 0;\n var p = points[0];\n if (!p) {\n return false;\n }\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n }\n var p0 = points[0];\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n return w !== 0;\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport * as bbox from 'zrender/lib/core/bbox';\nimport * as vec2 from 'zrender/lib/core/vector';\nimport * as polygonContain from 'zrender/lib/contain/polygon';\nimport * as matrix from 'zrender/lib/core/matrix';\nvar TMP_TRANSFORM = [];\n\nvar Region =\n/** @class */\nfunction () {\n function Region(name) {\n this.name = name;\n }\n /**\n * Get center point in data unit. That is,\n * for GeoJSONRegion, the unit is lat/lng,\n * for GeoSVGRegion, the unit is SVG local coord.\n */\n\n\n Region.prototype.getCenter = function () {\n return;\n };\n\n return Region;\n}();\n\nexport { Region };\n\nvar GeoJSONRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoJSONRegion, _super);\n\n function GeoJSONRegion(name, geometries, cp) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoJSON';\n _this.geometries = geometries;\n\n if (!cp) {\n var rect = _this.getBoundingRect();\n\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n\n _this._center = cp;\n return _this;\n }\n\n GeoJSONRegion.prototype.getBoundingRect = function () {\n var rect = this._rect;\n\n if (rect) {\n return rect;\n }\n\n var MAX_NUMBER = Number.MAX_VALUE;\n var min = [MAX_NUMBER, MAX_NUMBER];\n var max = [-MAX_NUMBER, -MAX_NUMBER];\n var min2 = [];\n var max2 = [];\n var geometries = this.geometries;\n var i = 0;\n\n for (; i < geometries.length; i++) {\n // Only support polygon\n if (geometries[i].type !== 'polygon') {\n continue;\n } // Doesn't consider hole\n\n\n var exterior = geometries[i].exterior;\n bbox.fromPoints(exterior, min2, max2);\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return this._rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n\n GeoJSONRegion.prototype.contain = function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n };\n\n GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n for (var p = 0; p < exterior.length; p++) {\n vec2.applyTransform(exterior[p], exterior[p], transform);\n }\n\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\n for (var p = 0; p < interiors[h].length; p++) {\n vec2.applyTransform(interiors[h][p], interiors[h][p], transform);\n }\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.cloneShallow = function (name) {\n name == null && (name = this.name);\n var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n };\n\n GeoJSONRegion.prototype.getCenter = function () {\n return this._center;\n };\n\n GeoJSONRegion.prototype.setCenter = function (center) {\n this._center = center;\n };\n\n return GeoJSONRegion;\n}(Region);\n\nexport { GeoJSONRegion };\n\nvar GeoSVGRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoSVGRegion, _super);\n\n function GeoSVGRegion(name, elOnlyForCalculate) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoSVG';\n _this._elOnlyForCalculate = elOnlyForCalculate;\n return _this;\n }\n\n GeoSVGRegion.prototype.getCenter = function () {\n var center = this._center;\n\n if (!center) {\n // In most cases there are no need to calculate this center.\n // So calculate only when called.\n center = this._center = this._calculateCenter();\n }\n\n return center;\n };\n\n GeoSVGRegion.prototype._calculateCenter = function () {\n var el = this._elOnlyForCalculate;\n var rect = el.getBoundingRect();\n var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n var mat = matrix.identity(TMP_TRANSFORM);\n var target = el;\n\n while (target && !target.isGeoSVGGraphicRoot) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n matrix.invert(mat, mat);\n vec2.applyTransform(center, center, mat);\n return center;\n };\n\n return GeoSVGRegion;\n}(Region);\n\nexport { GeoSVGRegion };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG';\nimport Group from 'zrender/lib/graphic/Group';\nimport Rect from 'zrender/lib/graphic/shape/Rect';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { parseXML } from 'zrender/lib/tool/parseXML';\nimport { GeoSVGRegion } from './Region';\n/**\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\n * to make it be a region.\n * 1. region styles and its label styles can be defined in echarts opton:\n * ```js\n * geo: {\n * regions: [{\n * name: 'xxx',\n * itemStyle: { ... },\n * label: { ... }\n * }, {\n * ...\n * },\n * ...]\n * };\n * ```\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\n * a region option. For exampel if there are two <path> representing two lung lobes. They have\n * no common parents but both of them need to display label \"lung\" inside.\n */\n\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', // <text> <tspan> are also enabled becuase some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan', // <g> is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a <g name=\"xxx\">. Thereby only one label\n// displayed and located based on the bounding rect of the <g>.\n'g']);\n\nvar GeoSVGResource =\n/** @class */\nfunction () {\n function GeoSVGResource(mapName, svg) {\n this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root\n\n this._usedGraphicMap = createHashMap(); // All unused graphics.\n\n this._freedGraphics = [];\n this._mapName = mapName; // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n\n this._parsedXML = parseXML(svg);\n }\n\n GeoSVGResource.prototype.load = function ()\n /* nameMap: NameMap */\n {\n // In the \"load\" stage, graphic need to be built to\n // get boundingRect for geo coordinate system.\n var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created.\n // Because they will be used in geo coordinate system update stage,\n // and `regions` will be mounted at `geo` coordinate system,\n // in which there is no \"view\" info, so that it should better not to\n // make references to graphic elements.\n\n if (!firstGraphic) {\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n\n this._freedGraphics.push(firstGraphic);\n\n this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come.\n // if (nameMap) {\n // named = applyNameMap(named, nameMap);\n // }\n\n var _a = createRegions(firstGraphic.named),\n regions = _a.regions,\n regionsMap = _a.regionsMap;\n\n this._regions = regions;\n this._regionsMap = regionsMap;\n }\n\n return {\n boundingRect: this._boundingRect,\n regions: this._regions,\n regionsMap: this._regionsMap\n };\n };\n\n GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n var result;\n var rootFromParse;\n\n try {\n result = svgXML && parseSVG(svgXML, {\n ignoreViewBox: true,\n ignoreRootClip: true\n }) || {};\n rootFromParse = result.root;\n assert(rootFromParse != null);\n } catch (e) {\n throw new Error('Invalid svg format\\n' + e.message);\n } // Note: we keep the covenant that the root has no transform. So always add an extra root.\n\n\n var root = new Group();\n root.add(rootFromParse);\n root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n //\n // Consider: `<svg width=\"...\" height=\"...\" viewBox=\"...\">`\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n // \"viewport boundingRect\", or `boundingRect` for short.\n // - `viewBox` defines the transform from the real content ot the viewport.\n // `viewBox` has the same unit as the content of SVG.\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n // different from the content of SVG. Otherwise, they are the same.\n //\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n // 1. Make a transform from `viewBox` to `boundingRect`.\n // Note: only suport `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n // the aspect ratio.\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n // (`Geo`/`View` will do this job).\n // Note: this transform might not preserve aspect radio, which depending on how users specify\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n //\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n // layout look good.\n //\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n // of the SVG content and use them to make SVG layout look good.\n\n var svgWidth = result.width;\n var svgHeight = result.height;\n var viewBoxRect = result.viewBoxRect;\n var boundingRect = this._boundingRect;\n\n if (!boundingRect) {\n var bRectX = void 0;\n var bRectY = void 0;\n var bRectWidth = void 0;\n var bRectHeight = void 0;\n\n if (svgWidth != null) {\n bRectX = 0;\n bRectWidth = svgWidth;\n } else if (viewBoxRect) {\n bRectX = viewBoxRect.x;\n bRectWidth = viewBoxRect.width;\n }\n\n if (svgHeight != null) {\n bRectY = 0;\n bRectHeight = svgHeight;\n } else if (viewBoxRect) {\n bRectY = viewBoxRect.y;\n bRectHeight = viewBoxRect.height;\n } // If both viewBox and svgWidth/svgHeight not specified,\n // we have to determine how to layout those element to make them look good.\n\n\n if (bRectX == null || bRectY == null) {\n var calculatedBoundingRect = rootFromParse.getBoundingRect();\n\n if (bRectX == null) {\n bRectX = calculatedBoundingRect.x;\n bRectWidth = calculatedBoundingRect.width;\n }\n\n if (bRectY == null) {\n bRectY = calculatedBoundingRect.y;\n bRectHeight = calculatedBoundingRect.height;\n }\n }\n\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n }\n\n if (viewBoxRect) {\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'`\n\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n rootFromParse.x = viewBoxTransform.x;\n rootFromParse.y = viewBoxTransform.y;\n } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n // They do not strictly confine all of the content inside a display rect, but deliberately\n // use a `viewBox` to define a displayable rect.\n // PENDING:\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n\n\n root.setClipPath(new Rect({\n shape: boundingRect.plain()\n }));\n var named = [];\n each(result.named, function (namedItem) {\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n named.push(namedItem);\n setSilent(namedItem.el);\n }\n });\n return {\n root: root,\n boundingRect: boundingRect,\n named: named\n };\n };\n /**\n * Consider:\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\n * (2) Converting SVG to graphic elements is time consuming.\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\n * and it is called without view info.\n * So we maintain graphic elements in this module, and enables `view` to use/return these\n * graphics from/to the pool with it's uid.\n */\n\n\n GeoSVGResource.prototype.useGraphic = function (hostKey\n /*, nameMap: NameMap */\n ) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n return svgGraphic;\n }\n\n svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation.\n || this._buildGraphic(this._parsedXML);\n usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come.\n // `nameMap` can only be obtained from echarts option.\n // The original `named` must not be modified.\n // if (nameMap) {\n // svgGraphic = extend({}, svgGraphic);\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n // }\n\n return svgGraphic;\n };\n\n GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n usedRootMap.removeKey(hostKey);\n\n this._freedGraphics.push(svgGraphic);\n }\n };\n\n return GeoSVGResource;\n}();\n\nexport { GeoSVGResource };\n\nfunction setSilent(el) {\n // Only named element has silent: false, other elements should\n // act as background and has no user interaction.\n el.silent = false; // text|tspan will be converted to group.\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.silent = false;\n });\n }\n}\n\nfunction createRegions(named) {\n var regions = [];\n var regionsMap = createHashMap(); // Create resions only for the first graphic.\n\n each(named, function (namedItem) {\n // Region has feature to calculate center for tooltip or other features.\n // If there is a <g name=\"xxx\">, the center should be the center of the\n // bounding rect of the g.\n if (namedItem.namedFrom != null) {\n return;\n }\n\n var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on\n // `this`, but can only be created each time `load()` called.\n\n regions.push(region); // PENDING: if multiple tag named with the same name, only one will be\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n // by name. We use `region.getCenter()` as the coordinate.\n\n regionsMap.set(namedItem.name, region);\n });\n return {\n regions: regions,\n regionsMap: regionsMap\n };\n} // PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n// * Use the alias in geoNameMap.\n// * The input `named` must not be modified.\n// */\n// function applyNameMap(\n// named: GeoSVGGraphicRecord['named'],\n// nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n// const result = [] as GeoSVGGraphicRecord['named'];\n// for (let i = 0; i < named.length; i++) {\n// let regionGraphic = named[i];\n// const name = regionGraphic.name;\n// if (nameMap && nameMap.hasOwnProperty(name)) {\n// regionGraphic = extend({}, regionGraphic);\n// regionGraphic.name = name;\n// }\n// result.push(regionGraphic);\n// }\n// return result;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parse and decode geo json\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { GeoJSONRegion } from './Region';\n\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var jsonCompressed = json;\n var encodeScale = jsonCompressed.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = jsonCompressed.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n\n if (geometry.type === 'Polygon') {\n var coordinates = geometry.coordinates;\n\n for (var c = 0; c < coordinates.length; c++) {\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\n }\n } else if (geometry.type === 'MultiPolygon') {\n var coordinates = geometry.coordinates;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n jsonCompressed.UTF8Encoding = false;\n return jsonCompressed;\n}\n\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n\nexport default function parseGeoJSON(geoJson, nameProperty) {\n geoJson = decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\n var coordinates = geo.coordinates;\n geometries.push({\n type: 'polygon',\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n exterior: coordinates[0],\n interiors: coordinates.slice(1)\n });\n }\n\n if (geo.type === 'MultiPolygon') {\n var coordinates = geo.coordinates;\n zrUtil.each(coordinates, function (item) {\n if (item[0]) {\n geometries.push({\n type: 'polygon',\n exterior: item[0],\n interiors: item.slice(1)\n });\n }\n });\n }\n\n var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { GeoJSONRegion } from '../Region';\nvar geoCoord = [126, 25];\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\n\nfor (var i = 0; i < points.length; i++) {\n for (var k = 0; k < points[i].length; k++) {\n points[i][k][0] /= 10.5;\n points[i][k][1] /= -10.5 / 0.75;\n points[i][k][0] += geoCoord[0];\n points[i][k][1] += geoCoord[1];\n }\n}\n\nexport default function fixNanhai(mapType, regions) {\n if (mapType === 'china') {\n regions.push(new GeoJSONRegion('南海诸岛', zrUtil.map(points, function (exterior) {\n return {\n type: 'polygon',\n exterior: exterior\n };\n }), geoCoord));\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar coordsOffsetMap = {\n '南海诸岛': [32, 80],\n // 全国\n '广东': [0, -10],\n '香港': [10, 5],\n '澳门': [-10, 10],\n //'北京': [-10, 0],\n '天津': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n if (mapType === 'china') {\n var coordFix = coordsOffsetMap[region.name];\n\n if (coordFix) {\n var cp = region.getCenter();\n cp[0] += coordFix[0] / 10.5;\n cp[1] += -coordFix[1] / (10.5 / 0.75);\n region.setCenter(cp);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar geoCoordMap = {\n 'Russia': [100, 60],\n 'United States': [-99, 38],\n 'United States of America': [-99, 38]\n};\nexport default function fixGeoCoords(mapType, region) {\n if (mapType === 'world') {\n var geoCoord = geoCoordMap[region.name];\n\n if (geoCoord) {\n var cp = [geoCoord[0], geoCoord[1]];\n region.setCenter(cp);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 钓鱼岛\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n if (mapType === 'china' && region.name === '台湾') {\n region.geometries.push({\n type: 'polygon',\n exterior: points[0]\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString, createHashMap } from 'zrender/lib/core/util';\nimport parseGeoJson from './parseGeoJson'; // Built-in GEO fixer.\n\nimport fixNanhai from './fix/nanhai';\nimport fixTextCoord from './fix/textCoord';\nimport fixGeoCoord from './fix/geoCoord';\nimport fixDiaoyuIsland from './fix/diaoyuIsland';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nvar DEFAULT_NAME_PROPERTY = 'name';\n\nvar GeoJSONResource =\n/** @class */\nfunction () {\n function GeoJSONResource(mapName, geoJSON, specialAreas) {\n this.type = 'geoJSON';\n this._parsedMap = createHashMap();\n this._mapName = mapName;\n this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP?\n\n this._geoJSON = parseInput(geoJSON);\n }\n /**\n * @param nameMap can be null/undefined\n * @param nameProperty can be null/undefined\n */\n\n\n GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n\n var parsed = this._parsedMap.get(nameProperty);\n\n if (!parsed) {\n var rawRegions = this._parseToRegions(nameProperty);\n\n parsed = this._parsedMap.set(nameProperty, {\n regions: rawRegions,\n boundingRect: calculateBoundingRect(rawRegions)\n });\n }\n\n var regionsMap = createHashMap();\n var finalRegions = [];\n each(parsed.regions, function (region) {\n var regionName = region.name; // Try use the alias in geoNameMap\n\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\n region = region.cloneShallow(regionName = nameMap[regionName]);\n }\n\n finalRegions.push(region);\n regionsMap.set(regionName, region);\n });\n return {\n regions: finalRegions,\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n regionsMap: regionsMap\n };\n };\n\n GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n var mapName = this._mapName;\n var geoJSON = this._geoJSON;\n var rawRegions; // https://jsperf.com/try-catch-performance-overhead\n\n try {\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n } catch (e) {\n throw new Error('Invalid geoJson format\\n' + e.message);\n }\n\n fixNanhai(mapName, rawRegions);\n each(rawRegions, function (region) {\n var regionName = region.name;\n fixTextCoord(mapName, region);\n fixGeoCoord(mapName, region);\n fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed\n // to look better\n\n var specialArea = this._specialAreas && this._specialAreas[regionName];\n\n if (specialArea) {\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n }\n }, this);\n return rawRegions;\n };\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n\n\n GeoJSONResource.prototype.getMapForUser = function () {\n return {\n // For backward compatibility, use geoJson\n // PENDING: it has been returning them without clone.\n // do we need to avoid outsite modification?\n geoJson: this._geoJSON,\n geoJSON: this._geoJSON,\n specialAreas: this._specialAreas\n };\n };\n\n return GeoJSONResource;\n}();\n\nexport { GeoJSONResource };\n\nfunction calculateBoundingRect(regions) {\n var rect;\n\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect();\n rect = rect || regionRect.clone();\n rect.union(regionRect);\n }\n\n return rect;\n}\n\nfunction parseInput(source) {\n return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util';\nimport { GeoSVGResource } from './GeoSVGResource';\nimport { GeoJSONResource } from './GeoJSONResource';\nvar storage = createHashMap();\nexport default {\n /**\n * Compatible with previous `echarts.registerMap`.\n *\n * @usage\n * ```js\n *\n * echarts.registerMap('USA', geoJson, specialAreas);\n *\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {...}\n * });\n * echarts.registerMap('USA', {\n * geoJSON: geoJson,\n * specialAreas: {...}\n * });\n *\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * ```\n *\n * Note:\n * Do not support that register multiple geoJSON or SVG\n * one map name. Because different geoJSON and SVG have\n * different unit. It's not easy to make sure how those\n * units are mapping/normalize.\n * If intending to use multiple geoJSON or SVG, we can\n * use multiple geo coordinate system.\n */\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\n if (rawDef.svg) {\n var resource = new GeoSVGResource(mapName, rawDef.svg);\n storage.set(mapName, resource);\n } else {\n // Recommend:\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n // Backward compatibility:\n // echarts.registerMap('eu', geoJSON, specialAreas);\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n\n if (geoJSON && !rawDef.features) {\n rawSpecialAreas = rawDef.specialAreas;\n } else {\n geoJSON = rawDef;\n }\n\n var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n storage.set(mapName, resource);\n }\n },\n getGeoResource: function (mapName) {\n return storage.get(mapName);\n },\n\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n getMapForUser: function (mapName) {\n var resource = storage.get(mapName); // Do not support return SVG until some real requirement come.\n\n return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n },\n load: function (mapName, nameMap, nameProperty) {\n var resource = storage.get(mapName);\n\n if (!resource) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n }\n\n return;\n }\n\n return resource.load(nameMap, nameProperty);\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport * as zrender from 'zrender/lib/zrender';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as colorTool from 'zrender/lib/tool/color';\nimport env from 'zrender/lib/core/env';\nimport timsort from 'zrender/lib/core/timsort';\nimport Eventful from 'zrender/lib/core/Eventful';\nimport GlobalModel from '../model/Global';\nimport ExtensionAPI from './ExtensionAPI';\nimport CoordinateSystemManager from './CoordinateSystem';\nimport OptionManager from '../model/OptionManager';\nimport backwardCompat from '../preprocessor/backwardCompat';\nimport dataStack from '../processor/dataStack';\nimport SeriesModel from '../model/Series';\nimport ComponentView from '../view/Component';\nimport ChartView from '../view/Chart';\nimport * as graphic from '../util/graphic';\nimport { getECData } from '../util/innerStore';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlboalMouseOutForHighDown } from '../util/states';\nimport * as modelUtil from '../util/model';\nimport { throttle } from '../util/throttle';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style';\nimport loadingDefault from '../loading/default';\nimport Scheduler from './Scheduler';\nimport lightTheme from '../theme/light';\nimport darkTheme from '../theme/dark';\nimport { parseClassType } from '../util/clazz';\nimport { ECEventProcessor } from '../util/ECEventProcessor';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper';\nimport LabelManager from '../label/LabelManager';\nimport { deprecateLog, throwError } from '../util/log';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction';\nimport { registerExternalTransform } from '../data/helper/transform';\nimport { createLocaleObject, SYSTEM_LANG } from './locale';\nimport { findEventDispatcher } from '../util/event';\nimport decal from '../visual/decal';\nimport geoSourceManager from '../coord/geo/geoSourceManager';\nvar assert = zrUtil.assert;\nvar each = zrUtil.each;\nvar isFunction = zrUtil.isFunction;\nvar isObject = zrUtil.isObject;\nvar indexOf = zrUtil.indexOf;\nvar hasWindow = typeof window !== 'undefined';\nexport var version = '5.1.1';\nexport var dependencies = {\n zrender: '5.1.0'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800; // Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\n\nvar PRIORITY_PROCESSOR_DATASTACK = 900; // \"Data filter\" will block the stream, so it should be\n// put at the begining of data processing.\n\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000; // Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\n\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; // Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\n\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH,\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n ARIA: PRIORITY_VISUAL_ARIA,\n DECAL: PRIORITY_VISUAL_DECAL\n }\n}; // Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\n\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\nvar OPTION_UPDATED_KEY = '__optionUpdated';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\n;\n\nfunction createRegisterEventWithLowercaseECharts(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.isDisposed()) {\n disposedWarning(this.id);\n return;\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n // `args[0]` is event name. Event name is all lowercase.\n args[0] = args[0] && args[0].toLowerCase();\n return Eventful.prototype[method].apply(host, args);\n}\n\nvar MessageCenter =\n/** @class */\nfunction (_super) {\n __extends(MessageCenter, _super);\n\n function MessageCenter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return MessageCenter;\n}(Eventful);\n\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off'); // ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\n\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar clearColorPalette;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar performPostUpdateFuncs;\nvar createExtensionAPI;\nvar enableConnect;\nvar setTransitionOpt;\nvar markStatusToUpdate;\nvar applyChangedStates;\n\nvar ECharts =\n/** @class */\nfunction (_super) {\n __extends(ECharts, _super);\n\n function ECharts(dom, // Theme name or themeOption.\n theme, opts) {\n var _this = _super.call(this, new ECEventProcessor()) || this;\n\n _this._chartsViews = [];\n _this._chartsMap = {};\n _this._componentsViews = [];\n _this._componentsMap = {}; // Can't dispatch action during rendering procedure\n\n _this._pendingActions = [];\n opts = opts || {}; // Get theme by name\n\n if (typeof theme === 'string') {\n theme = themeStorage[theme];\n }\n\n _this._dom = dom;\n var defaultRenderer = 'canvas';\n var defaultUseDirtyRect = false;\n\n if (process.env.NODE_ENV !== 'production') {\n var root =\n /* eslint-disable-next-line */\n hasWindow ? window : global;\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\n defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect;\n }\n\n var zr = _this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height,\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\n }); // Expect 60 fps.\n\n _this._throttledZrFlush = throttle(zrUtil.bind(zr.flush, zr), 17);\n theme = zrUtil.clone(theme);\n theme && backwardCompat(theme, true);\n _this._theme = theme;\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n _this._coordSysMgr = new CoordinateSystemManager();\n var api = _this._api = createExtensionAPI(_this); // Sort on demand\n\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n _this._messageCenter = new MessageCenter();\n _this._labelManager = new LabelManager(); // Init mouse events\n\n _this._initEvents(); // In case some people write `window.onresize = chart.resize`\n\n\n _this.resize = zrUtil.bind(_this.resize, _this);\n zr.animation.on('frame', _this._onframe, _this);\n bindRenderedEvent(zr, _this);\n bindMouseEvent(zr, _this); // ECharts instance can be used as value.\n\n zrUtil.setAsPrimitive(_this);\n return _this;\n }\n\n ECharts.prototype._onframe = function () {\n if (this._disposed) {\n return;\n }\n\n applyChangedStates(this);\n var scheduler = this._scheduler; // Lazy update\n\n if (this[OPTION_UPDATED_KEY]) {\n var silent = this[OPTION_UPDATED_KEY].silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n prepare(this);\n updateMethods.update.call(this); // At present, in each frame, zrender performs:\n // (1) animation step forward.\n // (2) trigger('frame') (where this `_onframe` is called)\n // (3) zrender flush (render).\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n // will render the final state of the elements before the real animation started.\n\n this._zr.flush();\n\n this[IN_MAIN_PROCESS_KEY] = false;\n this[OPTION_UPDATED_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n } // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold.\n\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determin in the first frame (the\n // frame is executed immedietely after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain');\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event.\n\n\n if (!scheduler.unfinished) {\n this._zr.flush();\n } // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n\n }\n };\n\n ECharts.prototype.getDom = function () {\n return this._dom;\n };\n\n ECharts.prototype.getId = function () {\n return this.id;\n };\n\n ECharts.prototype.getZr = function () {\n return this._zr;\n };\n /* eslint-disable-next-line */\n\n\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var silent;\n var replaceMerge;\n var transitionOpt;\n\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n replaceMerge = notMerge.replaceMerge;\n transitionOpt = notMerge.transition;\n notMerge = notMerge.notMerge;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.init(null, null, null, theme, this._locale, optionManager);\n }\n\n this._model.setOption(option, {\n replaceMerge: replaceMerge\n }, optionPreprocessorFuncs);\n\n setTransitionOpt(this, transitionOpt);\n\n if (lazyUpdate) {\n this[OPTION_UPDATED_KEY] = {\n silent: silent\n };\n this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n // It should wake it up to make sure zrender start to render at the next frame.\n\n this.getZr().wakeUp();\n } else {\n prepare(this);\n updateMethods.update.call(this); // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n\n this._zr.flush();\n\n this[OPTION_UPDATED_KEY] = false;\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n };\n /**\n * @DEPRECATED\n */\n\n\n ECharts.prototype.setTheme = function () {\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n }; // We don't want developers to use getModel directly.\n\n\n ECharts.prototype.getModel = function () {\n return this._model;\n };\n\n ECharts.prototype.getOption = function () {\n return this._model && this._model.getOption();\n };\n\n ECharts.prototype.getWidth = function () {\n return this._zr.getWidth();\n };\n\n ECharts.prototype.getHeight = function () {\n return this._zr.getHeight();\n };\n\n ECharts.prototype.getDevicePixelRatio = function () {\n return this._zr.painter.dpr\n /* eslint-disable-next-line */\n || hasWindow && window.devicePixelRatio || 1;\n };\n /**\n * Get canvas which has all thing rendered\n */\n\n\n ECharts.prototype.getRenderedCanvas = function (opts) {\n if (!env.canvasSupported) {\n return;\n }\n\n opts = zrUtil.extend({}, opts || {});\n opts.pixelRatio = opts.pixelRatio || this.getDevicePixelRatio();\n opts.backgroundColor = opts.backgroundColor || this._model.get('backgroundColor');\n var zr = this._zr; // let list = zr.storage.getDisplayList();\n // Stop animations\n // Never works before in init animation, so remove it.\n // zrUtil.each(list, function (el) {\n // el.stopAnimation(true);\n // });\n\n return zr.painter.getRenderedCanvas(opts);\n };\n /**\n * Get svg data url\n */\n\n\n ECharts.prototype.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n\n var zr = this._zr;\n var list = zr.storage.getDisplayList(); // Stop animations\n\n zrUtil.each(list, function (el) {\n el.stopAnimation(null, true);\n });\n return zr.painter.toDataURL();\n };\n\n ECharts.prototype.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n };\n\n ECharts.prototype.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!env.canvasSupported) {\n return;\n }\n\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n\n if (connectedGroups[groupId]) {\n var left_1 = MAX_NUMBER;\n var top_1 = MAX_NUMBER;\n var right_1 = -MAX_NUMBER;\n var bottom_1 = -MAX_NUMBER;\n var canvasList_1 = [];\n var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n zrUtil.each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.getRenderedCanvas(zrUtil.clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left_1 = mathMin(boundingRect.left, left_1);\n top_1 = mathMin(boundingRect.top, top_1);\n right_1 = mathMax(boundingRect.right, right_1);\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n canvasList_1.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left_1 *= dpr_1;\n top_1 *= dpr_1;\n right_1 *= dpr_1;\n bottom_1 *= dpr_1;\n var width = right_1 - left_1;\n var height = bottom_1 - top_1;\n var targetCanvas = zrUtil.createCanvas();\n var zr_1 = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr_1.resize({\n width: width,\n height: height\n });\n\n if (isSvg) {\n var content_1 = '';\n each(canvasList_1, function (item) {\n var x = item.left - left_1;\n var y = item.top - top_1;\n content_1 += '<g transform=\"translate(' + x + ',' + y + ')\">' + item.dom + '</g>';\n });\n zr_1.painter.getSvgRoot().innerHTML = content_1;\n\n if (opts.connectedBackgroundColor) {\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n\n zr_1.refreshImmediately();\n return zr_1.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr_1.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n\n each(canvasList_1, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr_1 - left_1,\n y: item.top * dpr_1 - top_1,\n image: item.dom\n }\n });\n zr_1.add(img);\n });\n zr_1.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n };\n\n ECharts.prototype.convertToPixel = function (finder, value) {\n return doConvertPixel(this, 'convertToPixel', finder, value);\n };\n\n ECharts.prototype.convertFromPixel = function (finder, value) {\n return doConvertPixel(this, 'convertFromPixel', finder, value);\n };\n /**\n * Is the specified coordinate systems or components contain the given pixel point.\n * @param {Array|number} value\n * @return {boolean} result\n */\n\n\n ECharts.prototype.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n var result;\n var findResult = modelUtil.parseFinder(ecModel, finder);\n zrUtil.each(findResult, function (models, key) {\n key.indexOf('Models') >= 0 && zrUtil.each(models, function (model) {\n var coordSys = model.coordinateSystem;\n\n if (coordSys && coordSys.containPoint) {\n result = result || !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n\n if (view && view.containPoint) {\n result = result || view.containPoint(value, model);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n }\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(key + ': containPoint is not supported');\n }\n }\n }, this);\n }, this);\n return !!result;\n };\n /**\n * Get visual from series or data.\n * @param finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param visualType 'color', 'symbol', 'symbolSize'\n */\n\n\n ECharts.prototype.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = parsedFinder.seriesModel;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!seriesModel) {\n console.warn('There is no specified seires model');\n }\n }\n\n var data = seriesModel.getData();\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n };\n /**\n * Get view of corresponding component model\n */\n\n\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n };\n /**\n * Get view of corresponding series model\n */\n\n\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n };\n\n ECharts.prototype._initEvents = function () {\n var _this = this;\n\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = _this.getModel();\n\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'.\n\n if (isGlobalOut) {\n params = {};\n } else {\n el && findEventDispatcher(el, function (parent) {\n var ecData = getECData(parent);\n\n if (ecData && ecData.dataIndex != null) {\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {};\n return true;\n } // If element has custom eventData of components\n else if (ecData.eventData) {\n params = zrUtil.extend({}, ecData.eventData);\n return true;\n }\n }, true);\n } // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n\n\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n\n if (process.env.NODE_ENV !== 'production') {\n // `event.componentType` and `event[componentTpype + 'Index']` must not\n // be missed, otherwise there is no way to distinguish source component.\n // See `dataFormat.getDataParams`.\n if (!isGlobalOut && !(model && view)) {\n console.warn('model or view can not be found by params');\n }\n }\n\n params.event = e;\n params.type = eveName;\n _this._$eventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n\n _this.trigger(eveName, params);\n }\n }; // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n\n\n handler.zrEventfulCallAtLast = true;\n\n _this._zr.on(eveName, handler, _this);\n });\n each(eventActionMap, function (actionType, eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n }); // Extra events\n // TODO register?\n\n each(['selectchanged'], function (eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n handleLegacySelectEvents(this._messageCenter, this, this._api);\n };\n\n ECharts.prototype.isDisposed = function () {\n return this._disposed;\n };\n\n ECharts.prototype.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this.setOption({\n series: []\n }, true);\n };\n\n ECharts.prototype.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._disposed = true;\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n var api = this._api;\n var ecModel = this._model;\n each(this._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(this._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n }); // Dispose after all views disposed\n\n this._zr.dispose();\n\n delete instances[this.id];\n };\n /**\n * Resize the chart\n */\n\n\n ECharts.prototype.resize = function (opts) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._zr.resize(opts);\n\n var ecModel = this._model; // Resize loading effect\n\n this._loadingFX && this._loadingFX.resize();\n\n if (!ecModel) {\n return;\n }\n\n var optionChanged = ecModel.resetOption('media');\n var silent = opts && opts.silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n optionChanged && prepare(this);\n updateMethods.update.call(this, {\n type: 'resize',\n animation: zrUtil.extend({\n // Disable animation\n duration: 0\n }, opts && opts.animation)\n });\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n\n name = name || 'default';\n this.hideLoading();\n\n if (!loadingEffects[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Loading effects ' + name + ' not exists.');\n }\n\n return;\n }\n\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n };\n /**\n * Hide loading effect\n */\n\n\n ECharts.prototype.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n };\n\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\n var payload = zrUtil.extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n };\n /**\n * @param opt If pass boolean, means opt.silent\n * @param opt.silent Default `false`. Whether trigger events.\n * @param opt.flush Default `undefined`.\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */\n\n\n ECharts.prototype.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n\n if (!actions[payload.type]) {\n return;\n } // Avoid dispatch action before setOption. Especially in `connect`.\n\n\n if (!this._model) {\n return;\n } // May dispatchAction in rendering procedure\n\n\n if (this[IN_MAIN_PROCESS_KEY]) {\n this._pendingActions.push(payload);\n\n return;\n }\n\n var silent = opt.silent;\n doDispatchAction.call(this, payload, silent);\n var flush = opt.flush;\n\n if (flush) {\n this._zr.flush();\n } else if (flush !== false && env.browser.weChat) {\n // In WeChat embeded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh util user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.updateLabelLayout = function () {\n var labelManager = this._labelManager;\n labelManager.updateLayoutConfig(this._api);\n labelManager.layout(this._api);\n labelManager.processLabelsOverall();\n };\n\n ECharts.prototype.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(params.data && seriesModel);\n }\n\n seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n\n this._scheduler.unfinished = true;\n this.getZr().wakeUp();\n }; // A work around for no `internal` modifier in ts yet but\n // need to strictly hide private methods to JS users.\n\n\n ECharts.internalField = function () {\n prepare = function (ecIns) {\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecIns._model);\n scheduler.prepareStageTasks();\n prepareView(ecIns, true);\n prepareView(ecIns, false);\n scheduler.plan();\n };\n /**\n * Prepare view instances of charts and components\n */\n\n\n prepareView = function (ecIns, isComponent) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n\n function doPrepare(model) {\n // By defaut view will be reused if possible for the case that `setOption` with \"notMerge\"\n // mode and need to enable transition animation. (Usually, when they have the same id, or\n // especially no id but have the same type & name & index. See the `model.id` generation\n // rule in `makeIdAndName` and `viewId` generation rule here).\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n // the new model has nothing to do with the old model.\n var requireNewView = model.__requireNewView; // This command should not work twice.\n\n model.__requireNewView = false; // Consider: id same and type changed.\n\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = !requireNewView && viewMap[viewId];\n\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n // For backward compat, still support a chart type declared as only subType\n // like \"liquidfill\", but recommend \"series.liquidfill\"\n // But need a base class to make a type series.\n ChartView.getClass(classType.sub);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(Clazz, classType.sub + ' does not exist.');\n }\n\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n\n if (viewMap[view.__id] === view) {\n delete viewMap[view.__id];\n }\n\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n };\n\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model;\n ecModel.setUpdatePayload(payload); // broadcast\n\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n return;\n }\n\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n\n var excludeSeriesId = payload.excludeSeriesId;\n var excludeSeriesIdMap;\n\n if (excludeSeriesId != null) {\n excludeSeriesIdMap = zrUtil.createHashMap();\n each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n var modelId = modelUtil.convertOptionIdName(id, null);\n\n if (modelId != null) {\n excludeSeriesIdMap.set(modelId, true);\n }\n });\n }\n\n if (isHighDownPayload(payload)) {\n allLeaveBlur(ecIns._api);\n } // If dispatchAction before setOption, do nothing.\n\n\n ecModel && ecModel.eachComponent(condition, function (model) {\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\n if (isHighDownPayload(payload)) {\n if (model instanceof SeriesModel) {\n if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur) {\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n }\n } else {\n var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n focusSelf = _a.focusSelf,\n dispatchers = _a.dispatchers;\n\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\n } // PENDING:\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\n // which will be the same as `ChartView` but might be not necessary\n // and will be far from this logic.\n\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n });\n }\n }\n } else if (isSelectChangePayload(payload)) {\n // TODO geo\n if (model instanceof SeriesModel) {\n toggleSelectionFromPayload(model, payload, ecIns._api);\n updateSeriesElementSelection(model);\n markStatusToUpdate(ecIns);\n }\n }\n\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }\n }, ecIns);\n\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n };\n\n updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload);\n },\n update: function (payload) {\n // console.profile && console.profile('update');\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel); // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the orignal point\n\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // deteming whether use progressive rendering.\n\n updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not requied in stream mode updater currently.\n\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload); // Set background\n\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n var darkMode = ecModel.get('darkMode'); // In IE8\n\n if (!env.canvasSupported) {\n var colorArr = colorTool.parse(backgroundColor);\n backgroundColor = colorTool.stringify(colorArr, 'rgb');\n\n if (colorArr[3] === 0) {\n backgroundColor = 'transparent';\n }\n } else {\n zr.setBackgroundColor(backgroundColor); // Force set dark mode.\n\n if (darkMode != null && darkMode !== 'auto') {\n zr.setDarkMode(darkMode);\n }\n }\n\n performPostUpdateFuncs(ecModel, api); // console.profile && console.profileEnd('update');\n },\n updateTransform: function (payload) {\n var _this = this;\n\n var ecModel = this._model;\n var api = this._api; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform');\n\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n }); // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n\n\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\n performPostUpdateFuncs(ecModel, this._api);\n },\n updateView: function (payload) {\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n\n render(this, this._model, this._api, payload);\n performPostUpdateFuncs(ecModel, this._api);\n },\n updateVisual: function (payload) {\n // updateMethods.update.call(this, payload);\n var _this = this;\n\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // clear all visual\n\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.getData().clearAllVisual();\n }); // Perform visual\n\n ChartView.markUpdateMethod(payload, 'updateVisual');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n visualType: 'visual',\n setDirty: true\n });\n\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType !== 'series') {\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n });\n performPostUpdateFuncs(ecModel, this._api);\n },\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload);\n }\n };\n\n doConvertPixel = function (ecIns, methodName, finder, value) {\n if (ecIns._disposed) {\n disposedWarning(ecIns.id);\n return;\n }\n\n var ecModel = ecIns._model;\n\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n\n var result;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\n return result;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n }\n };\n\n updateStreamModes = function (ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n };\n\n doDispatchAction = function (payload, silent) {\n var _this = this;\n\n var ecModel = this.getModel();\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\n var updateMethod = cptTypeTmp.pop();\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n this[IN_MAIN_PROCESS_KEY] = true;\n var payloads = [payload];\n var batched = false; // Batch action\n\n if (payload.batch) {\n batched = true;\n payloads = zrUtil.map(payload.batch, function (item) {\n item = zrUtil.defaults(zrUtil.extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n\n var eventObjBatch = [];\n var eventObj;\n var isSelectChange = isSelectChangePayload(payload);\n var isHighDown = isHighDownPayload(payload);\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside\n\n eventObj = eventObj || zrUtil.extend({}, batchItem); // Convert type to eventType\n\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.\n\n if (isHighDown) {\n var _a = modelUtil.preParseFinder(payload),\n queryOptionMap = _a.queryOptionMap,\n mainTypeSpecified = _a.mainTypeSpecified;\n\n var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n updateDirectly(_this, updateMethod, batchItem, componentMainType);\n markStatusToUpdate(_this);\n } else if (isSelectChange) {\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n // geo still use 'geoselect'.\n updateDirectly(_this, updateMethod, batchItem, 'series');\n markStatusToUpdate(_this);\n } else if (cptType) {\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n });\n\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n // Still dirty\n if (this[OPTION_UPDATED_KEY]) {\n prepare(this);\n updateMethods.update.call(this, payload);\n this[OPTION_UPDATED_KEY] = false;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } // Follow the rule of action batch\n\n\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n\n if (!silent) {\n var messageCenter = this._messageCenter;\n messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event\n\n if (isSelectChange) {\n var newObj = {\n type: 'selectchanged',\n escapeConnect: escapeConnect,\n selected: getAllSelectedIndices(ecModel),\n isFromClick: payload.isFromClick || false,\n fromAction: payload.type,\n fromActionPayload: payload\n };\n messageCenter.trigger(newObj.type, newObj);\n }\n }\n };\n\n flushPendingActions = function (silent) {\n var pendingActions = this._pendingActions;\n\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n };\n\n triggerUpdatedEvent = function (silent) {\n !silent && this.trigger('updated');\n };\n /**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */\n\n\n bindRenderedEvent = function (zr, ecIns) {\n zr.on('rendered', function (params) {\n ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED_KEY] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n };\n\n bindMouseEvent = function (zr, ecIns) {\n zr.on('mouseover', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('mouseout', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlboalMouseOutForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('click', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, function (target) {\n return getECData(target).dataIndex != null;\n }, true);\n\n if (dispatcher) {\n var actionType = dispatcher.selected ? 'unselect' : 'select';\n var ecData = getECData(dispatcher);\n\n ecIns._api.dispatchAction({\n type: actionType,\n dataType: ecData.dataType,\n dataIndexInside: ecData.dataIndex,\n seriesIndex: ecData.seriesIndex,\n isFromClick: true\n });\n }\n });\n };\n\n clearColorPalette = function (ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n };\n\n render = function (ecIns, ecModel, api, payload) {\n renderComponents(ecIns, ecModel, api, payload);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload); // Remove groups of unrendered charts\n\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n };\n\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n clearStates(componentModel, componentView);\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n updateStates(componentModel, componentView);\n });\n };\n /**\n * Render each chart and component\n */\n\n\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var labelManager = ecIns._labelManager;\n labelManager.clearLabels();\n var unfinished = false;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload); // TODO states on marker.\n\n clearStates(seriesModel, chartView);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n unfinished = true;\n }\n\n seriesModel.__transientTransitionOpt = null;\n chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender\n // increamental render (alway render from the __startIndex each frame)\n // chartView.group.markRedraw();\n\n updateBlend(seriesModel, chartView);\n updateSeriesElementSelection(seriesModel); // Add labels.\n\n labelManager.addLabelsOfSeries(chartView);\n });\n scheduler.unfinished = unfinished || scheduler.unfinished;\n labelManager.updateLayoutConfig(api);\n labelManager.layout(api);\n labelManager.processLabelsOverall();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states.\n\n updateZ(seriesModel, chartView); // NOTE: Update states after label is updated.\n // label should be in normal status when layouting.\n\n updateStates(seriesModel, chartView);\n }); // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel);\n };\n\n performPostUpdateFuncs = function (ecModel, api) {\n each(postUpdateFuncs, function (func) {\n func(ecModel, api);\n });\n };\n\n markStatusToUpdate = function (ecIns) {\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame.\n\n ecIns.getZr().wakeUp();\n };\n\n applyChangedStates = function (ecIns) {\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n return;\n }\n\n ecIns.getZr().storage.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n applyElementStates(el);\n });\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n };\n\n function applyElementStates(el) {\n var newStates = [];\n var oldStates = el.currentStates; // Keep other states.\n\n for (var i = 0; i < oldStates.length; i++) {\n var stateName = oldStates[i];\n\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n newStates.push(stateName);\n }\n } // Only use states when it's exists.\n\n\n if (el.selected && el.states.select) {\n newStates.push('select');\n }\n\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n newStates.push('emphasis');\n } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n newStates.push('blur');\n }\n\n el.useStates(newStates);\n }\n\n function updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n if (!el.isGroup) {\n elCount++;\n }\n });\n\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.__alive) {\n chartView.group.traverse(function (el) {\n if (el.states.emphasis) {\n el.states.emphasis.hoverLayer = true;\n }\n });\n }\n });\n }\n }\n\n ;\n /**\n * Update chart and blend.\n */\n\n function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\n console.warn('Only canvas support blendMode');\n }\n }\n\n chartView.group.traverse(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DONT mark the element dirty. In case element is incremental and don't wan't to rerender.\n el.style.blend = blendMode;\n }\n\n if (el.eachPendingDisplayable) {\n el.eachPendingDisplayable(function (displayable) {\n displayable.style.blend = blendMode;\n });\n }\n });\n }\n\n ;\n\n function updateZ(model, view) {\n if (model.preventAutoZ) {\n return;\n } // Set z and zlevel\n\n\n _updateZ(view.group, model.get('z') || 0, model.get('zlevel') || 0, -Infinity);\n }\n\n ;\n\n function _updateZ(el, z, zlevel, maxZ2) {\n // Group may also have textContent\n var label = el.getTextContent();\n var labelLine = el.getTextGuideLine();\n var isGroup = el.isGroup;\n\n if (isGroup) {\n // set z & zlevel of children elements of Group\n // el.traverse((childEl: Element) => _updateZ(childEl, z, zlevel));\n var children = el.childrenRef();\n\n for (var i = 0; i < children.length; i++) {\n maxZ2 = Math.max(_updateZ(children[i], z, zlevel, maxZ2), maxZ2);\n }\n } else {\n // not Group\n el.z = z;\n el.zlevel = zlevel;\n maxZ2 = Math.max(el.z2, maxZ2);\n } // always set z and zlevel if label/labelLine exists\n\n\n if (label) {\n label.z = z;\n label.zlevel = zlevel; // lift z2 of text content\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\n\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n }\n\n if (labelLine) {\n var textGuideLineConfig = el.textGuideLineConfig;\n labelLine.z = z;\n labelLine.zlevel = zlevel;\n isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n }\n\n return maxZ2;\n } // Clear states without animation.\n // TODO States on component.\n\n\n function clearStates(model, view) {\n view.group.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n } // TODO If el is incremental.\n\n\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }\n\n function updateStates(model, view) {\n var stateAnimationModel = model.getModel('stateAnimation');\n var enableAnimation = model.isAnimationEnabled();\n var duration = stateAnimationModel.get('duration');\n var stateTransition = duration > 0 ? {\n duration: duration,\n delay: stateAnimationModel.get('delay'),\n easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive')\n\n } : null;\n view.group.traverse(function (el) {\n if (el.states && el.states.emphasis) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n if (el instanceof graphic.Path) {\n savePathStates(el);\n } // Only updated on changed element. In case element is incremental and don't wan't to rerender.\n // TODO, a more proper way?\n\n\n if (el.__dirty) {\n var prevStates = el.prevStates; // Restore states without animation\n\n if (prevStates) {\n el.useStates(prevStates);\n }\n } // Update state transition and enable animation again.\n\n\n if (enableAnimation) {\n el.stateTransition = stateTransition;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label?\n\n if (textContent) {\n textContent.stateTransition = stateTransition;\n }\n\n if (textGuide) {\n textGuide.stateTransition = stateTransition;\n }\n } // The use higlighted and selected flag to toggle states.\n\n\n if (el.__dirty) {\n applyElementStates(el);\n }\n }\n });\n }\n\n ;\n\n createExtensionAPI = function (ecIns) {\n return new (\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n class_1.prototype.getCoordinateSystems = function () {\n return ecIns._coordSysMgr.getCoordinateSystems();\n };\n\n class_1.prototype.getComponentByElement = function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n\n if (modelInfo != null) {\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n\n el = el.parent;\n }\n };\n\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n enterEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n leaveEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterBlur = function (el) {\n enterBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveBlur = function (el) {\n leaveBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterSelect = function (el) {\n enterSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveSelect = function (el) {\n leaveSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.getModel = function () {\n return ecIns.getModel();\n };\n\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\n return ecIns.getViewOfComponentModel(componentModel);\n };\n\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n return ecIns.getViewOfSeriesModel(seriesModel);\n };\n\n return class_1;\n }(ExtensionAPI))(ecIns);\n };\n\n enableConnect = function (chart) {\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[CONNECT_STATUS_KEY] = status;\n }\n }\n\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n\n var action_1 = chart.makeActionFromEvent(event);\n var otherCharts_1 = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts_1.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n each(otherCharts_1, function (otherChart) {\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n otherChart.dispatchAction(action_1);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n }\n });\n });\n };\n\n setTransitionOpt = function (chart, transitionOpt) {\n var ecModel = chart._model;\n zrUtil.each(modelUtil.normalizeToArray(transitionOpt), function (transOpt) {\n var errMsg;\n var fromOpt = transOpt.from;\n var toOpt = transOpt.to;\n\n if (toOpt == null) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`transition.to` must be specified.';\n }\n\n throwError(errMsg);\n }\n\n var finderOpt = {\n includeMainTypes: ['series'],\n enableAll: false,\n enableNone: false\n };\n var fromResult = fromOpt ? modelUtil.parseFinder(ecModel, fromOpt, finderOpt) : null;\n var toResult = modelUtil.parseFinder(ecModel, toOpt, finderOpt);\n var toSeries = toResult.seriesModel;\n\n if (toSeries == null) {\n errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`transition` is only supported on series.';\n }\n }\n\n if (fromResult && fromResult.seriesModel !== toSeries) {\n errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\n }\n }\n\n if (errMsg != null) {\n throwError(errMsg);\n } // Just a temp solution: mount them on series.\n\n\n toSeries.__transientTransitionOpt = {\n from: fromOpt ? fromOpt.dimension : null,\n to: toOpt.dimension,\n dividingMethod: transOpt.dividingMethod\n };\n });\n };\n }();\n\n return ECharts;\n}(Eventful);\n\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\n * @deprecated\n */\n// @ts-ignore\n\nechartsProto.one = function (eventName, cb, ctx) {\n var self = this;\n deprecateLog('ECharts#one is deprecated.');\n\n function wrapped() {\n var args2 = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args2[_i] = arguments[_i];\n }\n\n cb && cb.apply && cb.apply(this, args2); // @ts-ignore\n\n self.off(eventName, wrapped);\n }\n\n ; // @ts-ignore\n\n this.on.call(this, eventName, wrapped, ctx);\n}; // /**\n// * Encode visual infomation from data after data processing\n// *\n// * @param {module:echarts/model/Global} ecModel\n// * @param {object} layout\n// * @param {boolean} [layoutFilter] `true`: only layout,\n// * `false`: only not layout,\n// * `null`/`undefined`: all.\n// * @param {string} taskBaseTag\n// * @private\n// */\n// function startVisualEncoding(ecIns, ecModel, api, payload, layoutFilter) {\n// each(visualFuncs, function (visual, index) {\n// let isLayout = visual.isLayout;\n// if (layoutFilter == null\n// || (layoutFilter === false && !isLayout)\n// || (layoutFilter === true && isLayout)\n// ) {\n// visual.func(ecModel, api, payload);\n// }\n// });\n// }\n\n\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\n\nfunction disposedWarning(id) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Instance ' + id + ' has been disposed');\n }\n}\n\nvar actions = {};\n/**\n * Map eventType to actionType\n */\n\nvar eventActionMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar postInitFuncs = [];\nvar postUpdateFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\n * @param opts.width Use clientWidth of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param opts.height Use clientHeight of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n */\n\nexport function init(dom, theme, opts) {\n if (process.env.NODE_ENV !== 'production') {\n if (!dom) {\n throw new Error('Initialize failed: invalid dom.');\n }\n }\n\n var existInstance = getInstanceByDom(dom);\n\n if (existInstance) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('There is a chart instance already initialized on the dom.');\n }\n\n return existInstance;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (zrUtil.isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n console.warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n }\n }\n\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n each(postInitFuncs, function (postInitFunc) {\n postInitFunc(chart);\n });\n return chart;\n}\n/**\n * @usage\n * (A)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * chart1.group = 'xxx';\n * chart2.group = 'xxx';\n * echarts.connect('xxx');\n * ```\n * (B)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * echarts.connect('xxx', [chart1, chart2]);\n * ```\n */\n\nexport function connect(groupId) {\n // Is array of charts\n if (zrUtil.isArray(groupId)) {\n var charts = groupId;\n groupId = null; // If any chart has group\n\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n\n connectedGroups[groupId] = true;\n return groupId;\n}\n/**\n * @deprecated\n */\n\nexport function disConnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\n * Alias and backword compat\n */\n\nexport var disconnect = disConnect;\n/**\n * Dispose a chart instance\n */\n\nexport function dispose(chart) {\n if (typeof chart === 'string') {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\nexport function getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n return instances[key];\n}\n/**\n * Register theme\n */\n\nexport function registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\n * Register option preprocessor\n */\n\nexport function registerPreprocessor(preprocessorFunc) {\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n }\n}\nexport function registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\n * Register postIniter\n * @param {Function} postInitFunc\n */\n\nexport function registerPostInit(postInitFunc) {\n if (indexOf(postInitFuncs, postInitFunc) < 0) {\n postInitFunc && postInitFuncs.push(postInitFunc);\n }\n}\n/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */\n\nexport function registerPostUpdate(postUpdateFunc) {\n if (indexOf(postUpdateFuncs, postUpdateFunc) < 0) {\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\n }\n}\nexport function registerAction(actionInfo, eventName, action) {\n if (typeof eventName === 'function') {\n action = eventName;\n eventName = '';\n }\n\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0]; // Event name is all lowercase\n\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event;\n\n if (eventActionMap[eventName]) {\n // Already registered.\n return;\n } // Validate action type and event name.\n\n\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n\n eventActionMap[eventName] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.<string|Object>}\n */\n\nexport function getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\nexport { registerLocale } from './locale';\n\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\n\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\n\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\n\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(priority) || priority == null) {\n throw new Error('Illegal priority');\n } // Check duplicate\n\n\n each(targetList, function (wrap) {\n assert(wrap.__raw !== fn);\n });\n } // Already registered\n\n\n if (indexOf(registeredTasks, fn) >= 0) {\n return;\n }\n\n registeredTasks.push(fn);\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n}\n\nexport function registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n * Be careful of using it in the browser.\n *\n * @example\n * let Canvas = require('canvas');\n * let echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */\n\nexport function setCanvasCreator(creator) {\n zrUtil.$override('createCanvas', creator);\n}\n/**\n * The parameters and usage: see `geoSourceManager.registerMap`.\n * Compatible with previous `echarts.registerMap`.\n */\n\nexport function registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n return geoSourceManager.getMapForUser(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\n * Globa dispatchAction to a specified chart instance.\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters<ECharts['dispatchAction']>[1]) {\n// if (!payload || !payload.chartId) {\n// // Must have chartId to find chart\n// return;\n// }\n// const chart = instances[payload.chartId];\n// if (chart) {\n// chart.dispatchAction(payload, opt);\n// }\n// }\n// Buitlin global visual\n\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault); // Default actions\n\nregisterAction({\n type: HIGHLIGHT_ACTION_TYPE,\n event: HIGHLIGHT_ACTION_TYPE,\n update: HIGHLIGHT_ACTION_TYPE\n}, zrUtil.noop);\nregisterAction({\n type: DOWNPLAY_ACTION_TYPE,\n event: DOWNPLAY_ACTION_TYPE,\n update: DOWNPLAY_ACTION_TYPE\n}, zrUtil.noop);\nregisterAction({\n type: SELECT_ACTION_TYPE,\n event: SELECT_ACTION_TYPE,\n update: SELECT_ACTION_TYPE\n}, zrUtil.noop);\nregisterAction({\n type: UNSELECT_ACTION_TYPE,\n event: UNSELECT_ACTION_TYPE,\n update: UNSELECT_ACTION_TYPE\n}, zrUtil.noop);\nregisterAction({\n type: TOGGLE_SELECT_ACTION_TYPE,\n event: TOGGLE_SELECT_ACTION_TYPE,\n update: TOGGLE_SELECT_ACTION_TYPE\n}, zrUtil.noop); // Default theme\n\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\n\nexport var dataTool = {};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, PRIORITY } from './core/echarts';\nimport ComponentView from './view/Component';\nimport ChartView from './view/Chart';\nimport ComponentModel from './model/Component';\nimport SeriesModel from './model/Series';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util';\nimport { registerPainter } from 'zrender/lib/zrender';\nvar extensions = [];\nvar extensionRegisters = {\n registerPreprocessor: registerPreprocessor,\n registerProcessor: registerProcessor,\n registerPostInit: registerPostInit,\n registerPostUpdate: registerPostUpdate,\n registerAction: registerAction,\n registerCoordinateSystem: registerCoordinateSystem,\n registerLayout: registerLayout,\n registerVisual: registerVisual,\n registerTransform: registerTransform,\n registerLoading: registerLoading,\n registerMap: registerMap,\n PRIORITY: PRIORITY,\n ComponentModel: ComponentModel,\n ComponentView: ComponentView,\n SeriesModel: SeriesModel,\n ChartView: ChartView,\n // TODO Use ComponentModel and SeriesModel instead of Constructor\n registerComponentModel: function (ComponentModelClass) {\n ComponentModel.registerClass(ComponentModelClass);\n },\n registerComponentView: function (ComponentViewClass) {\n ComponentView.registerClass(ComponentViewClass);\n },\n registerSeriesModel: function (SeriesModelClass) {\n SeriesModel.registerClass(SeriesModelClass);\n },\n registerChartView: function (ChartViewClass) {\n ChartView.registerClass(ChartViewClass);\n },\n registerSubTypeDefaulter: function (componentType, defaulter) {\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n },\n registerPainter: function (painterType, PainterCtor) {\n registerPainter(painterType, PainterCtor);\n }\n};\nexport function use(ext) {\n if (isArray(ext)) {\n // use([ChartLine, ChartBar]);\n each(ext, function (singleExt) {\n use(singleExt);\n });\n return;\n }\n\n if (indexOf(extensions, ext) >= 0) {\n return;\n }\n\n extensions.push(ext);\n\n if (isFunction(ext)) {\n ext = {\n install: ext\n };\n }\n\n ext.install(extensionRegisters);\n}","import { __extends } from \"tslib\";\nimport * as util from '../core/util';\nimport { devicePixelRatio } from '../config';\nimport Eventful from '../core/Eventful';\nimport Element from '../Element';\nimport { getCanvasGradient } from './helper';\nimport { createCanvasPattern } from './graphic';\nimport BoundingRect from '../core/BoundingRect';\nfunction returnFalse() {\n return false;\n}\nfunction createDom(id, painter, dpr) {\n var newDom = util.createCanvas();\n var width = painter.getWidth();\n var height = painter.getHeight();\n var newDomStyle = newDom.style;\n if (newDomStyle) {\n newDomStyle.position = 'absolute';\n newDomStyle.left = '0';\n newDomStyle.top = '0';\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n newDom.setAttribute('data-zr-dom-id', id);\n }\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n return newDom;\n}\n;\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, painter, dpr) {\n var _this = _super.call(this) || this;\n _this.motionBlur = false;\n _this.lastFrameAlpha = 0.7;\n _this.dpr = 1;\n _this.virtual = false;\n _this.config = {};\n _this.incremental = false;\n _this.zlevel = 0;\n _this.maxRepaintRectCount = 5;\n _this.__dirty = true;\n _this.__firstTimePaint = true;\n _this.__used = false;\n _this.__drawIndex = 0;\n _this.__startIndex = 0;\n _this.__endIndex = 0;\n _this.__prevStartIndex = null;\n _this.__prevEndIndex = null;\n var dom;\n dpr = dpr || devicePixelRatio;\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n }\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n _this.id = id;\n _this.dom = dom;\n var domStyle = dom.style;\n if (domStyle) {\n dom.onselectstart = returnFalse;\n domStyle.webkitUserSelect = 'none';\n domStyle.userSelect = 'none';\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n domStyle['-webkit-touch-callout'] = 'none';\n domStyle.padding = '0';\n domStyle.margin = '0';\n domStyle.borderWidth = '0';\n }\n _this.domBack = null;\n _this.ctxBack = null;\n _this.painter = painter;\n _this.config = null;\n _this.dpr = dpr;\n return _this;\n }\n Layer.prototype.getElementCount = function () {\n return this.__endIndex - this.__startIndex;\n };\n Layer.prototype.afterBrush = function () {\n this.__prevStartIndex = this.__startIndex;\n this.__prevEndIndex = this.__endIndex;\n };\n Layer.prototype.initContext = function () {\n this.ctx = this.dom.getContext('2d');\n this.ctx.dpr = this.dpr;\n };\n Layer.prototype.setUnpainted = function () {\n this.__firstTimePaint = true;\n };\n Layer.prototype.createBackBuffer = function () {\n var dpr = this.dpr;\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n };\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\n if (this.__firstTimePaint) {\n this.__firstTimePaint = false;\n return null;\n }\n var mergedRepaintRects = [];\n var maxRepaintRectCount = this.maxRepaintRectCount;\n var full = false;\n var pendingRect = new BoundingRect(0, 0, 0, 0);\n function addRectToMergePool(rect) {\n if (!rect.isFinite() || rect.isZero()) {\n return;\n }\n if (mergedRepaintRects.length === 0) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n else {\n var isMerged = false;\n var minDeltaArea = Infinity;\n var bestRectToMergeIdx = 0;\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\n var mergedRect = mergedRepaintRects[i];\n if (mergedRect.intersect(rect)) {\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\n pendingRect_1.copy(mergedRect);\n pendingRect_1.union(rect);\n mergedRepaintRects[i] = pendingRect_1;\n isMerged = true;\n break;\n }\n else if (full) {\n pendingRect.copy(rect);\n pendingRect.union(mergedRect);\n var aArea = rect.width * rect.height;\n var bArea = mergedRect.width * mergedRect.height;\n var pendingArea = pendingRect.width * pendingRect.height;\n var deltaArea = pendingArea - aArea - bArea;\n if (deltaArea < minDeltaArea) {\n minDeltaArea = deltaArea;\n bestRectToMergeIdx = i;\n }\n }\n }\n if (full) {\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\n isMerged = true;\n }\n if (!isMerged) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n if (!full) {\n full = mergedRepaintRects.length >= maxRepaintRectCount;\n }\n }\n }\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\n var el = displayList[i];\n if (el) {\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\n ? el.getPrevPaintRect()\n : null;\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\n ? el.getPaintRect()\n : null;\n if (curRect) {\n addRectToMergePool(curRect);\n }\n }\n }\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n var el = prevList[i];\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n var prevRect = el.getPrevPaintRect();\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n }\n }\n var hasIntersections;\n do {\n hasIntersections = false;\n for (var i = 0; i < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].isZero()) {\n mergedRepaintRects.splice(i, 1);\n continue;\n }\n for (var j = i + 1; j < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n hasIntersections = true;\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\n mergedRepaintRects.splice(j, 1);\n }\n else {\n j++;\n }\n }\n i++;\n }\n } while (hasIntersections);\n this._paintRects = mergedRepaintRects;\n return mergedRepaintRects;\n };\n Layer.prototype.debugGetPaintRects = function () {\n return (this._paintRects || []).slice();\n };\n Layer.prototype.resize = function (width, height) {\n var dpr = this.dpr;\n var dom = this.dom;\n var domStyle = dom.style;\n var domBack = this.domBack;\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n dom.width = width * dpr;\n dom.height = height * dpr;\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n };\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\n var dom = this.dom;\n var ctx = this.ctx;\n var width = dom.width;\n var height = dom.height;\n clearColor = clearColor || this.clearColor;\n var haveMotionBLur = this.motionBlur && !clearAll;\n var lastFrameAlpha = this.lastFrameAlpha;\n var dpr = this.dpr;\n var self = this;\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n }\n var domBack = this.domBack;\n function doClear(x, y, width, height) {\n ctx.clearRect(x, y, width, height);\n if (clearColor && clearColor !== 'transparent') {\n var clearColorGradientOrPattern = void 0;\n if (util.isGradientObject(clearColor)) {\n clearColorGradientOrPattern = clearColor.__canvasGradient\n || getCanvasGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n clearColor.__canvasGradient = clearColorGradientOrPattern;\n }\n else if (util.isPatternObject(clearColor)) {\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\n dirty: function () {\n self.setUnpainted();\n self.__painter.refresh();\n }\n });\n }\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n ctx.fillRect(x, y, width, height);\n ctx.restore();\n }\n if (haveMotionBLur) {\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, x, y, width, height);\n ctx.restore();\n }\n }\n ;\n if (!repaintRects || haveMotionBLur) {\n doClear(0, 0, width, height);\n }\n else if (repaintRects.length) {\n util.each(repaintRects, function (rect) {\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n });\n }\n };\n return Layer;\n}(Eventful));\nexport default Layer;\n","import { devicePixelRatio } from '../config';\nimport * as util from '../core/util';\nimport Layer from './Layer';\nimport requestAnimationFrame from '../animation/requestAnimationFrame';\nimport ZRImage from '../graphic/Image';\nimport env from '../core/env';\nimport { brush, brushSingle } from './graphic';\nimport Element from '../Element';\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\nfunction isLayerValid(layer) {\n if (!layer) {\n return false;\n }\n if (layer.__builtin__) {\n return true;\n }\n if (typeof (layer.resize) !== 'function'\n || typeof (layer.refresh) !== 'function') {\n return false;\n }\n return true;\n}\nfunction createRoot(width, height) {\n var domRoot = document.createElement('div');\n domRoot.style.cssText = [\n 'position:relative',\n 'width:' + width + 'px',\n 'height:' + height + 'px',\n 'padding:0',\n 'margin:0',\n 'border-width:0'\n ].join(';') + ';';\n return domRoot;\n}\nvar CanvasPainter = (function () {\n function CanvasPainter(root, storage, opts, id) {\n this.type = 'canvas';\n this._zlevelList = [];\n this._prevDisplayList = [];\n this._layers = {};\n this._layerConfig = {};\n this._needsManuallyCompositing = false;\n this.type = 'canvas';\n var singleCanvas = !root.nodeName\n || root.nodeName.toUpperCase() === 'CANVAS';\n this._opts = opts = util.extend({}, opts || {});\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n this._singleCanvas = singleCanvas;\n this.root = root;\n var rootStyle = root.style;\n if (rootStyle) {\n rootStyle.webkitTapHighlightColor = 'transparent';\n rootStyle.webkitUserSelect = 'none';\n rootStyle.userSelect = 'none';\n rootStyle['-webkit-touch-callout'] = 'none';\n root.innerHTML = '';\n }\n this.storage = storage;\n var zlevelList = this._zlevelList;\n this._prevDisplayList = [];\n var layers = this._layers;\n if (!singleCanvas) {\n this._width = this._getSize(0);\n this._height = this._getSize(1);\n var domRoot = this._domRoot = createRoot(this._width, this._height);\n root.appendChild(domRoot);\n }\n else {\n var rootCanvas = root;\n var width = rootCanvas.width;\n var height = rootCanvas.height;\n if (opts.width != null) {\n width = opts.width;\n }\n if (opts.height != null) {\n height = opts.height;\n }\n this.dpr = opts.devicePixelRatio || 1;\n rootCanvas.width = width * this.dpr;\n rootCanvas.height = height * this.dpr;\n this._width = width;\n this._height = height;\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext();\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL;\n zlevelList.push(CANVAS_ZLEVEL);\n this._domRoot = root;\n }\n }\n CanvasPainter.prototype.getType = function () {\n return 'canvas';\n };\n CanvasPainter.prototype.isSingleCanvas = function () {\n return this._singleCanvas;\n };\n CanvasPainter.prototype.getViewportRoot = function () {\n return this._domRoot;\n };\n CanvasPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n CanvasPainter.prototype.refresh = function (paintAll) {\n var list = this.storage.getDisplayList(true);\n var prevList = this._prevDisplayList;\n var zlevelList = this._zlevelList;\n this._redrawId = Math.random();\n this._paintList(list, prevList, paintAll, this._redrawId);\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__ && layer.refresh) {\n var clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n if (this._opts.useDirtyRect) {\n this._prevDisplayList = list.slice();\n }\n return this;\n };\n CanvasPainter.prototype.refreshHover = function () {\n this._paintHoverList(this.storage.getDisplayList(false));\n };\n CanvasPainter.prototype._paintHoverList = function (list) {\n var len = list.length;\n var hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n if (!len) {\n return;\n }\n var scope = {\n inHover: true,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var ctx;\n for (var i = 0; i < len; i++) {\n var el = list[i];\n if (el.__inHover) {\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n if (!ctx) {\n ctx = hoverLayer.ctx;\n ctx.save();\n }\n brush(ctx, el, scope, i === len - 1);\n }\n }\n if (ctx) {\n ctx.restore();\n }\n };\n CanvasPainter.prototype.getHoverLayer = function () {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n };\n CanvasPainter.prototype.paintOne = function (ctx, el) {\n brushSingle(ctx, el);\n };\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\n if (this._redrawId !== redrawId) {\n return;\n }\n paintAll = paintAll || false;\n this._updateLayerStatus(list);\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n if (needsRefreshHover) {\n this._paintHoverList(list);\n }\n if (!finished) {\n var self_1 = this;\n requestAnimationFrame(function () {\n self_1._paintList(list, prevList, paintAll, redrawId);\n });\n }\n else {\n this.eachLayer(function (layer) {\n layer.afterBrush && layer.afterBrush();\n });\n }\n };\n CanvasPainter.prototype._compositeManually = function () {\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n var width = this._domRoot.width;\n var height = this._domRoot.height;\n ctx.clearRect(0, 0, width, height);\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n };\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\n var _this = this;\n var layerList = [];\n var useDirtyRect = this._opts.useDirtyRect;\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\n var zlevel = this._zlevelList[zi];\n var layer = this._layers[zlevel];\n if (layer.__builtin__\n && layer !== this._hoverlayer\n && (layer.__dirty || paintAll)) {\n layerList.push(layer);\n }\n }\n var finished = true;\n var needsRefreshHover = false;\n var _loop_1 = function (k) {\n var layer = layerList[k];\n var ctx = layer.ctx;\n var repaintRects = useDirtyRect\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\n ctx.save();\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n var useTimer = !paintAll && layer.incremental && Date.now;\n var startTime = useTimer && Date.now();\n var clearColor = layer.zlevel === this_1._zlevelList[0]\n ? this_1._backgroundColor : null;\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor, repaintRects);\n }\n else if (start === layer.__startIndex) {\n var firstEl = list[start];\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n layer.clear(false, clearColor, repaintRects);\n }\n }\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n var i;\n var repaint = function (repaintRect) {\n var scope = {\n inHover: false,\n allClipped: false,\n prevEl: null,\n viewWidth: _this._width,\n viewHeight: _this._height\n };\n for (i = start; i < layer.__endIndex; i++) {\n var el = list[i];\n if (el.__inHover) {\n needsRefreshHover = true;\n }\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n if (useTimer) {\n var dTime = Date.now() - startTime;\n if (dTime > 15) {\n break;\n }\n }\n }\n if (scope.prevElClipPaths) {\n ctx.restore();\n }\n };\n if (repaintRects) {\n if (repaintRects.length === 0) {\n i = layer.__endIndex;\n }\n else {\n var dpr = this_1.dpr;\n for (var r = 0; r < repaintRects.length; ++r) {\n var rect = repaintRects[r];\n ctx.save();\n ctx.beginPath();\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n ctx.clip();\n repaint(rect);\n ctx.restore();\n }\n }\n }\n else {\n ctx.save();\n repaint();\n ctx.restore();\n }\n layer.__drawIndex = i;\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n };\n var this_1 = this;\n for (var k = 0; k < layerList.length; k++) {\n _loop_1(k);\n }\n if (env.wxa) {\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && layer.ctx.draw) {\n layer.ctx.draw();\n }\n });\n }\n return {\n finished: finished,\n needsRefreshHover: needsRefreshHover\n };\n };\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\n var ctx = currentLayer.ctx;\n if (useDirtyRect) {\n var paintRect = el.getPaintRect();\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n brush(ctx, el, scope, isLast);\n el.setPrevPaintRect(paintRect);\n }\n }\n else {\n brush(ctx, el, scope, isLast);\n }\n };\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n var layer = this._layers[zlevel];\n if (!layer) {\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n }\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n if (virtual) {\n layer.virtual = virtual;\n }\n this.insertLayer(zlevel, layer);\n layer.initContext();\n }\n return layer;\n };\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\n var layersMap = this._layers;\n var zlevelList = this._zlevelList;\n var len = zlevelList.length;\n var domRoot = this._domRoot;\n var prevLayer = null;\n var i = -1;\n if (layersMap[zlevel]) {\n util.logError('ZLevel ' + zlevel + ' has been used already');\n return;\n }\n if (!isLayerValid(layer)) {\n util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n return;\n }\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (zlevelList[i] < zlevel\n && zlevelList[i + 1] > zlevel) {\n break;\n }\n }\n prevLayer = layersMap[zlevelList[i]];\n }\n zlevelList.splice(i + 1, 0, zlevel);\n layersMap[zlevel] = layer;\n if (!layer.virtual) {\n if (prevLayer) {\n var prevDom = prevLayer.dom;\n if (prevDom.nextSibling) {\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n layer.__painter = this;\n };\n CanvasPainter.prototype.eachLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n };\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.getLayers = function () {\n return this._layers;\n };\n CanvasPainter.prototype._updateLayerStatus = function (list) {\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n function updatePrevLayer(idx) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n prevLayer.__endIndex = idx;\n }\n }\n if (this._singleCanvas) {\n for (var i_1 = 1; i_1 < list.length; i_1++) {\n var el = list[i_1];\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n var prevLayer = null;\n var incrementalLayerCount = 0;\n var prevZlevel;\n var i;\n for (i = 0; i < list.length; i++) {\n var el = list[i];\n var zlevel = el.zlevel;\n var layer = void 0;\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n }\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n }\n else {\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n }\n if (!layer.__builtin__) {\n util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n if (layer !== prevLayer) {\n layer.__used = true;\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n layer.__startIndex = i;\n if (!layer.incremental) {\n layer.__drawIndex = i;\n }\n else {\n layer.__drawIndex = -1;\n }\n updatePrevLayer(i);\n prevLayer = layer;\n }\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\n layer.__dirty = true;\n if (layer.incremental && layer.__drawIndex < 0) {\n layer.__drawIndex = i;\n }\n }\n }\n updatePrevLayer(i);\n this.eachBuiltinLayer(function (layer, z) {\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n }\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n };\n CanvasPainter.prototype.clear = function () {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n };\n CanvasPainter.prototype._clearLayer = function (layer) {\n layer.clear();\n };\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n util.each(this._layers, function (layer) {\n layer.setUnpainted();\n });\n };\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\n if (config) {\n var layerConfig = this._layerConfig;\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n }\n else {\n util.merge(layerConfig[zlevel], config, true);\n }\n for (var i = 0; i < this._zlevelList.length; i++) {\n var _zlevel = this._zlevelList[i];\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n var layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n };\n CanvasPainter.prototype.delLayer = function (zlevel) {\n var layers = this._layers;\n var zlevelList = this._zlevelList;\n var layer = layers[zlevel];\n if (!layer) {\n return;\n }\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n };\n CanvasPainter.prototype.resize = function (width, height) {\n if (!this._domRoot.style) {\n if (width == null || height == null) {\n return;\n }\n this._width = width;\n this._height = height;\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n }\n else {\n var domRoot = this._domRoot;\n domRoot.style.display = 'none';\n var opts = this._opts;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = this._getSize(0);\n height = this._getSize(1);\n domRoot.style.display = '';\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n for (var id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n this.refresh(true);\n }\n this._width = width;\n this._height = height;\n }\n return this;\n };\n CanvasPainter.prototype.clearLayer = function (zlevel) {\n var layer = this._layers[zlevel];\n if (layer) {\n layer.clear();\n }\n };\n CanvasPainter.prototype.dispose = function () {\n this.root.innerHTML = '';\n this.root =\n this.storage =\n this._domRoot =\n this._layers = null;\n };\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\n opts = opts || {};\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n var ctx = imageLayer.ctx;\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n var width_1 = imageLayer.dom.width;\n var height_1 = imageLayer.dom.height;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width_1, height_1);\n }\n else if (layer.renderToCanvas) {\n ctx.save();\n layer.renderToCanvas(ctx);\n ctx.restore();\n }\n });\n }\n else {\n var scope = {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var displayList = this.storage.getDisplayList(true);\n for (var i = 0, len = displayList.length; i < len; i++) {\n var el = displayList[i];\n brush(ctx, el, scope, i === len - 1);\n }\n }\n return imageLayer.dom;\n };\n CanvasPainter.prototype.getWidth = function () {\n return this._width;\n };\n CanvasPainter.prototype.getHeight = function () {\n return this._height;\n };\n CanvasPainter.prototype._getSize = function (whIdx) {\n var opts = this._opts;\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n var root = this.root;\n var stl = document.defaultView.getComputedStyle(root);\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)) | 0;\n };\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\n dpr = dpr || this.dpr;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var rect = path.getBoundingRect();\n var style = path.style;\n var shadowBlurSize = style.shadowBlur * dpr;\n var shadowOffsetX = style.shadowOffsetX * dpr;\n var shadowOffsetY = style.shadowOffsetY * dpr;\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\n var width = rect.width + leftMargin + rightMargin;\n var height = rect.height + topMargin + bottomMargin;\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n ctx.scale(dpr, dpr);\n ctx.clearRect(0, 0, width, height);\n ctx.dpr = dpr;\n var pathTransform = {\n x: path.x,\n y: path.y,\n scaleX: path.scaleX,\n scaleY: path.scaleY,\n rotation: path.rotation,\n originX: path.originX,\n originY: path.originY\n };\n path.x = leftMargin - rect.x;\n path.y = topMargin - rect.y;\n path.rotation = 0;\n path.scaleX = 1;\n path.scaleY = 1;\n path.updateTransform();\n if (path) {\n brush(ctx, path, {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n }, true);\n }\n var imgShape = new ZRImage({\n style: {\n x: 0,\n y: 0,\n image: canvas\n }\n });\n util.extend(path, pathTransform);\n return imgShape;\n };\n return CanvasPainter;\n}());\nexport default CanvasPainter;\n;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CanvasPainter from 'zrender/lib/canvas/Painter';\nexport function install(registers) {\n registers.registerPainter('canvas', CanvasPainter);\n}","export function createElement(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n","function diff(oldArr, newArr, equals) {\n if (!equals) {\n equals = function (a, b) {\n return a === b;\n };\n }\n oldArr = oldArr.slice();\n newArr = newArr.slice();\n var newLen = newArr.length;\n var oldLen = oldArr.length;\n var editLength = 1;\n var maxEditLength = newLen + oldLen;\n var bestPath = [{ newPos: -1, components: [] }];\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n var indices = [];\n for (var i = 0; i < newArr.length; i++) {\n indices.push(i);\n }\n return [{\n indices: indices,\n count: newArr.length,\n added: false,\n removed: false\n }];\n }\n function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n bestPath[diagonalPath - 1] = undefined;\n }\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n bestPath[diagonalPath] = undefined;\n continue;\n }\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n pushComponent(basePath.components, false, true);\n }\n else {\n basePath = addPath;\n basePath.newPos++;\n pushComponent(basePath.components, true, false);\n }\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(basePath.components);\n }\n else {\n bestPath[diagonalPath] = basePath;\n }\n }\n editLength++;\n }\n while (editLength <= maxEditLength) {\n var ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n}\nfunction extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\n var newLen = newArr.length;\n var oldLen = oldArr.length;\n var newPos = basePath.newPos;\n var oldPos = newPos - diagonalPath;\n var commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\n newPos++;\n oldPos++;\n commonCount++;\n }\n if (commonCount) {\n basePath.components.push({\n count: commonCount,\n added: false,\n removed: false,\n indices: []\n });\n }\n basePath.newPos = newPos;\n return oldPos;\n}\nfunction pushComponent(components, added, removed) {\n var last = components[components.length - 1];\n if (last && last.added === added && last.removed === removed) {\n components[components.length - 1] = {\n count: last.count + 1,\n added: added,\n removed: removed,\n indices: []\n };\n }\n else {\n components.push({\n count: 1,\n added: added,\n removed: removed,\n indices: []\n });\n }\n}\nfunction buildValues(components) {\n var componentPos = 0;\n var componentLen = components.length;\n var newPos = 0;\n var oldPos = 0;\n for (; componentPos < componentLen; componentPos++) {\n var component = components[componentPos];\n if (!component.removed) {\n var indices = [];\n for (var i = newPos; i < newPos + component.count; i++) {\n indices.push(i);\n }\n component.indices = indices;\n newPos += component.count;\n if (!component.added) {\n oldPos += component.count;\n }\n }\n else {\n for (var i = oldPos; i < oldPos + component.count; i++) {\n component.indices.push(i);\n }\n oldPos += component.count;\n }\n }\n return components;\n}\nfunction clonePath(path) {\n return { newPos: path.newPos, components: path.components.slice(0) };\n}\nexport default function arrayDiff(oldArr, newArr, equal) {\n return diff(oldArr, newArr, equal);\n}\n","import { createElement } from './core';\nimport ZRImage from '../graphic/Image';\nimport { DEFAULT_FONT, getLineHeight } from '../contain/text';\nimport { map } from '../core/util';\nimport { normalizeLineDash } from '../graphic/helper/dashStyle';\nvar NONE = 'none';\nvar mathRound = Math.round;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\nvar EPSILON = 1e-4;\nfunction round3(val) {\n return mathRound(val * 1e3) / 1e3;\n}\nfunction round4(val) {\n return mathRound(val * 1e4) / 1e4;\n}\nfunction isAroundZero(val) {\n return val < EPSILON && val > -EPSILON;\n}\nfunction pathHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== NONE;\n}\nfunction pathHasStroke(style) {\n var stroke = style.stroke;\n return stroke != null && stroke !== NONE;\n}\nfunction setTransform(svgEl, m) {\n if (m) {\n attr(svgEl, 'transform', 'matrix('\n + round3(m[0]) + ','\n + round3(m[1]) + ','\n + round3(m[2]) + ','\n + round3(m[3]) + ','\n + round4(m[4]) + ','\n + round4(m[5])\n + ')');\n }\n}\nfunction attr(el, key, val) {\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\n el.setAttribute(key, val);\n }\n}\nfunction attrXLink(el, key, val) {\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\n}\nfunction attrXML(el, key, val) {\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\n}\nfunction bindStyle(svgEl, style, el) {\n var opacity = style.opacity == null ? 1 : style.opacity;\n if (el instanceof ZRImage) {\n svgEl.style.opacity = opacity + '';\n return;\n }\n if (pathHasFill(style)) {\n var fill = style.fill;\n fill = fill === 'transparent' ? NONE : fill;\n attr(svgEl, 'fill', fill);\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\n }\n else {\n attr(svgEl, 'fill', NONE);\n }\n if (pathHasStroke(style)) {\n var stroke = style.stroke;\n stroke = stroke === 'transparent' ? NONE : stroke;\n attr(svgEl, 'stroke', stroke);\n var strokeWidth = style.lineWidth;\n var strokeScale_1 = style.strokeNoScale\n ? el.getLineScale()\n : 1;\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\n if (lineDash) {\n var lineDashOffset = style.lineDashOffset;\n if (strokeScale_1 && strokeScale_1 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / strokeScale_1;\n });\n if (lineDashOffset) {\n lineDashOffset /= strokeScale_1;\n lineDashOffset = mathRound(lineDashOffset);\n }\n }\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\n }\n else {\n attr(svgEl, 'stroke-dasharray', '');\n }\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\n }\n else {\n attr(svgEl, 'stroke', NONE);\n }\n}\nvar SVGPathRebuilder = (function () {\n function SVGPathRebuilder() {\n }\n SVGPathRebuilder.prototype.reset = function () {\n this._d = [];\n this._str = '';\n };\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\n this._add('M', x, y);\n };\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\n this._add('L', x, y);\n };\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n this._add('C', x, y, x2, y2, x3, y3);\n };\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n this._add('Q', x, y, x2, y2);\n };\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n };\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n var firstCmd = this._d.length === 0;\n var dTheta = endAngle - startAngle;\n var clockwise = !anticlockwise;\n var dThetaPositive = Math.abs(dTheta);\n var isCircle = isAroundZero(dThetaPositive - PI2)\n || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n var unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n var large = false;\n if (isCircle) {\n large = true;\n }\n else if (isAroundZero(dThetaPositive)) {\n large = false;\n }\n else {\n large = (unifiedTheta >= PI) === !!clockwise;\n }\n var x0 = round4(cx + rx * mathCos(startAngle));\n var y0 = round4(cy + ry * mathSin(startAngle));\n if (isCircle) {\n if (clockwise) {\n dTheta = PI2 - 1e-4;\n }\n else {\n dTheta = -PI2 + 1e-4;\n }\n large = true;\n if (firstCmd) {\n this._d.push('M', x0, y0);\n }\n }\n var x = round4(cx + rx * mathCos(startAngle + dTheta));\n var y = round4(cy + ry * mathSin(startAngle + dTheta));\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\n return '';\n }\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\n };\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n this._add('M', x, y);\n this._add('L', x + w, y);\n this._add('L', x + w, y + h);\n this._add('L', x, y + h);\n this._add('L', x, y);\n };\n SVGPathRebuilder.prototype.closePath = function () {\n if (this._d.length > 0) {\n this._add('Z');\n }\n };\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n this._d.push(cmd);\n for (var i = 1; i < arguments.length; i++) {\n var val = arguments[i];\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n this._d.push(round4(val));\n }\n };\n SVGPathRebuilder.prototype.generateStr = function () {\n this._str = this._invalid ? '' : this._d.join(' ');\n this._d = [];\n };\n SVGPathRebuilder.prototype.getStr = function () {\n return this._str;\n };\n return SVGPathRebuilder;\n}());\nvar svgPath = {\n brush: function (el) {\n var style = el.style;\n var svgEl = el.__svgEl;\n if (!svgEl) {\n svgEl = createElement('path');\n el.__svgEl = svgEl;\n }\n if (!el.path) {\n el.createPathProxy();\n }\n var path = el.path;\n if (el.shapeChanged()) {\n path.beginPath();\n el.buildPath(path, el.shape);\n el.pathUpdated();\n }\n var pathVersion = path.getVersion();\n var elExt = el;\n var svgPathBuilder = elExt.__svgPathBuilder;\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\n if (!svgPathBuilder) {\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n }\n svgPathBuilder.reset();\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\n svgPathBuilder.generateStr();\n elExt.__svgPathVersion = pathVersion;\n }\n attr(svgEl, 'd', svgPathBuilder.getStr());\n bindStyle(svgEl, style, el);\n setTransform(svgEl, el.transform);\n }\n};\nexport { svgPath as path };\nvar svgImage = {\n brush: function (el) {\n var style = el.style;\n var image = style.image;\n if (image instanceof HTMLImageElement) {\n image = image.src;\n }\n else if (image instanceof HTMLCanvasElement) {\n image = image.toDataURL();\n }\n if (!image) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var dw = style.width;\n var dh = style.height;\n var svgEl = el.__svgEl;\n if (!svgEl) {\n svgEl = createElement('image');\n el.__svgEl = svgEl;\n }\n if (image !== el.__imageSrc) {\n attrXLink(svgEl, 'href', image);\n el.__imageSrc = image;\n }\n attr(svgEl, 'width', dw + '');\n attr(svgEl, 'height', dh + '');\n attr(svgEl, 'x', x + '');\n attr(svgEl, 'y', y + '');\n bindStyle(svgEl, style, el);\n setTransform(svgEl, el.transform);\n }\n};\nexport { svgImage as image };\nvar TEXT_ALIGN_TO_ANCHOR = {\n left: 'start',\n right: 'end',\n center: 'middle',\n middle: 'middle'\n};\nfunction adjustTextY(y, lineHeight, textBaseline) {\n if (textBaseline === 'top') {\n y += lineHeight / 2;\n }\n else if (textBaseline === 'bottom') {\n y -= lineHeight / 2;\n }\n return y;\n}\nvar svgText = {\n brush: function (el) {\n var style = el.style;\n var text = style.text;\n text != null && (text += '');\n if (!text || isNaN(style.x) || isNaN(style.y)) {\n return;\n }\n var textSvgEl = el.__svgEl;\n if (!textSvgEl) {\n textSvgEl = createElement('text');\n attrXML(textSvgEl, 'xml:space', 'preserve');\n el.__svgEl = textSvgEl;\n }\n var font = style.font || DEFAULT_FONT;\n var textSvgElStyle = textSvgEl.style;\n textSvgElStyle.font = font;\n textSvgEl.textContent = text;\n bindStyle(textSvgEl, style, el);\n setTransform(textSvgEl, el.transform);\n var x = style.x || 0;\n var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\n || style.textAlign;\n attr(textSvgEl, 'dominant-baseline', 'central');\n attr(textSvgEl, 'text-anchor', textAlign);\n attr(textSvgEl, 'x', x + '');\n attr(textSvgEl, 'y', y + '');\n }\n};\nexport { svgText as text };\n","import { createElement } from '../core';\nimport * as zrUtil from '../../core/util';\nimport Path from '../../graphic/Path';\nimport ZRImage from '../../graphic/Image';\nimport TSpan from '../../graphic/TSpan';\nimport { path as svgPath, image as svgImage, text as svgText } from '../graphic';\nvar MARK_UNUSED = '0';\nvar MARK_USED = '1';\nvar Definable = (function () {\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\n this.nextId = 0;\n this._domName = '_dom';\n this.createElement = createElement;\n this._zrId = zrId;\n this._svgRoot = svgRoot;\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\n this._markLabel = markLabel;\n if (domName) {\n this._domName = domName;\n }\n }\n Definable.prototype.getDefs = function (isForceCreating) {\n var svgRoot = this._svgRoot;\n var defs = this._svgRoot.getElementsByTagName('defs');\n if (defs.length === 0) {\n if (isForceCreating) {\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\n if (!defs_1.contains) {\n defs_1.contains = function (el) {\n var children = defs_1.children;\n if (!children) {\n return false;\n }\n for (var i = children.length - 1; i >= 0; --i) {\n if (children[i] === el) {\n return true;\n }\n }\n return false;\n };\n }\n return defs_1;\n }\n else {\n return null;\n }\n }\n else {\n return defs[0];\n }\n };\n Definable.prototype.doUpdate = function (target, onUpdate) {\n if (!target) {\n return;\n }\n var defs = this.getDefs(false);\n if (target[this._domName] && defs.contains(target[this._domName])) {\n if (typeof onUpdate === 'function') {\n onUpdate(target);\n }\n }\n else {\n var dom = this.add(target);\n if (dom) {\n target[this._domName] = dom;\n }\n }\n };\n Definable.prototype.add = function (target) {\n return null;\n };\n Definable.prototype.addDom = function (dom) {\n var defs = this.getDefs(true);\n if (dom.parentNode !== defs) {\n defs.appendChild(dom);\n }\n };\n Definable.prototype.removeDom = function (target) {\n var defs = this.getDefs(false);\n if (defs && target[this._domName]) {\n defs.removeChild(target[this._domName]);\n target[this._domName] = null;\n }\n };\n Definable.prototype.getDoms = function () {\n var defs = this.getDefs(false);\n if (!defs) {\n return [];\n }\n var doms = [];\n zrUtil.each(this._tagNames, function (tagName) {\n var tags = defs.getElementsByTagName(tagName);\n for (var i = 0; i < tags.length; i++) {\n doms.push(tags[i]);\n }\n });\n return doms;\n };\n Definable.prototype.markAllUnused = function () {\n var doms = this.getDoms();\n var that = this;\n zrUtil.each(doms, function (dom) {\n dom[that._markLabel] = MARK_UNUSED;\n });\n };\n Definable.prototype.markDomUsed = function (dom) {\n dom && (dom[this._markLabel] = MARK_USED);\n };\n ;\n Definable.prototype.markDomUnused = function (dom) {\n dom && (dom[this._markLabel] = MARK_UNUSED);\n };\n ;\n Definable.prototype.isDomUnused = function (dom) {\n return dom && dom[this._markLabel] !== MARK_USED;\n };\n Definable.prototype.removeUnused = function () {\n var _this = this;\n var defs = this.getDefs(false);\n if (!defs) {\n return;\n }\n var doms = this.getDoms();\n zrUtil.each(doms, function (dom) {\n if (_this.isDomUnused(dom)) {\n defs.removeChild(dom);\n }\n });\n };\n Definable.prototype.getSvgProxy = function (displayable) {\n if (displayable instanceof Path) {\n return svgPath;\n }\n else if (displayable instanceof ZRImage) {\n return svgImage;\n }\n else if (displayable instanceof TSpan) {\n return svgText;\n }\n else {\n return svgPath;\n }\n };\n Definable.prototype.getSvgElement = function (displayable) {\n return displayable.__svgEl;\n };\n return Definable;\n}());\nexport default Definable;\n","import { __extends } from \"tslib\";\nimport Definable from './Definable';\nimport * as zrUtil from '../../core/util';\nimport * as colorTool from '../../tool/color';\nfunction isLinearGradient(value) {\n return value.type === 'linear';\n}\nfunction isRadialGradient(value) {\n return value.type === 'radial';\n}\nfunction isGradient(value) {\n return value && (value.type === 'linear'\n || value.type === 'radial');\n}\nvar GradientManager = (function (_super) {\n __extends(GradientManager, _super);\n function GradientManager(zrId, svgRoot) {\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\n }\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\n if (displayable && displayable.style) {\n var that_1 = this;\n zrUtil.each(['fill', 'stroke'], function (fillOrStroke) {\n var value = displayable.style[fillOrStroke];\n if (isGradient(value)) {\n var gradient = value;\n var defs = that_1.getDefs(true);\n var dom = void 0;\n if (gradient.__dom) {\n dom = gradient.__dom;\n if (!defs.contains(gradient.__dom)) {\n that_1.addDom(dom);\n }\n }\n else {\n dom = that_1.add(gradient);\n }\n that_1.markUsed(displayable);\n var id = dom.getAttribute('id');\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\n }\n });\n }\n };\n GradientManager.prototype.add = function (gradient) {\n var dom;\n if (isLinearGradient(gradient)) {\n dom = this.createElement('linearGradient');\n }\n else if (isRadialGradient(gradient)) {\n dom = this.createElement('radialGradient');\n }\n else {\n zrUtil.logError('Illegal gradient type.');\n return null;\n }\n gradient.id = gradient.id || this.nextId++;\n dom.setAttribute('id', 'zr' + this._zrId\n + '-gradient-' + gradient.id);\n this.updateDom(gradient, dom);\n this.addDom(dom);\n return dom;\n };\n GradientManager.prototype.update = function (gradient) {\n if (!isGradient(gradient)) {\n return;\n }\n var that = this;\n this.doUpdate(gradient, function () {\n var dom = gradient.__dom;\n if (!dom) {\n return;\n }\n var tagName = dom.tagName;\n var type = gradient.type;\n if (type === 'linear' && tagName === 'linearGradient'\n || type === 'radial' && tagName === 'radialGradient') {\n that.updateDom(gradient, gradient.__dom);\n }\n else {\n that.removeDom(gradient);\n that.add(gradient);\n }\n });\n };\n GradientManager.prototype.updateDom = function (gradient, dom) {\n if (isLinearGradient(gradient)) {\n dom.setAttribute('x1', gradient.x + '');\n dom.setAttribute('y1', gradient.y + '');\n dom.setAttribute('x2', gradient.x2 + '');\n dom.setAttribute('y2', gradient.y2 + '');\n }\n else if (isRadialGradient(gradient)) {\n dom.setAttribute('cx', gradient.x + '');\n dom.setAttribute('cy', gradient.y + '');\n dom.setAttribute('r', gradient.r + '');\n }\n else {\n zrUtil.logError('Illegal gradient type.');\n return;\n }\n if (gradient.global) {\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\n }\n else {\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\n }\n dom.innerHTML = '';\n var colors = gradient.colorStops;\n for (var i = 0, len = colors.length; i < len; ++i) {\n var stop_1 = this.createElement('stop');\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\n var color = colors[i].color;\n if (color.indexOf('rgba') > -1) {\n var opacity = colorTool.parse(color)[3];\n var hex = colorTool.toHex(color);\n stop_1.setAttribute('stop-color', '#' + hex);\n stop_1.setAttribute('stop-opacity', opacity + '');\n }\n else {\n stop_1.setAttribute('stop-color', colors[i].color);\n }\n dom.appendChild(stop_1);\n }\n gradient.__dom = dom;\n };\n GradientManager.prototype.markUsed = function (displayable) {\n if (displayable.style) {\n var gradient = displayable.style.fill;\n if (gradient && gradient.__dom) {\n _super.prototype.markDomUsed.call(this, gradient.__dom);\n }\n gradient = displayable.style.stroke;\n if (gradient && gradient.__dom) {\n _super.prototype.markDomUsed.call(this, gradient.__dom);\n }\n }\n };\n return GradientManager;\n}(Definable));\nexport default GradientManager;\n","import { __extends } from \"tslib\";\nimport Definable from './Definable';\nimport * as zrUtil from '../../core/util';\nimport { createOrUpdateImage } from '../../graphic/helper/image';\nimport WeakMap from '../../core/WeakMap';\nfunction isPattern(value) {\n return value && (!!value.image || !!value.svgElement);\n}\nvar patternDomMap = new WeakMap();\nvar PatternManager = (function (_super) {\n __extends(PatternManager, _super);\n function PatternManager(zrId, svgRoot) {\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\n }\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\n if (displayable && displayable.style) {\n var that_1 = this;\n zrUtil.each(['fill', 'stroke'], function (fillOrStroke) {\n var pattern = displayable.style[fillOrStroke];\n if (isPattern(pattern)) {\n var defs = that_1.getDefs(true);\n var dom = patternDomMap.get(pattern);\n if (dom) {\n if (!defs.contains(dom)) {\n that_1.addDom(dom);\n }\n }\n else {\n dom = that_1.add(pattern);\n }\n that_1.markUsed(displayable);\n var id = dom.getAttribute('id');\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\n }\n });\n }\n };\n PatternManager.prototype.add = function (pattern) {\n if (!isPattern(pattern)) {\n return;\n }\n var dom = this.createElement('pattern');\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\n dom.setAttribute('id', 'zr' + this._zrId\n + '-pattern-' + pattern.id);\n dom.setAttribute('x', '0');\n dom.setAttribute('y', '0');\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\n this.updateDom(pattern, dom);\n this.addDom(dom);\n return dom;\n };\n PatternManager.prototype.update = function (pattern) {\n if (!isPattern(pattern)) {\n return;\n }\n var that = this;\n this.doUpdate(pattern, function () {\n var dom = patternDomMap.get(pattern);\n that.updateDom(pattern, dom);\n });\n };\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\n var svgElement = pattern.svgElement;\n if (svgElement instanceof SVGElement) {\n if (svgElement.parentNode !== patternDom) {\n patternDom.innerHTML = '';\n patternDom.appendChild(svgElement);\n patternDom.setAttribute('width', pattern.svgWidth + '');\n patternDom.setAttribute('height', pattern.svgHeight + '');\n }\n }\n else {\n var img = void 0;\n var prevImage = patternDom.getElementsByTagName('image');\n if (prevImage.length) {\n if (pattern.image) {\n img = prevImage[0];\n }\n else {\n patternDom.removeChild(prevImage[0]);\n return;\n }\n }\n else if (pattern.image) {\n img = this.createElement('image');\n }\n if (img) {\n var imageSrc = void 0;\n if (typeof pattern.image === 'string') {\n imageSrc = pattern.image;\n }\n else if (pattern.image instanceof HTMLImageElement) {\n imageSrc = pattern.image.src;\n }\n else if (pattern.image instanceof HTMLCanvasElement) {\n imageSrc = pattern.image.toDataURL();\n }\n if (imageSrc) {\n img.setAttribute('href', imageSrc);\n img.setAttribute('x', '0');\n img.setAttribute('y', '0');\n var hostEl = {\n dirty: function () { }\n };\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\n patternDom.setAttribute('width', img.width + '');\n patternDom.setAttribute('height', img.height + '');\n });\n if (createdImage && createdImage.width && createdImage.height) {\n patternDom.setAttribute('width', createdImage.width + '');\n patternDom.setAttribute('height', createdImage.height + '');\n }\n patternDom.appendChild(img);\n }\n }\n }\n var x = pattern.x || 0;\n var y = pattern.y || 0;\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\n var scaleX = pattern.scaleX || 1;\n var scaleY = pattern.scaleY || 1;\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\n patternDom.setAttribute('patternTransform', transform);\n patternDomMap.set(pattern, patternDom);\n };\n PatternManager.prototype.markUsed = function (displayable) {\n if (displayable.style) {\n if (isPattern(displayable.style.fill)) {\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\n }\n if (isPattern(displayable.style.stroke)) {\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke));\n }\n }\n };\n return PatternManager;\n}(Definable));\nexport default PatternManager;\n","import { __extends } from \"tslib\";\nimport Definable from './Definable';\nimport * as zrUtil from '../../core/util';\nimport { isClipPathChanged } from '../../canvas/helper';\nfunction generateClipPathsKey(clipPaths) {\n var key = [];\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n key.push(clipPath.id);\n }\n }\n return key.join(',');\n}\nexport function hasClipPath(displayable) {\n var clipPaths = displayable.__clipPaths;\n return clipPaths && clipPaths.length > 0;\n}\nvar ClippathManager = (function (_super) {\n __extends(ClippathManager, _super);\n function ClippathManager(zrId, svgRoot) {\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\n _this._refGroups = {};\n _this._keyDuplicateCount = {};\n return _this;\n }\n ClippathManager.prototype.markAllUnused = function () {\n _super.prototype.markAllUnused.call(this);\n for (var key in this._refGroups) {\n this.markDomUnused(this._refGroups[key]);\n }\n this._keyDuplicateCount = {};\n };\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\n if (!hasClipPath(displayable)) {\n return;\n }\n var clipPaths = displayable.__clipPaths;\n var keyDuplicateCount = this._keyDuplicateCount;\n var clipPathKey = generateClipPathsKey(clipPaths);\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\n keyDuplicateCount[clipPathKey]++;\n }\n return this._refGroups[clipPathKey]\n || (this._refGroups[clipPathKey] = this.createElement('g'));\n };\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\n if (clipGroup) {\n this.markDomUsed(clipGroup);\n this.updateDom(clipGroup, displayable.__clipPaths);\n }\n return clipGroup;\n };\n ;\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\n if (clipPaths && clipPaths.length > 0) {\n var defs = this.getDefs(true);\n var clipPath = clipPaths[0];\n var clipPathEl = void 0;\n var id = void 0;\n if (clipPath._dom) {\n id = clipPath._dom.getAttribute('id');\n clipPathEl = clipPath._dom;\n if (!defs.contains(clipPathEl)) {\n defs.appendChild(clipPathEl);\n }\n }\n else {\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\n ++this.nextId;\n clipPathEl = this.createElement('clipPath');\n clipPathEl.setAttribute('id', id);\n defs.appendChild(clipPathEl);\n clipPath._dom = clipPathEl;\n }\n var svgProxy = this.getSvgProxy(clipPath);\n svgProxy.brush(clipPath);\n var pathEl = this.getSvgElement(clipPath);\n clipPathEl.innerHTML = '';\n clipPathEl.appendChild(pathEl);\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\n if (clipPaths.length > 1) {\n this.updateDom(clipPathEl, clipPaths.slice(1));\n }\n }\n else {\n if (parentEl) {\n parentEl.setAttribute('clip-path', 'none');\n }\n }\n };\n ;\n ClippathManager.prototype.markUsed = function (displayable) {\n var _this = this;\n if (displayable.__clipPaths) {\n zrUtil.each(displayable.__clipPaths, function (clipPath) {\n if (clipPath._dom) {\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\n }\n });\n }\n };\n ;\n ClippathManager.prototype.removeUnused = function () {\n _super.prototype.removeUnused.call(this);\n var newRefGroupsMap = {};\n for (var key in this._refGroups) {\n var group = this._refGroups[key];\n if (!this.isDomUnused(group)) {\n newRefGroupsMap[key] = group;\n }\n else if (group.parentNode) {\n group.parentNode.removeChild(group);\n }\n }\n this._refGroups = newRefGroupsMap;\n };\n return ClippathManager;\n}(Definable));\nexport default ClippathManager;\n","import { __extends } from \"tslib\";\nimport Definable from './Definable';\nvar ShadowManager = (function (_super) {\n __extends(ShadowManager, _super);\n function ShadowManager(zrId, svgRoot) {\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\n _this._shadowDomMap = {};\n _this._shadowDomPool = [];\n return _this;\n }\n ShadowManager.prototype._getFromPool = function () {\n var shadowDom = this._shadowDomPool.pop();\n if (!shadowDom) {\n shadowDom = this.createElement('filter');\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\n var domChild = this.createElement('feDropShadow');\n shadowDom.appendChild(domChild);\n this.addDom(shadowDom);\n }\n return shadowDom;\n };\n ShadowManager.prototype.update = function (svgElement, displayable) {\n var style = displayable.style;\n if (hasShadow(style)) {\n var shadowKey = getShadowKey(displayable);\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\n if (!shadowDom) {\n shadowDom = this._getFromPool();\n this._shadowDomMap[shadowKey] = shadowDom;\n }\n this.updateDom(svgElement, displayable, shadowDom);\n }\n else {\n this.remove(svgElement, displayable);\n }\n };\n ShadowManager.prototype.remove = function (svgElement, displayable) {\n if (displayable._shadowDom != null) {\n displayable._shadowDom = null;\n svgElement.style.filter = '';\n }\n };\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\n var domChild = shadowDom.children[0];\n var style = displayable.style;\n var globalScale = displayable.getGlobalScale();\n var scaleX = globalScale[0];\n var scaleY = globalScale[1];\n if (!scaleX || !scaleY) {\n return;\n }\n var offsetX = style.shadowOffsetX || 0;\n var offsetY = style.shadowOffsetY || 0;\n var blur = style.shadowBlur;\n var color = style.shadowColor;\n domChild.setAttribute('dx', offsetX / scaleX + '');\n domChild.setAttribute('dy', offsetY / scaleY + '');\n domChild.setAttribute('flood-color', color);\n var stdDx = blur / 2 / scaleX;\n var stdDy = blur / 2 / scaleY;\n var stdDeviation = stdDx + ' ' + stdDy;\n domChild.setAttribute('stdDeviation', stdDeviation);\n shadowDom.setAttribute('x', '-100%');\n shadowDom.setAttribute('y', '-100%');\n shadowDom.setAttribute('width', '300%');\n shadowDom.setAttribute('height', '300%');\n displayable._shadowDom = shadowDom;\n var id = shadowDom.getAttribute('id');\n svgElement.style.filter = 'url(#' + id + ')';\n };\n ShadowManager.prototype.removeUnused = function () {\n var defs = this.getDefs(false);\n if (!defs) {\n return;\n }\n var shadowDomsPool = this._shadowDomPool;\n for (var key in this._shadowDomMap) {\n var dom = this._shadowDomMap[key];\n shadowDomsPool.push(dom);\n }\n this._shadowDomMap = {};\n };\n return ShadowManager;\n}(Definable));\nexport default ShadowManager;\nfunction hasShadow(style) {\n return style\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\nfunction getShadowKey(displayable) {\n var style = displayable.style;\n var globalScale = displayable.getGlobalScale();\n return [\n style.shadowColor,\n (style.shadowBlur || 0).toFixed(2),\n (style.shadowOffsetX || 0).toFixed(2),\n (style.shadowOffsetY || 0).toFixed(2),\n globalScale[0],\n globalScale[1]\n ].join(',');\n}\n","import { createElement } from './core';\nimport * as util from '../core/util';\nimport Path from '../graphic/Path';\nimport ZRImage from '../graphic/Image';\nimport TSpan from '../graphic/TSpan';\nimport arrayDiff from '../core/arrayDiff';\nimport GradientManager from './helper/GradientManager';\nimport PatternManager from './helper/PatternManager';\nimport ClippathManager, { hasClipPath } from './helper/ClippathManager';\nimport ShadowManager from './helper/ShadowManager';\nimport { path as svgPath, image as svgImage, text as svgText } from './graphic';\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\nfunction getSvgProxy(el) {\n if (el instanceof Path) {\n return svgPath;\n }\n else if (el instanceof ZRImage) {\n return svgImage;\n }\n else if (el instanceof TSpan) {\n return svgText;\n }\n else {\n return svgPath;\n }\n}\nfunction checkParentAvailable(parent, child) {\n return child && parent && child.parentNode !== parent;\n}\nfunction insertAfter(parent, child, prevSibling) {\n if (checkParentAvailable(parent, child) && prevSibling) {\n var nextSibling = prevSibling.nextSibling;\n nextSibling ? parent.insertBefore(child, nextSibling)\n : parent.appendChild(child);\n }\n}\nfunction prepend(parent, child) {\n if (checkParentAvailable(parent, child)) {\n var firstChild = parent.firstChild;\n firstChild ? parent.insertBefore(child, firstChild)\n : parent.appendChild(child);\n }\n}\nfunction remove(parent, child) {\n if (child && parent && child.parentNode === parent) {\n parent.removeChild(child);\n }\n}\nfunction removeFromMyParent(child) {\n if (child && child.parentNode) {\n child.parentNode.removeChild(child);\n }\n}\nfunction getSvgElement(displayable) {\n return displayable.__svgEl;\n}\nvar SVGPainter = (function () {\n function SVGPainter(root, storage, opts, zrId) {\n this.type = 'svg';\n this.refreshHover = createMethodNotSupport('refreshHover');\n this.pathToImage = createMethodNotSupport('pathToImage');\n this.configLayer = createMethodNotSupport('configLayer');\n this.root = root;\n this.storage = storage;\n this._opts = opts = util.extend({}, opts || {});\n var svgDom = createElement('svg');\n svgDom.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'http://www.w3.org/2000/svg');\n svgDom.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', 'http://www.w3.org/1999/xlink');\n svgDom.setAttribute('version', '1.1');\n svgDom.setAttribute('baseProfile', 'full');\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\n var bgRoot = createElement('g');\n svgDom.appendChild(bgRoot);\n var svgRoot = createElement('g');\n svgDom.appendChild(svgRoot);\n this._gradientManager = new GradientManager(zrId, svgRoot);\n this._patternManager = new PatternManager(zrId, svgRoot);\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\n this._shadowManager = new ShadowManager(zrId, svgRoot);\n var viewport = document.createElement('div');\n viewport.style.cssText = 'overflow:hidden;position:relative';\n this._svgDom = svgDom;\n this._svgRoot = svgRoot;\n this._backgroundRoot = bgRoot;\n this._viewport = viewport;\n root.appendChild(viewport);\n viewport.appendChild(svgDom);\n this.resize(opts.width, opts.height);\n this._visibleList = [];\n }\n SVGPainter.prototype.getType = function () {\n return 'svg';\n };\n SVGPainter.prototype.getViewportRoot = function () {\n return this._viewport;\n };\n SVGPainter.prototype.getSvgDom = function () {\n return this._svgDom;\n };\n SVGPainter.prototype.getSvgRoot = function () {\n return this._svgRoot;\n };\n SVGPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n SVGPainter.prototype.refresh = function () {\n var list = this.storage.getDisplayList(true);\n this._paintList(list);\n };\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\n if (this._backgroundRoot && this._backgroundNode) {\n this._backgroundRoot.removeChild(this._backgroundNode);\n }\n var bgNode = createElement('rect');\n bgNode.setAttribute('width', this.getWidth());\n bgNode.setAttribute('height', this.getHeight());\n bgNode.setAttribute('x', 0);\n bgNode.setAttribute('y', 0);\n bgNode.setAttribute('id', 0);\n bgNode.style.fill = backgroundColor;\n this._backgroundRoot.appendChild(bgNode);\n this._backgroundNode = bgNode;\n };\n SVGPainter.prototype.createSVGElement = function (tag) {\n return createElement(tag);\n };\n SVGPainter.prototype.paintOne = function (el) {\n var svgProxy = getSvgProxy(el);\n svgProxy && svgProxy.brush(el);\n return getSvgElement(el);\n };\n SVGPainter.prototype._paintList = function (list) {\n var gradientManager = this._gradientManager;\n var patternManager = this._patternManager;\n var clipPathManager = this._clipPathManager;\n var shadowManager = this._shadowManager;\n gradientManager.markAllUnused();\n patternManager.markAllUnused();\n clipPathManager.markAllUnused();\n shadowManager.markAllUnused();\n var svgRoot = this._svgRoot;\n var visibleList = this._visibleList;\n var listLen = list.length;\n var newVisibleList = [];\n for (var i = 0; i < listLen; i++) {\n var displayable = list[i];\n var svgProxy = getSvgProxy(displayable);\n var svgElement = getSvgElement(displayable);\n if (!displayable.invisible) {\n if (displayable.__dirty || !svgElement) {\n svgProxy && svgProxy.brush(displayable);\n svgElement = getSvgElement(displayable);\n if (svgElement && displayable.style) {\n gradientManager.update(displayable.style.fill);\n gradientManager.update(displayable.style.stroke);\n patternManager.update(displayable.style.fill);\n patternManager.update(displayable.style.stroke);\n shadowManager.update(svgElement, displayable);\n }\n displayable.__dirty = 0;\n }\n if (svgElement) {\n newVisibleList.push(displayable);\n }\n }\n }\n var diff = arrayDiff(visibleList, newVisibleList);\n var prevSvgElement;\n var topPrevSvgElement;\n for (var i = 0; i < diff.length; i++) {\n var item = diff[i];\n if (item.removed) {\n for (var k = 0; k < item.count; k++) {\n var displayable = visibleList[item.indices[k]];\n var svgElement = getSvgElement(displayable);\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\n : remove(svgRoot, svgElement);\n }\n }\n }\n var prevDisplayable;\n var currentClipGroup;\n for (var i = 0; i < diff.length; i++) {\n var item = diff[i];\n if (item.removed) {\n continue;\n }\n for (var k = 0; k < item.count; k++) {\n var displayable = newVisibleList[item.indices[k]];\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\n if (clipGroup !== currentClipGroup) {\n prevSvgElement = topPrevSvgElement;\n if (clipGroup) {\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\n : prepend(svgRoot, clipGroup);\n topPrevSvgElement = clipGroup;\n prevSvgElement = null;\n }\n currentClipGroup = clipGroup;\n }\n var svgElement = getSvgElement(displayable);\n prevSvgElement\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\n : prepend(currentClipGroup || svgRoot, svgElement);\n prevSvgElement = svgElement || prevSvgElement;\n if (!currentClipGroup) {\n topPrevSvgElement = prevSvgElement;\n }\n gradientManager.markUsed(displayable);\n gradientManager.addWithoutUpdate(svgElement, displayable);\n patternManager.markUsed(displayable);\n patternManager.addWithoutUpdate(svgElement, displayable);\n clipPathManager.markUsed(displayable);\n prevDisplayable = displayable;\n }\n }\n gradientManager.removeUnused();\n patternManager.removeUnused();\n clipPathManager.removeUnused();\n shadowManager.removeUnused();\n this._visibleList = newVisibleList;\n };\n SVGPainter.prototype.resize = function (width, height) {\n var viewport = this._viewport;\n viewport.style.display = 'none';\n var opts = this._opts;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = this._getSize(0);\n height = this._getSize(1);\n viewport.style.display = '';\n if (this._width !== width || this._height !== height) {\n this._width = width;\n this._height = height;\n var viewportStyle = viewport.style;\n viewportStyle.width = width + 'px';\n viewportStyle.height = height + 'px';\n var svgRoot = this._svgDom;\n svgRoot.setAttribute('width', width + '');\n svgRoot.setAttribute('height', height + '');\n }\n if (this._backgroundNode) {\n this._backgroundNode.setAttribute('width', width);\n this._backgroundNode.setAttribute('height', height);\n }\n };\n SVGPainter.prototype.getWidth = function () {\n return this._width;\n };\n SVGPainter.prototype.getHeight = function () {\n return this._height;\n };\n SVGPainter.prototype._getSize = function (whIdx) {\n var opts = this._opts;\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n var root = this.root;\n var stl = document.defaultView.getComputedStyle(root);\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)) | 0;\n };\n SVGPainter.prototype.dispose = function () {\n this.root.innerHTML = '';\n this._svgRoot\n = this._backgroundRoot\n = this._svgDom\n = this._backgroundNode\n = this._viewport\n = this.storage\n = null;\n };\n SVGPainter.prototype.clear = function () {\n var viewportNode = this._viewport;\n if (viewportNode && viewportNode.parentNode) {\n viewportNode.parentNode.removeChild(viewportNode);\n }\n };\n SVGPainter.prototype.toDataURL = function () {\n this.refresh();\n var svgDom = this._svgDom;\n var outerHTML = svgDom.outerHTML\n || (svgDom.parentNode && svgDom.parentNode).innerHTML;\n var html = encodeURIComponent(outerHTML.replace(/></g, '>\\n\\r<'));\n return 'data:image/svg+xml;charset=UTF-8,' + html;\n };\n return SVGPainter;\n}());\nfunction createMethodNotSupport(method) {\n return function () {\n util.logError('In SVG mode painter not support method \"' + method + '\"');\n };\n}\nexport default SVGPainter;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SVGPainter from 'zrender/lib/svg/Painter';\nexport function install(registers) {\n registers.registerPainter('svg', SVGPainter);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\n\nfunction defaultKeyGetter(item) {\n return item;\n}\n\nvar DataDiffer =\n/** @class */\nfunction () {\n /**\n * @param context Can be visited by this.context in callback.\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`;\n\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\n * Callback function when add a data\n */\n\n\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\n * Callback function when update a data\n */\n\n\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n\n\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n\n\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\n * Callback function when remove a data\n */\n\n\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below.\n\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\n * For example, consider the case:\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\n * Where:\n * o0, o1, n0 has key 'a' (many to one)\n * o5, n4, n5, n6 has key 'b' (one to many)\n * o2, n1 has key 'c' (one to one)\n * n2, n3 has key 'd' (add)\n * o3, o4 has key 'e' (remove)\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\n * Then:\n * (The order of the following directives are not ensured.)\n * this._updateManyToOne(n0, [o0, o1]);\n * this._updateOneToMany([n4, n5, n6], o5);\n * this._update(n1, o2);\n * this._remove(o3);\n * this._remove(o4);\n * this._remove(o6);\n * this._remove(o7);\n * this._add(n2);\n * this._add(n3);\n * this._add(n7);\n * this._add(n8);\n */\n\n\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n } // Support both `newDataKeyArr` are duplication removed or not removed.\n\n\n newDataIndexMap[newKey] = null;\n }\n };\n\n DataDiffer.prototype._initIndexMap = function (arr, // Can be null.\n map, // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n\n if (!map) {\n continue;\n }\n\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n\n return DataDiffer;\n}();\n\nexport default DataDiffer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, createHashMap, assert } from 'zrender/lib/core/util';\nimport { VISUAL_DIMENSIONS } from '../../util/types';\nexport function summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = []; // See the comment of `List.js#userOutput`.\n\n var userOutput = summary.userOutput = {\n dimensionNames: data.dimensions.slice(),\n encode: {}\n };\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n }\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}\n\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n\n return encode[dim];\n} // FIXME:TS should be type `AxisType`\n\n\nexport function getDimensionTypeByAxis(axisType) {\n return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\n\nfunction mayLabelDimType(dimType) {\n // In most cases, ordinal and time do not suitable for label.\n // Ordinal info can be displayed on axis. Time is too long.\n return !(dimType === 'ordinal' || dimType === 'time');\n} // function findTheLastDimMayLabel(data) {\n// // Get last value dim\n// let dimensions = data.dimensions.slice();\n// let valueType;\n// let valueDim;\n// while (dimensions.length && (\n// valueDim = dimensions.pop(),\n// valueType = data.getDimensionInfo(valueDim).type,\n// valueType === 'ordinal' || valueType === 'time'\n// )) {} // jshint ignore:line\n// return valueDim;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nvar DataDimensionInfo =\n/** @class */\nfunction () {\n /**\n * @param opt All of the fields will be shallow copied.\n */\n function DataDimensionInfo(opt) {\n /**\n * The format of `otherDims` is:\n * ```js\n * {\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * }\n * ```\n *\n * A `series.encode` can specified these fields:\n * ```js\n * encode: {\n * // \"3, 1, 5\" is the index of data dimension.\n * tooltip: [3, 1, 5],\n * label: [0, 3],\n * ...\n * }\n * ```\n * `otherDims` is the parse result of the `series.encode` above, like:\n * ```js\n * // Suppose the index of this data dimension is `3`.\n * this.otherDims = {\n * // `3` is at the index `0` of the `encode.tooltip`\n * tooltip: 0,\n * // `3` is at the index `1` of the `encode.tooltip`\n * label: 1\n * };\n * ```\n *\n * This prop should never be `null`/`undefined` after initialized.\n */\n this.otherDims = {};\n\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n\n return DataDimensionInfo;\n}();\n\n;\nexport default DataDimensionInfo;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n\n/**\n * List for data storage\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Model from '../model/Model';\nimport DataDiffer from './DataDiffer';\nimport { DefaultDataProvider } from './helper/dataProvider';\nimport { summarizeDimensions } from './helper/dimensionHelper';\nimport DataDimensionInfo from './DataDimensionInfo';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types';\nimport { isDataItemOption, convertOptionIdName } from '../util/model';\nimport { getECData } from '../util/innerStore';\nimport { parseDataValue } from './helper/dataValueHelper';\nimport { isSourceInstance } from './Source';\nvar mathFloor = Math.floor;\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar UNDEFINED = 'undefined';\nvar INDEX_NOT_FOUND = -1; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird udpate animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar dataCtors = {\n 'float': typeof Float64Array === UNDEFINED ? Array : Float64Array,\n 'int': typeof Int32Array === UNDEFINED ? Array : Int32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': Array\n}; // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nvar CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nvar CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nvar CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_rawData', '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_extent', '_approximateExtent', '_rawExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar defaultDimValueGetters;\nvar prepareInvertedIndex;\nvar getIndicesCtor;\nvar prepareStorage;\nvar getRawIndexWithoutIndices;\nvar getRawIndexWithIndices;\nvar getId;\nvar getIdNameFromStore;\nvar makeIdFromName;\nvar normalizeDimensions;\nvar validateDimensions;\nvar cloneListForMapAndSample;\nvar getInitialExtent;\nvar setItemDataAndSeriesIndex;\nvar transferProperties;\n\nvar List =\n/** @class */\nfunction () {\n /**\n * @param dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n */\n function List(dimensions, hostModel) {\n this.type = 'list';\n this._count = 0;\n this._rawCount = 0;\n this._storage = {}; // We have an extra array store here. It's faster to be acessed than KV structured `_storage`.\n // We profile the code `storage[dim]` and it seems to be KeyedLoadIC_Megamorphic instead of fast property access.\n // Not sure why this happens. But using an extra array seems leads to faster `initData`\n // See https://github.com/apache/incubator-echarts/pull/13314 for more explanation.\n\n this._storageArr = [];\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Globel layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elemnents\n\n this._graphicEls = []; // Raw extent will not be cloned, but only transfered.\n // It will not be calculated util needed.\n\n this._rawExtent = {};\n this._extent = {}; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = true; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n /**\n * Get raw data index.\n * Do not initialize.\n * Default `getRawIndex`. And it can be changed.\n */\n\n this.getRawIndex = getRawIndexWithoutIndices;\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new DataDimensionInfo({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof DataDimensionInfo) ? new DataDimensionInfo(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n dimensionInfo.index = i;\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimensionInfos = dimensionInfos;\n this.hostModel = hostModel; // Cache summary info for fast visit. See \"dimensionHelper\".\n\n this._dimensionsSummary = summarizeDimensions(this);\n this._invertedIndicesMap = invertedIndicesMap;\n this.userOutput = this._dimensionsSummary.userOutput;\n }\n /**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * Get dimension name\n * @param dim See above.\n * @return Concrete dim name.\n */\n\n\n List.prototype.getDimension = function (dim) {\n if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim)) {\n dim = this.dimensions[dim];\n }\n\n return dim;\n };\n /**\n * Get type and calculation info of particular dimension\n * @param dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */\n\n\n List.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._dimensionInfos[this.getDimension(dim)];\n };\n /**\n * concrete dimension name list on coord.\n */\n\n\n List.prototype.getDimensionsOnCoord = function () {\n return this._dimensionsSummary.dataDimsOnCoord.slice();\n };\n\n List.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimensionsSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n List.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimensionsSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n /**\n * Initialize from data\n * @param data source or data or data provider.\n * @param nameList The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n */\n\n\n List.prototype.initData = function (data, nameList, dimValueGetter) {\n var notProvider = isSourceInstance(data) || zrUtil.isArrayLike(data);\n var provider = notProvider ? new DefaultDataProvider(data, this.dimensions.length) : data;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(notProvider || zrUtil.isFunction(provider.getItem) && zrUtil.isFunction(provider.count), 'Inavlid data provider.');\n }\n\n this._rawData = provider;\n var sourceFormat = provider.getSource().sourceFormat; // Clear\n\n this._storage = {};\n this._indices = null;\n this._dontMakeIdFromName = this._idDimIdx != null || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY // Cosndier performance.\n || !!provider.fillStorage;\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n if (!dimValueGetter) {\n this.hasItemOption = false;\n }\n\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter = dimValueGetter || this.defaultDimValueGetter;\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows; // Reset raw extent.\n\n this._rawExtent = {};\n\n this._initDataFromProvider(0, provider.count()); // If data has no item option.\n\n\n if (provider.pure) {\n this.hasItemOption = false;\n }\n };\n\n List.prototype.getProvider = function () {\n return this._rawData;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n\n\n List.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!this._indices, 'appendData can only be called on raw data.');\n }\n\n var rawData = this._rawData;\n var start = this.count();\n rawData.appendData(data);\n var end = rawData.count();\n\n if (!rawData.persistent) {\n end += start;\n }\n\n this._initDataFromProvider(start, end, true);\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to storage.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n */\n\n\n List.prototype.appendValues = function (values, names) {\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, names ? names.length : 0);\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\n }\n\n var rawExtentArr = map(dimensions, function (dim) {\n return rawExtent[dim];\n });\n var storageArr = this._storageArr = map(dimensions, function (dim) {\n return storage[dim];\n });\n var emptyDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start; // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\n\n storageArr[dimIdx][idx] = val;\n var dimRawExtent = rawExtentArr[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n\n if (names) {\n this._nameList[idx] = names[sourceIdx];\n\n if (!this._dontMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n };\n\n List.prototype._initDataFromProvider = function (start, end, append) {\n if (start >= end) {\n return;\n }\n\n var rawData = this._rawData;\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var dimensionInfoMap = this._dimensionInfos;\n var nameList = this._nameList;\n var idList = this._idList;\n var rawExtent = this._rawExtent;\n var sourceFormat = rawData.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\n }\n\n var storageArr = this._storageArr = map(dimensions, function (dim) {\n return storage[dim];\n });\n var rawExtentArr = map(dimensions, function (dim) {\n return rawExtent[dim];\n });\n\n if (rawData.fillStorage) {\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\n } else {\n var dataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = rawData.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var dimStorage = storageArr[dimIdx]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\n\n dimStorage[idx] = val;\n var dimRawExtent = rawExtentArr[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n } // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n\n if (isFormatOriginal && !rawData.pure && dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n\n if (!this._dontMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n\n if (!rawData.persistent && rawData.clean) {\n // Clean unused data if data source is typed array.\n rawData.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n };\n\n List.prototype.count = function () {\n return this._count;\n };\n\n List.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this);\n newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n }; // Get data by index of dimension.\n // Because in v8 access array by number variable is faster than access object by string variable\n // Not sure why but the optimization just works.\n\n\n List.prototype.getByDimIdx = function (dimIdx, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._storageArr[dimIdx];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n /**\n * Get value. Return NaN if idx is out of range.\n * @param dim Dim must be concrete name.\n */\n\n\n List.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._storage[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n /**\n * @param dim concrete dim\n */\n\n\n List.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._storage[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n\n List.prototype.getValues = function (dimensions, idx) {\n var values = [];\n\n if (!zrUtil.isArray(dimensions)) {\n // stack = idx;\n idx = dimensions;\n dimensions = this.dimensions;\n }\n\n for (var i = 0, len = dimensions.length; i < len; i++) {\n values.push(this.get(dimensions[i], idx\n /*, stack */\n ));\n }\n\n return values;\n };\n /**\n * If value is NaN. Inlcuding '-'\n * Only check the coord dimensions.\n */\n\n\n List.prototype.hasValue = function (idx) {\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\n\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * Get extent of data in one dimension\n */\n\n\n List.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n dim = this.getDimension(dim);\n var dimData = this._storage[dim];\n var initialExtent = getInitialExtent(); // stack = !!((stack || false) && this.getCalculationInfo(dim));\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // let cacheName = [dim, !!stack].join('_');\n // let cacheName = dim;\n // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices; // && !stack;\n\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\n * PENDING: In fact currently this function is only used to short-circuit\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\n * be still needed.\n *\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */\n\n\n List.prototype.getApproximateExtent = function (dim) {\n dim = this.getDimension(dim);\n return this._approximateExtent[dim] || this.getDataExtent(dim);\n };\n /**\n * Calculate extent on a filtered data might be time consuming.\n * Approximate extent is only used for: calculte extent of filtered data outside.\n */\n\n\n List.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n List.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n List.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\n * Get sum of data in one dimension\n */\n\n\n List.prototype.getSum = function (dim) {\n var dimData = this._storage[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n };\n /**\n * Get median of data in one dimension\n */\n\n\n List.prototype.getMedian = function (dim) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each(dim, function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n }; // /**\n // * Retreive the index with given value\n // * @param {string} dim Concrete dimension.\n // * @param {number} value\n // * @return {number}\n // */\n // Currently incorrect: should return dataIndex but not rawIndex.\n // Do not fix it until this method is to be used somewhere.\n // FIXME Precision of float value\n // indexOf(dim, value) {\n // let storage = this._storage;\n // let dimData = storage[dim];\n // let chunkSize = this._chunkSize;\n // if (dimData) {\n // for (let i = 0, len = this.count(); i < len; i++) {\n // let chunkIndex = mathFloor(i / chunkSize);\n // let chunkOffset = i % chunkSize;\n // if (dimData[chunkIndex][chunkOffset] === value) {\n // return i;\n // }\n // }\n // }\n // return -1;\n // }\n\n /**\n * Only support the dimension which inverted index created.\n * Do not support other cases until required.\n * @param dim concrete dim\n * @param value ordinal index\n * @return rawIndex\n */\n\n\n List.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\n * Retreive the index with given name\n */\n\n\n List.prototype.indexOfName = function (name) {\n for (var i = 0, len = this.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n /**\n * Retreive the index with given raw data index\n */\n\n\n List.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n };\n /**\n * Retreive the index of nearest value\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices has\n * the same value, they are put to the result.\n */\n\n\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var storage = this._storage;\n var dimData = storage[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/List.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we chose the one that `diff >= 0` in this csae.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n /**\n * Get raw data item\n */\n\n\n List.prototype.getRawDataItem = function (idx) {\n if (!this._rawData.persistent) {\n var val = [];\n\n for (var i = 0; i < this.dimensions.length; i++) {\n var dim = this.dimensions[i];\n val.push(this.get(dim, idx));\n }\n\n return val;\n } else {\n return this._rawData.getItem(this.getRawIndex(idx));\n }\n };\n /**\n * @return Never be null/undefined. `number` will be converted to string. Becuase:\n * In most cases, name is used in display, where returning a string is more convenient.\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\n * rule that name `2` equals to name `'2'`.\n */\n\n\n List.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n /**\n * @return Never null/undefined. `number` will be converted to string. Becuase:\n * In all cases having encountered at present, id is used in making diff comparison, which\n * are usually based on hash map. We can keep the rule that the internal id are always string\n * (treat `2` is the same as `'2'`) to make the related logic simple.\n */\n\n\n List.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n var _this = this;\n\n if (!this._count) {\n return;\n }\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var dimSize = dimNames.length;\n var dimIndices = map(dimNames, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var storageArr = this._storageArr;\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n switch (dimSize) {\n case 0:\n cb.call(fCtx, i);\n break;\n\n case 1:\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\n break;\n\n case 2:\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = storageArr[dimIndices[k]][rawIdx];\n } // Index\n\n\n value[k] = i;\n cb.apply(fCtx, value);\n }\n }\n };\n\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n var _this = this;\n\n if (!this._count) {\n return;\n }\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var count = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dimNames.length;\n var offset = 0;\n var dimIndices = map(dimNames, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var dim0 = dimIndices[0];\n var storageArr = this._storageArr;\n\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb.call(fCtx, i);\n } else if (dimSize === 1) {\n var val = storageArr[dim0][rawIdx];\n keep = cb.call(fCtx, val, i);\n } else {\n var k = 0;\n\n for (; k < dimSize; k++) {\n value[k] = storageArr[dimIndices[k]][rawIdx];\n }\n\n value[k] = i;\n keep = cb.apply(fCtx, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n\n\n List.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var len = this._count;\n\n if (!len) {\n return;\n }\n\n var dimensions = [];\n\n for (var dim in range) {\n if (range.hasOwnProperty(dim)) {\n dimensions.push(dim);\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimensions);\n }\n\n var dimSize = dimensions.length;\n\n if (!dimSize) {\n return;\n }\n\n var originalCount = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dimensions[0];\n var dimIndices = map(dimensions, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storageArr = this._storageArr;\n var quickFinished = false;\n\n if (!this._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = storageArr[dimIndices[0]];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storageArr[dimIndices[0]];\n var dimStorage2 = storageArr[dimIndices[1]];\n var min2 = range[dimensions[1]][0];\n var max2 = range[dimensions[1]][1];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = this.getRawIndex(i);\n var val = storageArr[dimIndices[0]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = this.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dimensions[k];\n var val = storageArr[dimIndices[k]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = this.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n };\n /* eslint-enable */\n\n\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || ctxCompat || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var list = cloneListForMapAndSample(this, dimNames);\n var storage = list._storage; // Following properties are all immutable.\n // So we can reference to the same value\n\n list._indices = this._indices;\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n var tmpRetValue = [];\n var dimSize = dimNames.length;\n var dataCount = this.count();\n var values = [];\n var rawExtent = list._rawExtent;\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(fCtx, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n var rawIndex = this.getRawIndex(dataIndex);\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dimNames[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = storage[dim];\n\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n\n return list;\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n\n\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this, [dimension]);\n var targetStorage = list._storage;\n var frameValues = [];\n var frameSize = mathFloor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = list._rawExtent[dimension];\n var newIndices = new (getIndicesCtor(this))(len);\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data\n\n dimStore[sampleFrameIdx] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n list._count = offset;\n list._indices = newIndices;\n list.getRawIndex = getRawIndexWithIndices;\n return list;\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n\n\n List.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this, []);\n var targetStorage = list._storage;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var newIndices = new (getIndicesCtor(this))(len);\n var sampledIndex = 0;\n var frameSize = mathFloor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex; // First frame use the first data.\n\n newIndices[sampledIndex++] = currentRawIndex;\n\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n }\n\n avgY += y;\n }\n\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart; // Find a point from current frame that construct a triangel with largest area with previous selected point\n // And the average of next frame.\n\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n } // Calculate triangle area over three buckets\n\n\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n } // First frame use the last data.\n\n\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n list._count = sampledIndex;\n list._indices = newIndices;\n list.getRawIndex = getRawIndexWithIndices;\n return list;\n };\n /**\n * Get model of one data item.\n */\n // TODO: Type of data item\n\n\n List.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\n * Create a data differ\n */\n\n\n List.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\n * Get visual property.\n */\n\n\n List.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n List.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\n * Get visual property of single data item\n */\n // eslint-disable-next-line\n\n\n List.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\n * If exists visual property of single data item\n */\n\n\n List.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\n * Make sure itemVisual property is unique\n */\n // TODO: use key to save visual to reduce memory.\n\n\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n List.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\n * Clear itemVisuals and list visual.\n */\n\n\n List.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n List.prototype.setLayout = function (key, val) {\n if (isObject(key)) {\n for (var name_1 in key) {\n if (key.hasOwnProperty(name_1)) {\n this.setLayout(name_1, key[name_1]);\n }\n }\n\n return;\n }\n\n this._layout[key] = val;\n };\n /**\n * Get layout property.\n */\n\n\n List.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\n * Get layout of single data item\n */\n\n\n List.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\n * Set layout of single data item\n */\n\n\n List.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\n * Clear all layout of single data item\n */\n\n\n List.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\n * Set graphic element relative to data. It can be set as null\n */\n\n\n List.prototype.setItemGraphicEl = function (idx, el) {\n var hostModel = this.hostModel;\n\n if (el) {\n var ecData = getECData(el); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n ecData.dataIndex = idx;\n ecData.dataType = this.dataType;\n ecData.seriesIndex = hostModel && hostModel.seriesIndex; // TODO: not store dataIndex on children.\n\n if (el.type === 'group') {\n el.traverse(setItemDataAndSeriesIndex, el);\n }\n }\n\n this._graphicEls[idx] = el;\n };\n\n List.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n List.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */\n\n\n List.prototype.cloneShallow = function (list) {\n if (!list) {\n var dimensionInfoList = map(this.dimensions, this.getDimensionInfo, this);\n list = new List(dimensionInfoList, this.hostModel);\n } // FIXME\n\n\n list._storage = this._storage;\n list._storageArr = this._storageArr;\n transferProperties(list, this); // Clone will not change the data extent and indices\n\n if (this._indices) {\n var Ctor = this._indices.constructor;\n\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n list._indices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n list._indices[i] = this._indices[i];\n }\n } else {\n list._indices = new Ctor(this._indices);\n }\n } else {\n list._indices = null;\n }\n\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return list;\n };\n /**\n * Wrap some method to add more feature\n */\n\n\n List.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (typeof originalMethod !== 'function') {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n List.internalField = function () {\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, dimName, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); // If any dataItem is like { value: 10 }\n\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensionInfos[dimName]);\n },\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\n }\n\n prepareInvertedIndex = function (list) {\n var invertedIndicesMap = list._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = list._dimensionInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < list._count; i++) {\n // Only support the case that all values are distinct.\n invertedIndices[list.get(dim, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\n var val;\n var chunk = list._storageArr[dimIdx];\n\n if (chunk) {\n val = chunk[rawIndex];\n\n if (ordinalMeta && ordinalMeta.categories.length) {\n val = ordinalMeta.categories[val];\n }\n }\n\n return convertOptionIdName(val, null);\n };\n\n getIndicesCtor = function (list) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n };\n\n prepareStorage = function (storage, dimInfo, end, append) {\n var DataCtor = dataCtors[dimInfo.type];\n var dim = dimInfo.name;\n\n if (append) {\n var oldStore = storage[dim];\n var oldLen = oldStore && oldStore.length;\n\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n\n storage[dim] = newStore;\n }\n } else {\n storage[dim] = new DataCtor(end);\n }\n };\n\n getRawIndexWithoutIndices = function (idx) {\n return idx;\n };\n\n getRawIndexWithIndices = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n };\n /**\n * @see the comment of `List['getId']`.\n */\n\n\n getId = function (list, rawIndex) {\n var id = list._idList[rawIndex];\n\n if (id == null && list._idDimIdx != null) {\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n\n validateDimensions = function (list, dims) {\n for (var i = 0; i < dims.length; i++) {\n // stroage may be empty when no data, so use\n // dimensionInfos to check.\n if (!list._dimensionInfos[dims[i]]) {\n console.error('Unkown dimension ' + dims[i]);\n }\n }\n }; // Data in excludeDimensions is copied, otherwise transfered.\n\n\n cloneListForMapAndSample = function (original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage;\n var storageArr = list._storageArr = []; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneChunk(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n\n storageArr.push(storage[dim]);\n }\n }\n\n return list;\n };\n\n function cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n }\n\n getInitialExtent = function () {\n return [Infinity, -Infinity];\n };\n\n setItemDataAndSeriesIndex = function (child) {\n var childECData = getECData(child);\n var thisECData = getECData(this);\n childECData.seriesIndex = thisECData.seriesIndex;\n childECData.dataIndex = thisECData.dataIndex;\n childECData.dataType = thisECData.dataType;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (list, idx) {\n var nameList = list._nameList;\n var idList = list._idList;\n var nameDimIdx = list._nameDimIdx;\n var idDimIdx = list._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = list._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return List;\n}();\n\nexport default List;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\nimport { createHashMap, each, isString, defaults, extend, isObject, clone } from 'zrender/lib/core/util';\nimport { normalizeToArray } from '../../util/model';\nimport { guessOrdinal, BE_ORDINAL } from './sourceHelper';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source';\nimport { VISUAL_DIMENSIONS } from '../../util/types';\nimport DataDimensionInfo from '../DataDimensionInfo';\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `sysDims`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.<string>} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.<Object|string>} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists.\n * If not specified, auto find the next available data dim.\n * param source {module:data/Source}\n * param dimCount {number}\n * return {Object} encode Never be `null/undefined`.\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @return {Array.<module:data/DataDimensionInfo>}\n */\n\nfunction completeDimensions(sysDims, source, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // let valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItemRaw = dimsDef[i];\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = new DataDimensionInfo(); // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n }\n\n var encodeDef = opt.encodeDef;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n var encodeDefMap = createHashMap(encodeDef); // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first colum should better be treated as a \"ordinal\" although it\n // might not able to be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nexport default completeDimensions;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Substitute `completeDimensions`.\n * `completeDimensions` is to be deprecated.\n */\nimport completeDimensions from './completeDimensions';\n/**\n * @param opt.coordDimensions\n * @param opt.dimensionsDefine By default `source.dimensionsDefine` Overwrite source define.\n * @param opt.encodeDefine By default `source.encodeDefine` Overwrite source define.\n * @param opt.encodeDefaulter Make default encode if user not specified.\n */\n\nexport default function createDimensions( // TODO: TYPE completeDimensions type\nsource, opt) {\n opt = opt || {};\n return completeDimensions(opt.coordDimensions || [], source, {\n // FIXME:TS detect whether source then call `.dimensionsDefine` and `.encodeDefine`?\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\n encodeDef: opt.encodeDefine || source.encodeDefine,\n dimCount: opt.dimensionsCount,\n encodeDefaulter: opt.encodeDefaulter,\n generateCoord: opt.generateCoord,\n generateCoordCount: opt.generateCoordCount\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\nimport { createHashMap, retrieve, each } from 'zrender/lib/core/util';\nimport { SINGLE_REFERRING } from '../util/model';\n/**\n * @class\n * For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // The index of the first category axis in `coordSysDims`.\n * // `null/undefined` means no category axis exists.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\n\nvar CoordSysInfo =\n/** @class */\nfunction () {\n function CoordSysInfo(coordSysName) {\n this.coordSysDims = [];\n this.axisMap = createHashMap();\n this.categoryAxisMap = createHashMap();\n this.coordSysName = coordSysName;\n }\n\n return CoordSysInfo;\n}();\n\nexport function getCoordSysInfoBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = new CoordSysInfo(coordSysName);\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!xAxisModel) {\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\n }\n\n if (!yAxisModel) {\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\n }\n }\n\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!singleAxisModel) {\n throw new Error('singleAxis should be specified.');\n }\n }\n\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!angleAxisModel) {\n throw new Error('angleAxis option not found');\n }\n\n if (!radiusAxisModel) {\n throw new Error('radiusAxis option not found');\n }\n }\n\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n\n if (isCategory(axisModel)) {\n categoryAxisMap.set(axisDim, axisModel);\n\n if (result.firstCategoryDimIndex == null) {\n result.firstCategoryDimIndex = index;\n }\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString } from 'zrender/lib/core/util';\n/**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param seriesModel\n * @param dimensionInfoList The same as the input of <module:echarts/data/List>.\n * The input dimensionInfoList will be modified.\n * @param opt\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\n * @param opt.byIndex=false\n * @return calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */\n\nexport function enableDataStack(seriesModel, dimensionInfoList, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension; // Compatibal: when `stack` is set as '', do not stack.\n\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionInfoList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionInfoList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n } // Find the first stackable dimension as the stackedDimInfo.\n\n\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n\n\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n stackResultDimension = '__\\0ecstackresult';\n stackedOverDimension = '__\\0ecstackedover'; // Create inverted index to fast query index by value.\n\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex_1 = 0;\n each(dimensionInfoList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n stackedDimCoordIndex_1++;\n }\n });\n dimensionInfoList.push({\n name: stackResultDimension,\n coordDim: stackedDimCoordDim_1,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n stackedDimCoordIndex_1++;\n dimensionInfoList.push({\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n }\n\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\nexport function isDimensionStacked(data, stackedDim\n/*, stackedByDim*/\n) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); // && (\n // stackedByDim != null\n // ? stackedByDim === data.getCalculationInfo('stackedByDimension')\n // : data.getCalculationInfo('isStackedByIndex')\n // );\n}\nexport function getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport List from '../../data/List';\nimport createDimensions from '../../data/helper/createDimensions';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper';\nimport { getDataItemValue } from '../../util/model';\nimport CoordinateSystem from '../../core/CoordinateSystem';\nimport { getCoordSysInfoBySeries } from '../../model/referHelper';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../../data/Source';\nimport { enableDataStack } from '../../data/helper/dataStackHelper';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper';\nimport { SOURCE_FORMAT_ORIGINAL } from '../../util/types';\n\nfunction createListFromArray(source, seriesModel, opt) {\n opt = opt || {};\n\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs;\n\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var dimInfoList = createDimensions(source, {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefaulter: zrUtil.isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null\n });\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n\n if (opt.createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\n var list = new List(dimInfoList, seriesModel);\n list.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n list.hasItemOption = false;\n list.initData(source, null, dimValueGetter);\n return list;\n}\n\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return sampleItem != null && !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\n\nfunction firstDataNotNull(data) {\n var i = 0;\n\n while (i < data.length && data[i] == null) {\n i++;\n }\n\n return data[i];\n}\n\nexport default createListFromArray;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createListFromArray from '../helper/createListFromArray';\nimport SeriesModel from '../../model/Series';\nimport { createSymbol } from '../../util/symbol';\nimport { Group } from '../../util/graphic';\n\nvar LineSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LineSeriesModel, _super);\n\n function LineSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LineSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n LineSeriesModel.prototype.getInitialData = function (option) {\n if (process.env.NODE_ENV !== 'production') {\n var coordSys = option.coordinateSystem;\n\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\n }\n }\n\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: true\n });\n };\n\n LineSeriesModel.prototype.getLegendIcon = function (opt) {\n var group = new Group();\n var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);\n group.add(line);\n line.setStyle(opt.lineStyle);\n var visualType = this.getData().getVisual('symbol');\n var symbolType = visualType === 'none' ? 'circle' : visualType; // Symbol size is 80% when there is a line\n\n var size = opt.itemHeight * 0.8;\n var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill, opt.symbolKeepAspect);\n group.add(symbol);\n symbol.setStyle(opt.itemStyle);\n\n if (symbolType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n\n return group;\n };\n\n LineSeriesModel.type = 'series.line';\n LineSeriesModel.dependencies = ['grid', 'polar'];\n LineSeriesModel.defaultOption = {\n zlevel: 0,\n z: 3,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n clip: true,\n label: {\n position: 'top'\n },\n // itemStyle: {\n // },\n endLabel: {\n show: false,\n valueAnimation: true,\n distance: 8\n },\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n emphasis: {\n scale: true,\n lineStyle: {\n width: 'bolder'\n }\n },\n // areaStyle: {\n // origin of areaStyle. Valid values:\n // `'auto'/null/undefined`: from axisLine to data\n // `'start'`: from min to data\n // `'end'`: from data to max\n // origin: 'auto'\n // },\n // false, 'start', 'end', 'middle'\n step: false,\n // Disabled if step is true\n smooth: false,\n smoothMonotone: null,\n symbol: 'emptyCircle',\n symbolSize: 4,\n symbolRotate: null,\n showSymbol: true,\n // `false`: follow the label interval strategy.\n // `true`: show all symbols.\n // `'auto'`: If possible, show all symbols, otherwise\n // follow the label interval strategy.\n showAllSymbol: 'auto',\n // Whether to connect break point.\n connectNulls: false,\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\n sampling: 'none',\n animationEasing: 'linear',\n // Disable progressive\n progressive: 0,\n hoverLayerThreshold: Infinity\n };\n return LineSeriesModel;\n}(SeriesModel);\n\nexport default LineSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieveRawValue } from '../../data/helper/dataProvider';\nimport { isArray } from 'zrender/lib/core/util';\n/**\n * @return label string. Not null/undefined\n */\n\nexport function getDefaultLabel(data, dataIndex) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1)\n\n if (len === 1) {\n var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\n return rawVal != null ? rawVal + '' : null;\n } else if (len) {\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\n }\n\n return vals.join(' ');\n }\n}\nexport function getDefaultInterpolatedLabel(data, interpolatedValue) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n\n if (!isArray(interpolatedValue)) {\n return interpolatedValue + '';\n }\n\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n var dimInfo = data.getDimensionInfo(labelDims[i]);\n\n if (dimInfo) {\n vals.push(interpolatedValue[dimInfo.index]);\n }\n }\n\n return vals.join(' ');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol } from '../../util/symbol';\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport { enterEmphasis, leaveEmphasis, enableHoverEmphasis } from '../../util/states';\nimport { parsePercent } from '../../util/number';\nimport { getDefaultLabel } from './labelHelper';\nimport { extend, isArray, retrieve2 } from 'zrender/lib/core/util';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport ZRImage from 'zrender/lib/graphic/Image';\n\nvar Symbol =\n/** @class */\nfunction (_super) {\n __extends(Symbol, _super);\n\n function Symbol(data, idx, seriesScope, opts) {\n var _this = _super.call(this) || this;\n\n _this.updateData(data, idx, seriesScope, opts);\n\n return _this;\n }\n\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\n // Remove paths created before\n this.removeAll(); // let symbolPath = createSymbol(\n // symbolType, -0.5, -0.5, 1, 1, color\n // );\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4150.\n\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\n symbolPath.attr({\n z2: 100,\n culling: true,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n }); // Rewrite drift method\n\n symbolPath.drift = driftSymbol;\n this._symbolType = symbolType;\n this.add(symbolPath);\n };\n /**\n * Stop animation\n * @param {boolean} toLastFrame\n */\n\n\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\n this.childAt(0).stopAnimation(null, toLastFrame);\n };\n /**\n * FIXME:\n * Caution: This method breaks the encapsulation of this module,\n * but it indeed brings convenience. So do not use the method\n * unless you detailedly know all the implements of `Symbol`,\n * especially animation.\n *\n * Get symbol path element.\n */\n\n\n Symbol.prototype.getSymbolPath = function () {\n return this.childAt(0);\n };\n /**\n * Highlight symbol\n */\n\n\n Symbol.prototype.highlight = function () {\n enterEmphasis(this.childAt(0));\n };\n /**\n * Downplay symbol\n */\n\n\n Symbol.prototype.downplay = function () {\n leaveEmphasis(this.childAt(0));\n };\n /**\n * @param {number} zlevel\n * @param {number} z\n */\n\n\n Symbol.prototype.setZ = function (zlevel, z) {\n var symbolPath = this.childAt(0);\n symbolPath.zlevel = zlevel;\n symbolPath.z = z;\n };\n\n Symbol.prototype.setDraggable = function (draggable) {\n var symbolPath = this.childAt(0);\n symbolPath.draggable = draggable;\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\n };\n /**\n * Update symbol properties\n */\n\n\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\n this.silent = false;\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n var seriesModel = data.hostModel;\n var symbolSize = Symbol.getSymbolSize(data, idx);\n var isInit = symbolType !== this._symbolType;\n var disableAnimation = opts && opts.disableAnimation;\n\n if (isInit) {\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\n\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\n } else {\n var symbolPath = this.childAt(0);\n symbolPath.silent = false;\n var target = {\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n };\n disableAnimation ? symbolPath.attr(target) : graphic.updateProps(symbolPath, target, seriesModel, idx);\n }\n\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\n\n if (isInit) {\n var symbolPath = this.childAt(0);\n\n if (!disableAnimation) {\n var target = {\n scaleX: this._sizeX,\n scaleY: this._sizeY,\n style: {\n // Always fadeIn. Because it has fadeOut animation when symbol is removed..\n opacity: symbolPath.style.opacity\n }\n };\n symbolPath.scaleX = symbolPath.scaleY = 0;\n symbolPath.style.opacity = 0;\n graphic.initProps(symbolPath, target, seriesModel, idx);\n }\n }\n\n if (disableAnimation) {\n // Must stop remove animation manually if don't call initProps or updateProps.\n this.childAt(0).stopAnimation('remove');\n }\n\n this._seriesModel = seriesModel;\n };\n\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\n var symbolPath = this.childAt(0);\n var seriesModel = data.hostModel;\n var emphasisItemStyle;\n var blurItemStyle;\n var selectItemStyle;\n var focus;\n var blurScope;\n var labelStatesModels;\n var hoverScale;\n var cursorStyle;\n\n if (seriesScope) {\n emphasisItemStyle = seriesScope.emphasisItemStyle;\n blurItemStyle = seriesScope.blurItemStyle;\n selectItemStyle = seriesScope.selectItemStyle;\n focus = seriesScope.focus;\n blurScope = seriesScope.blurScope;\n labelStatesModels = seriesScope.labelStatesModels;\n hoverScale = seriesScope.hoverScale;\n cursorStyle = seriesScope.cursorStyle;\n }\n\n if (!seriesScope || data.hasItemOption) {\n var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n hoverScale = emphasisModel.getShallow('scale');\n cursorStyle = itemModel.getShallow('cursor');\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\n var symbolOffset = data.getItemVisual(idx, 'symbolOffset') || 0;\n\n if (symbolOffset) {\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n\n symbolPath.x = parsePercent(symbolOffset[0], symbolSize[0]);\n symbolPath.y = parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]) || 0, symbolSize[1]);\n }\n\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n if (symbolPath.__isEmptyBrush) {\n // fill and stroke will be swapped if it's empty.\n // So we cloned a new style to avoid it affecting the original style in visual storage.\n // TODO Better implementation. No empty logic!\n symbolPath.useStyle(extend({}, symbolStyle));\n } else {\n symbolPath.useStyle(symbolStyle);\n } // Disable decal because symbol scale will been applied on the decal.\n\n\n symbolPath.style.decal = null;\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\n symbolPath.style.strokeNoScale = true;\n }\n\n var liftZ = data.getItemVisual(idx, 'liftZ');\n var z2Origin = this._z2;\n\n if (liftZ != null) {\n if (z2Origin == null) {\n this._z2 = symbolPath.z2;\n symbolPath.z2 += liftZ;\n }\n } else if (z2Origin != null) {\n symbolPath.z2 = z2Origin;\n this._z2 = null;\n }\n\n var useNameLabel = opts && opts.useNameLabel;\n setLabelStyle(symbolPath, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultText: getLabelDefaultText,\n inheritColor: visualColor,\n defaultOpacity: symbolStyle.opacity\n }); // Do not execute util needed.\n\n function getLabelDefaultText(idx) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }\n\n this._sizeX = symbolSize[0] / 2;\n this._sizeY = symbolSize[1] / 2;\n var emphasisState = symbolPath.ensureState('emphasis');\n emphasisState.style = emphasisItemStyle;\n symbolPath.ensureState('select').style = selectItemStyle;\n symbolPath.ensureState('blur').style = blurItemStyle;\n\n if (hoverScale) {\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\n emphasisState.scaleX = this._sizeX * scaleRatio;\n emphasisState.scaleY = this._sizeY * scaleRatio;\n }\n\n this.setSymbolScale(1);\n enableHoverEmphasis(this, focus, blurScope);\n };\n\n Symbol.prototype.setSymbolScale = function (scale) {\n this.scaleX = this.scaleY = scale;\n };\n\n Symbol.prototype.fadeOut = function (cb, opt) {\n var symbolPath = this.childAt(0);\n var seriesModel = this._seriesModel;\n var dataIndex = getECData(this).dataIndex;\n var animationOpt = opt && opt.animation; // Avoid mistaken hover when fading out\n\n this.silent = symbolPath.silent = true; // Not show text when animating\n\n if (opt && opt.fadeLabel) {\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n graphic.removeElement(textContent, {\n style: {\n opacity: 0\n }\n }, seriesModel, {\n dataIndex: dataIndex,\n removeOpt: animationOpt,\n cb: function () {\n symbolPath.removeTextContent();\n }\n });\n }\n } else {\n symbolPath.removeTextContent();\n }\n\n graphic.removeElement(symbolPath, {\n style: {\n opacity: 0\n },\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: dataIndex,\n cb: cb,\n removeOpt: animationOpt\n });\n };\n\n Symbol.getSymbolSize = function (data, idx) {\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\n return isArray(symbolSize) ? symbolSize.slice() : [+symbolSize, +symbolSize];\n };\n\n return Symbol;\n}(graphic.Group);\n\nfunction driftSymbol(dx, dy) {\n this.parent.drift(dx, dy);\n}\n\nexport default Symbol;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic';\nimport SymbolClz from './Symbol';\nimport { isObject } from 'zrender/lib/core/util';\nimport { getLabelStatesModels } from '../../label/labelStyle';\n\nfunction symbolNeedsDraw(data, point, idx, opt) {\n return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) // We do not set clipShape on group, because it will cut part of\n // the symbol element shape. We use the same clip shape here as\n // the line clip.\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none';\n}\n\nfunction normalizeUpdateOpt(opt) {\n if (opt != null && !isObject(opt)) {\n opt = {\n isIgnore: opt\n };\n }\n\n return opt || {};\n}\n\nfunction makeSeriesScope(data) {\n var seriesModel = data.hostModel;\n var emphasisModel = seriesModel.getModel('emphasis');\n return {\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\n focus: emphasisModel.get('focus'),\n blurScope: emphasisModel.get('blurScope'),\n hoverScale: emphasisModel.get('scale'),\n labelStatesModels: getLabelStatesModels(seriesModel),\n cursorStyle: seriesModel.get('cursor')\n };\n}\n\nvar SymbolDraw =\n/** @class */\nfunction () {\n function SymbolDraw(SymbolCtor) {\n this.group = new graphic.Group();\n this._SymbolCtor = SymbolCtor || SymbolClz;\n }\n /**\n * Update symbols draw by new data\n */\n\n\n SymbolDraw.prototype.updateData = function (data, opt) {\n opt = normalizeUpdateOpt(opt);\n var group = this.group;\n var seriesModel = data.hostModel;\n var oldData = this._data;\n var SymbolCtor = this._SymbolCtor;\n var disableAnimation = opt.disableAnimation;\n var seriesScope = makeSeriesScope(data);\n var symbolUpdateOpt = {\n disableAnimation: disableAnimation\n };\n\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\n return data.getItemLayout(idx);\n }; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n\n if (!oldData) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n var point = getSymbolPoint(newIdx);\n\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n var point = getSymbolPoint(newIdx);\n\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\n group.remove(symbolEl);\n return;\n }\n\n if (!symbolEl) {\n symbolEl = new SymbolCtor(data, newIdx);\n symbolEl.setPosition(point);\n } else {\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\n var target = {\n x: point[0],\n y: point[1]\n };\n disableAnimation ? symbolEl.attr(target) : graphic.updateProps(symbolEl, target, seriesModel);\n } // Add back\n\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && el.fadeOut(function () {\n group.remove(el);\n });\n }).execute();\n this._getSymbolPoint = getSymbolPoint;\n this._data = data;\n };\n\n ;\n\n SymbolDraw.prototype.isPersistent = function () {\n return true;\n };\n\n ;\n\n SymbolDraw.prototype.updateLayout = function () {\n var _this = this;\n\n var data = this._data;\n\n if (data) {\n // Not use animation\n data.eachItemGraphicEl(function (el, idx) {\n var point = _this._getSymbolPoint(idx);\n\n el.setPosition(point);\n el.markRedraw();\n });\n }\n };\n\n ;\n\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._seriesScope = makeSeriesScope(data);\n this._data = null;\n this.group.removeAll();\n };\n\n ;\n /**\n * Update symbols draw by new data\n */\n\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n opt = normalizeUpdateOpt(opt);\n\n function updateIncrementalAndHover(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var point = data.getItemLayout(idx);\n\n if (symbolNeedsDraw(data, point, idx, opt)) {\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n el.setPosition(point);\n this.group.add(el);\n data.setItemGraphicEl(idx, el);\n }\n }\n };\n\n ;\n\n SymbolDraw.prototype.remove = function (enableAnimation) {\n var group = this.group;\n var data = this._data; // Incremental model do not have this._data.\n\n if (data && enableAnimation) {\n data.eachItemGraphicEl(function (el) {\n el.fadeOut(function () {\n group.remove(el);\n });\n });\n } else {\n group.removeAll();\n }\n };\n\n ;\n return SymbolDraw;\n}();\n\nexport default SymbolDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper';\nimport { map } from 'zrender/lib/core/util';\nexport function prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked = false;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n // jshint ignore:line\n stacked = true;\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n // jshint ignore:line\n stacked = true;\n dims[1] = stackResultDim;\n }\n\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\n\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n } // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n } // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n } // If is one positive, and one negative, onZero shall be true\n\n }\n\n return valueStart;\n}\n\nexport function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util';\n/* global Float32Array */\n\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\nexport function createFloat32Array(arg) {\n if (isArray(arg)) {\n // Return self directly if don't support TypedArray.\n return supportFloat32Array ? new Float32Array(arg) : arg;\n } // Else is number\n\n\n return new Float32ArrayCtor(arg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper';\nimport { createFloat32Array } from '../../util/vendor';\n\nfunction diffData(oldData, newData) {\n var diffResult = [];\n newData.diff(oldData).add(function (idx) {\n diffResult.push({\n cmd: '+',\n idx: idx\n });\n }).update(function (newIdx, oldIdx) {\n diffResult.push({\n cmd: '=',\n idx: oldIdx,\n idx1: newIdx\n });\n }).remove(function (idx) {\n diffResult.push({\n cmd: '-',\n idx: idx\n });\n }).execute();\n return diffResult;\n}\n\nexport default function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n var diff = diffData(oldData, newData); // let newIdList = newData.mapArray(newData.getId);\n // let oldIdList = oldData.mapArray(oldData.getId);\n // convertToIntId(newIdList, oldIdList);\n // // FIXME One data ?\n // diff = arrayDiff(oldIdList, newIdList);\n\n var currPoints = [];\n var nextPoints = []; // Points for stacking base line\n\n var currStackedPoints = [];\n var nextStackedPoints = [];\n var status = [];\n var sortedIndices = [];\n var rawIndices = [];\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n var oldPoints = oldData.getLayout('points') || [];\n var newPoints = newData.getLayout('points') || [];\n\n for (var i = 0; i < diff.length; i++) {\n var diffItem = diff[i];\n var pointAdded = true;\n var oldIdx2 = void 0;\n var newIdx2 = void 0; // FIXME, animation is not so perfect when dataZoom window moves fast\n // Which is in case remvoing or add more than one data in the tail or head\n\n switch (diffItem.cmd) {\n case '=':\n oldIdx2 = diffItem.idx * 2;\n newIdx2 = diffItem.idx1 * 2;\n var currentX = oldPoints[oldIdx2];\n var currentY = oldPoints[oldIdx2 + 1];\n var nextX = newPoints[newIdx2];\n var nextY = newPoints[newIdx2 + 1]; // If previous data is NaN, use next point directly\n\n if (isNaN(currentX) || isNaN(currentY)) {\n currentX = nextX;\n currentY = nextY;\n }\n\n currPoints.push(currentX, currentY);\n nextPoints.push(nextX, nextY);\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\n break;\n\n case '+':\n var newIdx = diffItem.idx;\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\n var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);\n newIdx2 = newIdx * 2;\n currPoints.push(oldPt[0], oldPt[1]);\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(newIdx));\n break;\n\n case '-':\n pointAdded = false;\n } // Original indices\n\n\n if (pointAdded) {\n status.push(diffItem);\n sortedIndices.push(sortedIndices.length);\n }\n } // Diff result may be crossed if all items are changed\n // Sort by data index\n\n\n sortedIndices.sort(function (a, b) {\n return rawIndices[a] - rawIndices[b];\n });\n var len = currPoints.length;\n var sortedCurrPoints = createFloat32Array(len);\n var sortedNextPoints = createFloat32Array(len);\n var sortedCurrStackedPoints = createFloat32Array(len);\n var sortedNextStackedPoints = createFloat32Array(len);\n var sortedStatus = [];\n\n for (var i = 0; i < sortedIndices.length; i++) {\n var idx = sortedIndices[i];\n var i2 = i * 2;\n var idx2 = idx * 2;\n sortedCurrPoints[i2] = currPoints[idx2];\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\n sortedNextPoints[i2] = nextPoints[idx2];\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\n sortedStatus[i] = status[idx];\n }\n\n return {\n current: sortedCurrPoints,\n next: sortedNextPoints,\n stackedOnCurrent: sortedCurrStackedPoints,\n stackedOnNext: sortedNextStackedPoints,\n status: sortedStatus\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\"; // Poly path support NaN point\n\nimport Path from 'zrender/lib/graphic/Path';\nimport PathProxy from 'zrender/lib/core/PathProxy';\nimport { cubicRootAt, cubicAt } from 'zrender/lib/core/curve';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */\n\n\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1];\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n cpx1 = x - lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + lenPrevSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n cpx1 = x;\n cpy1 = y - lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + lenPrevSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n}\n\nvar ECPolylineShape =\n/** @class */\nfunction () {\n function ECPolylineShape() {\n this.smooth = 0;\n this.smoothConstraint = true;\n }\n\n return ECPolylineShape;\n}();\n\nvar ECPolyline =\n/** @class */\nfunction (_super) {\n __extends(ECPolyline, _super);\n\n function ECPolyline(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polyline';\n return _this;\n }\n\n ECPolyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECPolyline.prototype.getDefaultShape = function () {\n return new ECPolylineShape();\n };\n\n ECPolyline.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length / 2; // const result = getBoundingBox(points, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n };\n\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\n if (!this.path) {\n this.createPathProxy();\n this.buildPath(this.path, this.shape);\n }\n\n var path = this.path;\n var data = path.data;\n var CMD = PathProxy.CMD;\n var x0;\n var y0;\n var isDimX = dim === 'x';\n var roots = [];\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n var x = void 0;\n var y = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var x3 = void 0;\n var y3 = void 0;\n var t = void 0;\n\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n break;\n\n case CMD.L:\n x = data[i++];\n y = data[i++];\n t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0);\n\n if (t <= 1 && t >= 0) {\n var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0;\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n\n x0 = x;\n y0 = y;\n break;\n\n case CMD.C:\n x = data[i++];\n y = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n x3 = data[i++];\n y3 = data[i++];\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots);\n\n if (nRoot > 0) {\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\n var t_1 = roots[i_1];\n\n if (t_1 <= 1 && t_1 >= 0) {\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1);\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n }\n }\n\n x0 = x3;\n y0 = y3;\n break;\n }\n }\n };\n\n return ECPolyline;\n}(Path);\n\nexport { ECPolyline };\n\nvar ECPolygonShape =\n/** @class */\nfunction (_super) {\n __extends(ECPolygonShape, _super);\n\n function ECPolygonShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return ECPolygonShape;\n}(ECPolylineShape);\n\nvar ECPolygon =\n/** @class */\nfunction (_super) {\n __extends(ECPolygon, _super);\n\n function ECPolygon(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polygon';\n return _this;\n }\n\n ECPolygon.prototype.getDefaultShape = function () {\n return new ECPolygonShape();\n };\n\n ECPolygon.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length / 2;\n var smoothMonotone = shape.smoothMonotone;\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n };\n\n return ECPolygon;\n}(Path);\n\nexport { ECPolygon };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic';\nimport { round } from '../../util/number';\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner\n\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369\n\n x = Math.floor(x);\n width = Math.round(width);\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n\n clipPath.shape.height = 0;\n }\n\n var duringCb = typeof during === 'function' ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n\n return null;\n}\n\nexport { createGridClipPath, createPolarClipPath, createClipPath };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n return coordSys.type === type;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\"; // FIXME step not support polar\n\nimport * as zrUtil from 'zrender/lib/core/util';\nimport SymbolDraw from '../helper/SymbolDraw';\nimport SymbolClz from '../helper/Symbol';\nimport lineAnimationDiff from './lineAnimationDiff';\nimport * as graphic from '../../util/graphic';\nimport * as modelUtil from '../../util/model';\nimport { ECPolyline, ECPolygon } from './poly';\nimport ChartView from '../../view/Chart';\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper';\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\nimport { setStatesStylesFromModel, setStatesFlag, enableHoverEmphasis } from '../../util/states';\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper';\nimport { getECData } from '../../util/innerStore';\nimport { createFloat32Array } from '../../util/vendor';\nimport { convertToColorString } from '../../util/format';\n\nfunction isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n if (points1[i] !== points2[i]) {\n return;\n }\n }\n\n return true;\n}\n\nfunction bboxFromPoints(points) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (!isNaN(x)) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n }\n\n if (!isNaN(y)) {\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n }\n\n return [[minX, minY], [maxX, maxY]];\n}\n\nfunction getBoundingDiff(points1, points2) {\n var _a = bboxFromPoints(points1),\n min1 = _a[0],\n max1 = _a[1];\n\n var _b = bboxFromPoints(points2),\n min2 = _b[0],\n max2 = _b[1]; // Get a max value from each corner of two boundings.\n\n\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\n}\n\nfunction getSmooth(smooth) {\n return typeof smooth === 'number' ? smooth : smooth ? 0.5 : 0;\n}\n\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n if (!dataCoordInfo.valueDim) {\n return [];\n }\n\n var len = data.count();\n var points = createFloat32Array(len * 2);\n\n for (var idx = 0; idx < len; idx++) {\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\n points[idx * 2] = pt[0];\n points[idx * 2 + 1] = pt[1];\n }\n\n return points;\n}\n\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt) {\n var baseAxis = coordSys.getBaseAxis();\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n var stepPoints = [];\n var i = 0;\n var stepPt = [];\n var pt = [];\n var nextPt = [];\n\n for (; i < points.length - 2; i += 2) {\n nextPt[0] = points[i + 2];\n nextPt[1] = points[i + 3];\n pt[0] = points[i];\n pt[1] = points[i + 1];\n stepPoints.push(pt[0], pt[1]);\n\n switch (stepTurnAt) {\n case 'end':\n stepPt[baseIndex] = nextPt[baseIndex];\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n break;\n\n case 'middle':\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n var stepPt2 = [];\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n stepPoints.push(stepPt2[0], stepPt2[1]);\n break;\n\n default:\n // default is start\n stepPt[baseIndex] = pt[baseIndex];\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n }\n } // Last points\n\n\n stepPoints.push(points[i++], points[i++]);\n return stepPoints;\n}\n\nfunction getVisualGradient(data, coordSys) {\n var visualMetaList = data.getVisual('visualMeta');\n\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\n // When data.count() is 0, gradient range can not be calculated.\n return;\n }\n\n if (coordSys.type !== 'cartesian2d') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style is only supported on cartesian2d.');\n }\n\n return;\n }\n\n var coordDim;\n var visualMeta;\n\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\n var dimIndex = visualMetaList[i].dimension;\n var dimName = data.dimensions[dimIndex];\n var dimInfo = data.getDimensionInfo(dimName);\n coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y\n\n if (coordDim === 'x' || coordDim === 'y') {\n visualMeta = visualMetaList[i];\n break;\n }\n }\n\n if (!visualMeta) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style only support x or y dimension.');\n }\n\n return;\n } // If the area to be rendered is bigger than area defined by LinearGradient,\n // the canvas spec prescribes that the color of the first stop and the last\n // stop should be used. But if two stops are added at offset 0, in effect\n // browsers use the color of the second stop to render area outside\n // LinearGradient. So we can only infinitesimally extend area defined in\n // LinearGradient to render `outerColors`.\n\n\n var axis = coordSys.getAxis(coordDim); // dataToCoor mapping may not be linear, but must be monotonic.\n\n var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n return {\n offset: 0,\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n color: stop.color\n };\n });\n var stopLen = colorStops.length;\n var outerColors = visualMeta.outerColors.slice();\n\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n colorStops.reverse();\n outerColors.reverse();\n }\n\n var tinyExtent = 10; // Arbitrary value: 10px\n\n var minCoord = colorStops[0].coord - tinyExtent;\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\n var coordSpan = maxCoord - minCoord;\n\n if (coordSpan < 1e-3) {\n return 'transparent';\n }\n\n zrUtil.each(colorStops, function (stop) {\n stop.offset = (stop.coord - minCoord) / coordSpan;\n });\n colorStops.push({\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\n color: outerColors[1] || 'transparent'\n });\n colorStops.unshift({\n offset: stopLen ? colorStops[0].offset : 0.5,\n color: outerColors[0] || 'transparent'\n }); // zrUtil.each(colorStops, function (colorStop) {\n // // Make sure each offset has rounded px to avoid not sharp edge\n // colorStop.offset = (Math.round(colorStop.offset * (end - start) + start) - start) / (end - start);\n // });\n\n var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStops, true);\n gradient[coordDim] = minCoord;\n gradient[coordDim + '2'] = maxCoord;\n return gradient;\n}\n\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n var showAllSymbol = seriesModel.get('showAllSymbol');\n var isAuto = showAllSymbol === 'auto';\n\n if (showAllSymbol && !isAuto) {\n return;\n }\n\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (!categoryAxis) {\n return;\n } // Note that category label interval strategy might bring some weird effect\n // in some scenario: users may wonder why some of the symbols are not\n // displayed. So we show all symbols as possible as we can.\n\n\n if (isAuto // Simplify the logic, do not determine label overlap here.\n && canShowAllSymbolForCategory(categoryAxis, data)) {\n return;\n } // Otherwise follow the label interval strategy on category axis.\n\n\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\n var labelMap = {};\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);\n labelMap[ordinalNumber] = 1;\n });\n return function (dataIndex) {\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n };\n}\n\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n // In mose cases, line is monotonous on category axis, and the label size\n // is close with each other. So we check the symbol size and some of the\n // label size alone with the category axis to estimate whether all symbol\n // can be shown without overlap.\n var axisExtent = categoryAxis.getExtent();\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n // Sampling some points, max 5.\n\n var dataLen = data.count();\n var step = Math.max(1, Math.round(dataLen / 5));\n\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n if (SymbolClz.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists.\n )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number\n * 1.5 > availSize) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n\nfunction getLastIndexNotNull(points) {\n var len = points.length / 2;\n\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n return len - 1;\n}\n\nfunction getPointAtIndex(points, idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n}\n\nfunction getIndexRange(points, xOrY, dim) {\n var len = points.length / 2;\n var dimIdx = dim === 'x' ? 0 : 1;\n var a;\n var b;\n var prevIndex = 0;\n var nextIndex = -1;\n\n for (var i = 0; i < len; i++) {\n b = points[i * 2 + dimIdx];\n\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\n continue;\n }\n\n if (i === 0) {\n a = b;\n continue;\n }\n\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\n nextIndex = i;\n break;\n }\n\n prevIndex = i;\n a = b;\n }\n\n return {\n range: [prevIndex, nextIndex],\n t: (xOrY - a) / (b - a)\n };\n}\n\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var endLabelModel_1 = seriesModel.getModel('endLabel');\n var showEndLabel = endLabelModel_1.get('show');\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\n var data_1 = seriesModel.getData();\n var labelAnimationRecord_1 = {\n lastFrameIndex: 0\n };\n var during = showEndLabel ? function (percent, clipRect) {\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\n } : null;\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\n var endLabel = lineView._endLabel;\n\n if (endLabel && hasAnimation) {\n if (labelAnimationRecord_1.originalX != null) {\n endLabel.attr({\n x: labelAnimationRecord_1.originalX,\n y: labelAnimationRecord_1.originalY\n });\n }\n }\n }, during); // Expand clip shape to avoid clipping when line value exceeds axis\n\n if (!seriesModel.get('clip', true)) {\n var rectShape = clipPath.shape;\n var expandSize = Math.max(rectShape.width, rectShape.height);\n\n if (isHorizontal) {\n rectShape.y -= expandSize;\n rectShape.height += expandSize * 2;\n } else {\n rectShape.x -= expandSize;\n rectShape.width += expandSize * 2;\n }\n } // Set to the final frame. To make sure label layout is right.\n\n\n if (during) {\n during(1, clipPath);\n }\n\n return clipPath;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (seriesModel.get(['endLabel', 'show'])) {\n console.warn('endLabel is not supported for lines in polar systems.');\n }\n }\n\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n }\n}\n\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center';\n var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom';\n return {\n normal: {\n align: endLabelModel.get('align') || align,\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\n }\n };\n}\n\nvar LineView =\n/** @class */\nfunction (_super) {\n __extends(LineView, _super);\n\n function LineView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n LineView.prototype.init = function () {\n var lineGroup = new graphic.Group();\n var symbolDraw = new SymbolDraw();\n this.group.add(symbolDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineGroup = lineGroup;\n };\n\n LineView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var areaStyleModel = seriesModel.getModel('areaStyle');\n var points = data.getLayout('points') || [];\n var isCoordSysPolar = coordSys.type === 'polar';\n var prevCoordSys = this._coordSys;\n var symbolDraw = this._symbolDraw;\n var polyline = this._polyline;\n var polygon = this._polygon;\n var lineGroup = this._lineGroup;\n var hasAnimation = seriesModel.get('animation');\n var isAreaChart = !areaStyleModel.isEmpty();\n var valueOrigin = areaStyleModel.get('origin');\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\n var showSymbol = seriesModel.get('showSymbol');\n var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols\n\n var oldData = this._data;\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n }); // Remove previous created symbols if showSymbol changed to false\n\n if (!showSymbol) {\n symbolDraw.remove();\n }\n\n group.add(lineGroup); // FIXME step not support polar\n\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\n var clipShapeForSymbol;\n\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\n clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n // See #7913 and `test/dataZoom-clip.html`.\n\n if (clipShapeForSymbol.width != null) {\n clipShapeForSymbol.x -= 0.1;\n clipShapeForSymbol.y -= 0.1;\n clipShapeForSymbol.width += 0.2;\n clipShapeForSymbol.height += 0.2;\n } else if (clipShapeForSymbol.r0) {\n clipShapeForSymbol.r0 -= 0.5;\n clipShapeForSymbol.r += 0.5;\n }\n }\n\n this._clipShapeForSymbol = clipShapeForSymbol;\n var visualColor = getVisualGradient(data, coordSys) || data.getVisual('style')[data.getVisual('drawType')]; // Initialization animation or coordinate system changed\n\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n });\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\n\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\n }\n }\n\n polyline = this._newPolyline(points);\n\n if (isAreaChart) {\n polygon = this._newPolygon(points, stackedOnPoints);\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n }\n\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } else {\n if (isAreaChart && !polygon) {\n // If areaStyle is added\n polygon = this._newPolygon(points, stackedOnPoints);\n } else if (polygon && !isAreaChart) {\n // If areaStyle is removed\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n } // Update clipPath\n\n\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel)); // Always update, or it is wrong in the case turning on legend\n // because points are not changed\n\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n }); // In the case data zoom triggerred refreshing frequently\n // Data may not change if line has a category axis. So it should animate nothing\n\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n if (hasAnimation) {\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\n } else {\n // Not do it in update with animation\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\n }\n }\n\n polyline.setShape({\n points: points\n });\n polygon && polygon.setShape({\n points: points,\n stackedOnPoints: stackedOnPoints\n });\n }\n }\n }\n\n var focus = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n polyline.useStyle(zrUtil.defaults( // Use color in lineStyle first\n lineStyleModel.getLineStyle(), {\n fill: 'none',\n stroke: visualColor,\n lineJoin: 'bevel'\n }));\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\n\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\n var emphasisLineStyle = polyline.getState('emphasis').style;\n emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\n } // Needs seriesIndex for focus\n\n\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\n enableHoverEmphasis(polyline, focus, blurScope);\n var smooth = getSmooth(seriesModel.get('smooth'));\n var smoothMonotone = seriesModel.get('smoothMonotone');\n var connectNulls = seriesModel.get('connectNulls');\n polyline.setShape({\n smooth: smooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n\n if (polygon) {\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n var stackedOnSmooth = 0;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: visualColor,\n opacity: 0.7,\n lineJoin: 'bevel',\n decal: data.getVisual('style').decal\n }));\n\n if (stackedOnSeries) {\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n }\n\n polygon.setShape({\n smooth: smooth,\n stackedOnSmooth: stackedOnSmooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); // Needs seriesIndex for focus\n\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\n enableHoverEmphasis(polygon, focus, blurScope);\n }\n\n var changePolyState = function (toState) {\n _this._changePolyState(toState);\n };\n\n data.eachItemGraphicEl(function (el) {\n // Switch polyline / polygon state if element changed its state.\n el && (el.onHoverStateChange = changePolyState);\n });\n this._polyline.onHoverStateChange = changePolyState;\n this._data = data; // Save the coordinate system for transition animation when data changed\n\n this._coordSys = coordSys;\n this._stackedOnPoints = stackedOnPoints;\n this._points = points;\n this._step = step;\n this._valueOrigin = valueOrigin;\n };\n\n LineView.prototype.dispose = function () {};\n\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('emphasis');\n\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n var points = data.getLayout('points');\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (!symbol) {\n // Create a temporary symbol if it is not exists\n var x = points[dataIndex * 2];\n var y = points[dataIndex * 2 + 1];\n\n if (isNaN(x) || isNaN(y)) {\n // Null data\n return;\n } // fix #11360: should't draw symbol outside clipShapeForSymbol\n\n\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\n return;\n }\n\n symbol = new SymbolClz(data, dataIndex);\n symbol.x = x;\n symbol.y = y;\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z')); // ensure label text of the temporal symbol is on the top of line and area polygon\n\n var symbolLabel = symbol.getSymbolPath().getTextContent();\n symbolLabel && (symbolLabel.z2 = this._polyline.z2 + 1);\n symbol.__temp = true;\n data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation\n\n symbol.stopSymbolAnimation(true);\n this.group.add(symbol);\n }\n\n symbol.highlight();\n } else {\n // Highlight whole series\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('normal');\n\n if (dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (symbol) {\n if (symbol.__temp) {\n data.setItemGraphicEl(dataIndex, null);\n this.group.remove(symbol);\n } else {\n symbol.downplay();\n }\n }\n } else {\n // FIXME\n // can not downplay completely.\n // Downplay whole series\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype._changePolyState = function (toState) {\n var polygon = this._polygon;\n setStatesFlag(this._polyline, toState);\n polygon && setStatesFlag(polygon, toState);\n };\n\n LineView.prototype._newPolyline = function (points) {\n var polyline = this._polyline; // Remove previous created polyline\n\n if (polyline) {\n this._lineGroup.remove(polyline);\n }\n\n polyline = new ECPolyline({\n shape: {\n points: points\n },\n segmentIgnoreThreshold: 2,\n z2: 10\n });\n\n this._lineGroup.add(polyline);\n\n this._polyline = polyline;\n return polyline;\n };\n\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\n var polygon = this._polygon; // Remove previous created polygon\n\n if (polygon) {\n this._lineGroup.remove(polygon);\n }\n\n polygon = new ECPolygon({\n shape: {\n points: points,\n stackedOnPoints: stackedOnPoints\n },\n segmentIgnoreThreshold: 2\n });\n\n this._lineGroup.add(polygon);\n\n this._polygon = polygon;\n return polygon;\n };\n\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\n var isHorizontalOrRadial;\n var isCoordSysPolar;\n var baseAxis = coordSys.getBaseAxis();\n var isAxisInverse = baseAxis.inverse;\n\n if (coordSys.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n isCoordSysPolar = false;\n } else if (coordSys.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n isCoordSysPolar = true;\n }\n\n var seriesModel = data.hostModel;\n var seriesDuration = seriesModel.get('animationDuration');\n\n if (typeof seriesDuration === 'function') {\n seriesDuration = seriesDuration(null);\n }\n\n var seriesDalay = seriesModel.get('animationDelay') || 0;\n var seriesDalayValue = typeof seriesDalay === 'function' ? seriesDalay(null) : seriesDalay;\n data.eachItemGraphicEl(function (symbol, idx) {\n var el = symbol;\n\n if (el) {\n var point = [symbol.x, symbol.y];\n var start = void 0;\n var end = void 0;\n var current = void 0;\n\n if (isCoordSysPolar) {\n var polarClip = clipShape;\n var coord = coordSys.pointToCoord(point);\n\n if (isHorizontalOrRadial) {\n start = polarClip.startAngle;\n end = polarClip.endAngle;\n current = -coord[1] / 180 * Math.PI;\n } else {\n start = polarClip.r0;\n end = polarClip.r;\n current = coord[0];\n }\n } else {\n var gridClip = clipShape;\n\n if (isHorizontalOrRadial) {\n start = gridClip.x;\n end = gridClip.x + gridClip.width;\n current = symbol.x;\n } else {\n start = gridClip.y + gridClip.height;\n end = gridClip.y;\n current = symbol.y;\n }\n }\n\n var ratio = end === start ? 0 : (current - start) / (end - start);\n\n if (isAxisInverse) {\n ratio = 1 - ratio;\n }\n\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx) : seriesDuration * ratio + seriesDalayValue;\n var symbolPath = el.getSymbolPath();\n var text = symbolPath.getTextContent();\n el.attr({\n scaleX: 0,\n scaleY: 0\n });\n el.animateTo({\n scaleX: 1,\n scaleY: 1\n }, {\n duration: 200,\n delay: delay\n });\n\n if (text) {\n text.animateFrom({\n style: {\n opacity: 0\n }\n }, {\n duration: 300,\n delay: delay\n });\n }\n\n symbolPath.disableLabelAnimation = true;\n }\n });\n };\n\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) {\n var endLabelModel = seriesModel.getModel('endLabel');\n\n if (endLabelModel.get('show')) {\n var data_2 = seriesModel.getData();\n var polyline = this._polyline;\n var endLabel = this._endLabel;\n\n if (!endLabel) {\n endLabel = this._endLabel = new graphic.Text({\n z2: 200 // should be higher than item symbol\n\n });\n endLabel.ignoreClip = true;\n polyline.setTextContent(this._endLabel);\n polyline.disableLabelAnimation = true;\n } // Find last non-NaN data to display data\n\n\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\n\n if (dataIndex >= 0) {\n setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), {\n inheritColor: inheritColor,\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: function (dataIndex, opt, interpolatedValue) {\n return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex);\n },\n enableTextSetter: true\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\n polyline.textConfig.position = null;\n }\n } else if (this._endLabel) {\n this._polyline.removeTextContent();\n\n this._endLabel = null;\n }\n };\n\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\n var endLabel = this._endLabel;\n var polyline = this._polyline;\n\n if (endLabel) {\n // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\n // The label is not prepared at this time.\n if (percent < 1 && animationRecord.originalX == null) {\n animationRecord.originalX = endLabel.x;\n animationRecord.originalY = endLabel.y;\n }\n\n var points = data.getLayout('points');\n var seriesModel = data.hostModel;\n var connectNulls = seriesModel.get('connectNulls');\n var precision = endLabelModel.get('precision');\n var distance = endLabelModel.get('distance') || 0;\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var clipShape = clipRect.shape;\n var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y;\n var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\n var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\n var dim = isHorizontal ? 'x' : 'y';\n var dataIndexRange = getIndexRange(points, xOrY, dim);\n var indices = dataIndexRange.range;\n var diff = indices[1] - indices[0];\n var value = void 0;\n\n if (diff >= 1) {\n // diff > 1 && connectNulls, which is on the null data.\n if (diff > 1 && !connectNulls) {\n var pt = getPointAtIndex(points, indices[0]);\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\n } else {\n var pt = polyline.getPointOn(xOrY, dim);\n pt && endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n var startValue = seriesModel.getRawValue(indices[0]);\n var endValue = seriesModel.getRawValue(indices[1]);\n valueAnimation && (value = modelUtil.interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\n }\n\n animationRecord.lastFrameIndex = indices[0];\n } else {\n // If diff <= 0, which is the range is not found(Include NaN)\n // Choose the first point or last point.\n var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;\n var pt = getPointAtIndex(points, idx);\n valueAnimation && (value = seriesModel.getRawValue(idx));\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n }\n\n if (valueAnimation) {\n labelInner(endLabel).setLabelText(value);\n }\n }\n };\n /**\n * @private\n */\n // FIXME Two value axis\n\n\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\n var polyline = this._polyline;\n var polygon = this._polygon;\n var seriesModel = data.hostModel;\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n var current = diff.current;\n var stackedOnCurrent = diff.stackedOnCurrent;\n var next = diff.next;\n var stackedOnNext = diff.stackedOnNext;\n\n if (step) {\n // TODO If stacked series is not step\n current = turnPointsIntoStep(diff.current, coordSys, step);\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\n next = turnPointsIntoStep(diff.next, coordSys, step);\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\n } // Don't apply animation if diff is large.\n // For better result and avoid memory explosion problems like\n // https://github.com/apache/incubator-echarts/issues/12229\n\n\n if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) {\n polyline.setShape({\n points: next\n });\n\n if (polygon) {\n polygon.setShape({\n points: next,\n stackedOnPoints: stackedOnNext\n });\n }\n\n return;\n }\n\n polyline.shape.__points = diff.current;\n polyline.shape.points = current;\n var target = {\n shape: {\n points: next\n }\n }; // Also animate the original points.\n // If points reference is changed when turning into step line.\n\n if (diff.current !== current) {\n target.shape.__points = diff.next;\n } // Stop previous animation.\n\n\n polyline.stopAnimation();\n graphic.updateProps(polyline, target, seriesModel);\n\n if (polygon) {\n polygon.setShape({\n // Reuse the points with polyline.\n points: current,\n stackedOnPoints: stackedOnCurrent\n });\n polygon.stopAnimation();\n graphic.updateProps(polygon, {\n shape: {\n stackedOnPoints: stackedOnNext\n }\n }, seriesModel); // If use attr directly in updateProps.\n\n if (polyline.shape.points !== polygon.shape.points) {\n polygon.shape.points = polyline.shape.points;\n }\n }\n\n var updatedDataInfo = [];\n var diffStatus = diff.status;\n\n for (var i = 0; i < diffStatus.length; i++) {\n var cmd = diffStatus[i].cmd;\n\n if (cmd === '=') {\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\n\n if (el) {\n updatedDataInfo.push({\n el: el,\n ptIdx: i // Index of points\n\n });\n }\n }\n }\n\n if (polyline.animators && polyline.animators.length) {\n polyline.animators[0].during(function () {\n polygon && polygon.dirtyShape();\n var points = polyline.shape.__points;\n\n for (var i = 0; i < updatedDataInfo.length; i++) {\n var el = updatedDataInfo[i].el;\n var offset = updatedDataInfo[i].ptIdx * 2;\n el.x = points[offset];\n el.y = points[offset + 1];\n el.markRedraw();\n }\n });\n }\n };\n\n LineView.prototype.remove = function (ecModel) {\n var group = this.group;\n var oldData = this._data;\n\n this._lineGroup.removeAll();\n\n this._symbolDraw.remove(true); // Remove temporary created elements when highlighting\n\n\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;\n };\n\n LineView.type = 'line';\n return LineView;\n}(ChartView);\n\nexport default LineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nimport { map } from 'zrender/lib/core/util';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper';\nimport { createFloat32Array } from '../util/vendor';\nexport default function pointsLayout(seriesType, forceStoreInTypedArray) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n dims[1] = stackResultDim;\n }\n\n var dimInfo0 = data.getDimensionInfo(dims[0]);\n var dimInfo1 = data.getDimensionInfo(dims[1]);\n var dimIdx0 = dimInfo0 && dimInfo0.index;\n var dimIdx1 = dimInfo1 && dimInfo1.index;\n return dimLen && {\n progress: function (params, data) {\n var segCount = params.end - params.start;\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\n var tmpIn = [];\n var tmpOut = [];\n\n for (var i = params.start, offset = 0; i < params.end; i++) {\n var point = void 0;\n\n if (dimLen === 1) {\n var x = data.getByDimIdx(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy.\n\n point = coordSys.dataToPoint(x, null, tmpOut);\n } else {\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\n tmpIn[1] = data.getByDimIdx(dimIdx1, i); // Let coordinate system to handle the NaN data.\n\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (useTypedArray) {\n points[offset++] = point[0];\n points[offset++] = point[1];\n } else {\n data.setItemLayout(i, point.slice());\n }\n }\n\n useTypedArray && data.setLayout('points', points);\n }\n };\n }\n };\n}\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar samplers = {\n average: function (frame) {\n var sum = 0;\n var count = 0;\n\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n } // Return NaN if count is 0\n\n\n return count === 0 ? NaN : sum / count;\n },\n sum: function (frame) {\n var sum = 0;\n\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n\n return sum;\n },\n max: function (frame) {\n var max = -Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(max) ? max : NaN;\n },\n min: function (frame) {\n var min = Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(min) ? min : NaN;\n },\n // TODO\n // Median\n nearest: function (frame) {\n return frame[0];\n }\n};\n\nvar indexSampler = function (frame) {\n return Math.round(frame.length / 2);\n};\n\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data.\n\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized\n\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n\n if (rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n\n var sampler = void 0;\n\n if (typeof sampling === 'string') {\n sampler = samplers[sampling];\n } else if (typeof sampling === 'function') {\n sampler = sampling;\n }\n\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LineSeries from './LineSeries';\nimport LineView from './LineView'; // In case developer forget to include grid component\n\nimport layoutPoints from '../../layout/points';\nimport dataSample from '../../processor/dataSample';\nexport function install(registers) {\n registers.registerChartView(LineView);\n registers.registerSeriesModel(LineSeries);\n registers.registerLayout(layoutPoints('line', true));\n registers.registerVisual({\n seriesType: 'line',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // Visual coding for legend\n\n var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n\n if (lineStyle && !lineStyle.stroke) {\n // Fill in visual should be palette color if\n // has color callback\n lineStyle.stroke = data.getVisual('style').fill;\n }\n\n data.setVisual('legendLineStyle', lineStyle);\n }\n }); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parsePercent } from '../util/number';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\nvar STACK_PREFIX = '__ec_stack_';\nvar LARGE_BAR_MIN_WIDTH = 0.5;\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(axis) {\n return axis.dim + axis.index;\n}\n/**\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\n */\n\n\nexport function getLayoutOnAxis(opt) {\n var params = [];\n var baseAxis = opt.axis;\n var axisKey = 'axis0';\n\n if (baseAxis.type !== 'category') {\n return;\n }\n\n var bandWidth = baseAxis.getBandWidth();\n\n for (var i = 0; i < opt.count || 0; i++) {\n params.push(zrUtil.defaults({\n bandWidth: bandWidth,\n axisKey: axisKey,\n stackId: STACK_PREFIX + i\n }, opt));\n }\n\n var widthAndOffsets = doCalBarWidthAndOffset(params);\n var result = [];\n\n for (var i = 0; i < opt.count; i++) {\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n item.offsetCenter = item.offset + item.width / 2;\n result.push(item);\n }\n\n return result;\n}\nexport function prepareLayoutBarSeries(seriesType, ecModel) {\n var seriesModels = [];\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for cartesian2d only\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\n seriesModels.push(seriesModel);\n }\n });\n return seriesModels;\n}\n/**\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\n * values.\n * This works for time axes, value axes, and log axes.\n * For a single time axis, return value is in the form like\n * {'x_0': [1000000]}.\n * The value of 1000000 is in milliseconds.\n */\n\nfunction getValueAxesMinGaps(barSeries) {\n /**\n * Map from axis.index to values.\n * For a single time axis, axisValues is in the form like\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\n * series.\n */\n var axisValues = {};\n zrUtil.each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n return;\n }\n\n var data = seriesModel.getData();\n var key = baseAxis.dim + '_' + baseAxis.index;\n var dim = data.mapDimension(baseAxis.dim);\n\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\n var value = data.get(dim, i);\n\n if (!axisValues[key]) {\n // No previous data for the axis\n axisValues[key] = [value];\n } else {\n // No value in previous series\n axisValues[key].push(value);\n } // Ignore duplicated time values in the same axis\n\n }\n });\n var axisMinGaps = {};\n\n for (var key in axisValues) {\n if (axisValues.hasOwnProperty(key)) {\n var valuesInAxis = axisValues[key];\n\n if (valuesInAxis) {\n // Sort axis values into ascending order to calculate gaps\n valuesInAxis.sort(function (a, b) {\n return a - b;\n });\n var min = null;\n\n for (var j = 1; j < valuesInAxis.length; ++j) {\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n\n if (delta > 0) {\n // Ignore 0 delta because they are of the same axis value\n min = min === null ? delta : Math.min(min, delta);\n }\n } // Set to null if only have one data\n\n\n axisMinGaps[key] = min;\n }\n }\n }\n\n return axisMinGaps;\n}\n\nexport function makeColumnLayout(barSeries) {\n var axisMinGaps = getValueAxesMinGaps(barSeries);\n var seriesInfoList = [];\n zrUtil.each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n var minGap = axisMinGaps[key];\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n var scale = baseAxis.scale.getExtent();\n var scaleSpan = Math.abs(scale[1] - scale[0]);\n bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n } else {\n var data = seriesModel.getData();\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n }\n\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barMinWidth = parsePercent( // barMinWidth by default is 1 in cartesian. Because in value axis,\n // the auto-calculated bar width might be less than 1.\n seriesModel.get('barMinWidth') || 1, bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n seriesInfoList.push({\n bandWidth: bandWidth,\n barWidth: barWidth,\n barMaxWidth: barMaxWidth,\n barMinWidth: barMinWidth,\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n axisKey: getAxisKey(baseAxis),\n stackId: getSeriesStackId(seriesModel)\n });\n });\n return doCalBarWidthAndOffset(seriesInfoList);\n}\n\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n // Columns info on each category axis. Key is cartesian name\n var columnsMap = {};\n zrUtil.each(seriesInfoList, function (seriesInfo, idx) {\n var axisKey = seriesInfo.axisKey;\n var bandWidth = seriesInfo.bandWidth;\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: null,\n gap: '20%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = seriesInfo.stackId;\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n }; // Caution: In a single coordinate system, these barGrid attributes\n // will be shared by series. Consider that they have default values,\n // only the attributes set on the last series will work.\n // Do not change this fact unless there will be a break change.\n\n var barWidth = seriesInfo.barWidth;\n\n if (barWidth && !stacks[stackId].width) {\n // See #6312, do not restrict width.\n stacks[stackId].width = barWidth;\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n var barMaxWidth = seriesInfo.barMaxWidth;\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n var barMinWidth = seriesInfo.barMinWidth;\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n var barGap = seriesInfo.barGap;\n barGap != null && (columnsOnAxis.gap = barGap);\n var barCategoryGap = seriesInfo.barCategoryGap;\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGapPercent = columnsOnAxis.categoryGap;\n\n if (categoryGapPercent == null) {\n var columnCount = zrUtil.keys(stacks).length; // More columns in one group\n // the spaces between group is smaller. Or the column will be too thin.\n\n categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%';\n }\n\n var categoryGap = parsePercent(categoryGapPercent, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column) {\n var maxWidth = column.maxWidth;\n var minWidth = column.minWidth;\n\n if (!column.width) {\n var finalWidth = autoWidth;\n\n if (maxWidth && maxWidth < finalWidth) {\n finalWidth = Math.min(maxWidth, remainedWidth);\n } // `minWidth` has higher priority. `minWidth` decide that wheter the\n // bar is able to be visible. So `minWidth` should not be restricted\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n // the extreme cases for `value` axis, bars are allowed to overlap\n // with each other if `minWidth` specified.\n\n\n if (minWidth && minWidth > finalWidth) {\n finalWidth = minWidth;\n }\n\n if (finalWidth !== autoWidth) {\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n } else {\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n // CSS does. Becuase barWidth can be a percent value, where\n // `barMaxWidth` can be used to restrict the final width.\n var finalWidth = column.width;\n\n if (maxWidth) {\n finalWidth = Math.min(finalWidth, maxWidth);\n } // `minWidth` has higher priority, as described above\n\n\n if (minWidth) {\n finalWidth = Math.max(finalWidth, minWidth);\n }\n\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n bandWidth: bandWidth,\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n if (barWidthAndOffset && axis) {\n var result = barWidthAndOffset[getAxisKey(axis)];\n\n if (result != null && seriesModel != null) {\n return result[getSeriesStackId(seriesModel)];\n }\n\n return result;\n }\n}\n\nexport { retrieveColumnLayout };\nexport function layout(seriesType, ecModel) {\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n var barWidthAndOffset = makeColumnLayout(seriesModels);\n var lastStackCoords = {};\n zrUtil.each(seriesModels, function (seriesModel) {\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n data.setLayout({\n bandWidth: columnLayoutInfo.bandWidth,\n offset: columnOffset,\n size: columnWidth\n });\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim\n /*, baseDim*/\n );\n var isValueAxisH = valueAxis.isHorizontal();\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked);\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n\n if (stacked) {\n // Only ordinal axis can be stacked.\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n n: valueAxisStart // Negative stack\n\n };\n } // Should also consider #4243\n\n\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (isValueAxisH) {\n var coord = cartesian.dataToPoint([value, baseValue]);\n x = baseCoord;\n y = coord[1] + columnOffset;\n width = coord[0] - valueAxisStart;\n height = columnWidth;\n\n if (Math.abs(width) < barMinHeight) {\n width = (width < 0 ? -1 : 1) * barMinHeight;\n } // Ignore stack from NaN value\n\n\n if (!isNaN(width)) {\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\n }\n } else {\n var coord = cartesian.dataToPoint([baseValue, value]);\n x = coord[0] + columnOffset;\n y = baseCoord;\n width = columnWidth;\n height = coord[1] - valueAxisStart;\n\n if (Math.abs(height) < barMinHeight) {\n // Include zero to has a positive bar\n height = (height <= 0 ? -1 : 1) * barMinHeight;\n } // Ignore stack from NaN value\n\n\n if (!isNaN(height)) {\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\n }\n }\n\n data.setItemLayout(idx, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n });\n} // TODO: Do not support stack in large mode yet.\n\nexport var largeLayout = {\n seriesType: 'bar',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var coordLayout = cartesian.master.getRect();\n var baseAxis = cartesian.getBaseAxis();\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var valueAxisHorizontal = valueAxis.isHorizontal();\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\n\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\n // jshint ignore:line\n barWidth = LARGE_BAR_MIN_WIDTH;\n }\n\n return {\n progress: function (params, data) {\n var count = params.count;\n var largePoints = new LargeArr(count * 2);\n var largeBackgroundPoints = new LargeArr(count * 2);\n var largeDataIndices = new LargeArr(count);\n var dataIndex;\n var coord = [];\n var valuePair = [];\n var pointsOffset = 0;\n var idxOffset = 0;\n\n while ((dataIndex = params.next()) != null) {\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\n coord = cartesian.dataToPoint(valuePair, null, coord); // Data index might not be in order, depends on `progressiveChunkMode`.\n\n largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\n largePoints[pointsOffset++] = coord[0];\n largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\n largePoints[pointsOffset++] = coord[1];\n largeDataIndices[idxOffset++] = dataIndex;\n }\n\n data.setLayout({\n largePoints: largePoints,\n largeDataIndices: largeDataIndices,\n largeBackgroundPoints: largeBackgroundPoints,\n barWidth: barWidth,\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\n valueAxisHorizontal: valueAxisHorizontal\n });\n }\n };\n }\n};\n\nfunction isOnCartesian(seriesModel) {\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\n\nfunction isInLargeMode(seriesModel) {\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n} // See cases in `test/bar-start.html` and `#7412`, `#8747`.\n\n\nfunction getValueAxisStart(baseAxis, valueAxis, stacked) {\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport createListFromArray from '../helper/createListFromArray';\n\nvar BaseBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BaseBarSeriesModel, _super);\n\n function BaseBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BaseBarSeriesModel.type;\n return _this;\n }\n\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: true\n });\n };\n\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\n var coordSys = this.coordinateSystem;\n\n if (coordSys) {\n // PENDING if clamp ?\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt[offsetIndex] += offset + size / 2;\n return pt;\n }\n\n return [NaN, NaN];\n };\n\n BaseBarSeriesModel.type = 'series.__base_bar__';\n BaseBarSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n barMinHeight: 0,\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod'\n };\n return BaseBarSeriesModel;\n}(SeriesModel);\n\nSeriesModel.registerClass(BaseBarSeriesModel);\nexport default BaseBarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries';\nimport createListFromArray from '../helper/createListFromArray';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar BarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BarSeriesModel, _super);\n\n function BarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BarSeriesModel.type;\n return _this;\n }\n\n BarSeriesModel.prototype.getInitialData = function () {\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: true,\n createInvertedIndices: !!this.get('realtimeSort', true) || null\n });\n };\n /**\n * @override\n */\n\n\n BarSeriesModel.prototype.getProgressive = function () {\n // Do not support progressive in normal mode.\n return this.get('large') ? this.get('progressive') : false;\n };\n /**\n * @override\n */\n\n\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\n // Do not support progressive in normal mode.\n var progressiveThreshold = this.get('progressiveThreshold');\n var largeThreshold = this.get('largeThreshold');\n\n if (largeThreshold > progressiveThreshold) {\n progressiveThreshold = largeThreshold;\n }\n\n return progressiveThreshold;\n };\n\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.rect(data.getItemLayout(dataIndex));\n };\n\n BarSeriesModel.type = 'series.bar';\n BarSeriesModel.dependencies = ['grid', 'polar'];\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n // If clipped\n // Only available on cartesian2d\n clip: true,\n roundCap: false,\n showBackground: false,\n backgroundStyle: {\n color: 'rgba(180, 180, 180, 0.2)',\n borderColor: null,\n borderWidth: 0,\n borderType: 'solid',\n borderRadius: 0,\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n realtimeSort: false\n });\n return BarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default BarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic';\n/**\n * Sausage: similar to sector, but have half circle on both sides\n */\n\nvar SausageShape =\n/** @class */\nfunction () {\n function SausageShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n\n return SausageShape;\n}();\n\nvar SausagePath =\n/** @class */\nfunction (_super) {\n __extends(SausagePath, _super);\n\n function SausagePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'sausage';\n return _this;\n }\n\n SausagePath.prototype.getDefaultShape = function () {\n return new SausageShape();\n };\n\n SausagePath.prototype.buildPath = function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var dr = (r - r0) * 0.5;\n var rCenter = r0 + dr;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitStartX = Math.cos(startAngle);\n var unitStartY = Math.sin(startAngle);\n var unitEndX = Math.cos(endAngle);\n var unitEndY = Math.sin(endAngle);\n var lessThanCircle = clockwise ? endAngle - startAngle < Math.PI * 2 : startAngle - endAngle < Math.PI * 2;\n\n if (lessThanCircle) {\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\n }\n\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n\n if (r0 !== 0) {\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\n }\n\n ctx.closePath();\n };\n\n return SausagePath;\n}(Path);\n\nexport default SausagePath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path';\nimport Group from 'zrender/lib/graphic/Group';\nimport { extend, defaults, each, map } from 'zrender/lib/core/util';\nimport { Rect, Sector, updateProps, initProps, removeElementWithFadeOut } from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport { enableHoverEmphasis, setStatesStylesFromModel } from '../../util/states';\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation } from '../../label/labelStyle';\nimport { throttle } from '../../util/throttle';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys';\nimport Sausage from '../../util/shape/sausage';\nimport ChartView from '../../view/Chart';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper';\nimport { warn } from '../../util/log';\nvar _eventPos = [0, 0];\nvar mathMax = Math.max;\nvar mathMin = Math.min;\n\nfunction getClipArea(coord, data) {\n var coordSysClipArea = coord.getArea && coord.getArea();\n\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var baseAxis = coord.getBaseAxis(); // When boundaryGap is false or using time axis. bar may exceed the grid.\n // We should not clip this part.\n // See test/bar2.html\n\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\n var expandWidth = data.getLayout('bandWidth');\n\n if (baseAxis.isHorizontal()) {\n coordSysClipArea.x -= expandWidth;\n coordSysClipArea.width += expandWidth * 2;\n } else {\n coordSysClipArea.y -= expandWidth;\n coordSysClipArea.height += expandWidth * 2;\n }\n }\n }\n\n return coordSysClipArea;\n}\n\nvar BarView =\n/** @class */\nfunction (_super) {\n __extends(BarView, _super);\n\n function BarView() {\n var _this = _super.call(this) || this;\n\n _this.type = BarView.type;\n _this._isFirstFrame = true;\n return _this;\n }\n\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\n this._model = seriesModel;\n\n this._removeOnRenderedListener(api);\n\n this._updateDrawMode(seriesModel);\n\n var coordinateSystemType = seriesModel.get('coordinateSystem');\n\n if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload);\n } else if (process.env.NODE_ENV !== 'production') {\n warn('Only cartesian2d and polar supported for bar.');\n }\n };\n\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\n this._clear();\n\n this._updateDrawMode(seriesModel); // incremental also need to clip, otherwise might be overlow.\n // But must not set clip in each frame, otherwise all of the children will be marked redraw.\n\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype.incrementalRender = function (params, seriesModel) {\n // Do not support progressive in normal mode.\n this._incrementalRenderLarge(params, seriesModel);\n };\n\n BarView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coord = seriesModel.coordinateSystem;\n var baseAxis = coord.getBaseAxis();\n var isHorizontalOrRadial;\n\n if (coord.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n } else if (coord.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n }\n\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\n\n if (realtimeSortCfg) {\n this._enableRealtimeSort(realtimeSortCfg, data, api);\n }\n\n var needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\n var coordSysClipArea = getClipArea(coord, data); // If there is clipPath created in large mode. Remove it.\n\n group.removeClipPath(); // We don't use clipPath in normal mode because we needs a perfect animation\n // And don't want the label are clipped.\n\n var roundCap = seriesModel.get('roundCap', true);\n var drawBackground = seriesModel.get('showBackground', true);\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\n var bgEls = [];\n var oldBgEls = this._backgroundEls;\n var isInitSort = payload && payload.isInitSort;\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\n\n function createBackground(dataIndex) {\n var bgLayout = getLayout[coord.type](data, dataIndex);\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n }\n\n bgEls[dataIndex] = bgEl;\n return bgEl;\n }\n\n ;\n data.diff(oldData).add(function (dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\n\n if (drawBackground) {\n createBackground(dataIndex);\n } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\n\n\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n // Clip will modify the layout params.\n // And return a boolean to determine if the shape are fully clipped.\n isClipped = clip[coord.type](coordSysClipArea, layout);\n }\n\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\n } else {\n initProps(el, {\n shape: layout\n }, seriesModel, dataIndex);\n }\n\n data.setItemGraphicEl(dataIndex, el);\n group.add(el);\n el.ignore = isClipped;\n }).update(function (newIndex, oldIndex) {\n var itemModel = data.getItemModel(newIndex);\n var layout = getLayout[coord.type](data, newIndex, itemModel);\n\n if (drawBackground) {\n var bgEl = void 0;\n\n if (oldBgEls.length === 0) {\n bgEl = createBackground(oldIndex);\n } else {\n bgEl = oldBgEls[oldIndex];\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n }\n\n bgEls[newIndex] = bgEl;\n }\n\n var bgLayout = getLayout[coord.type](data, newIndex);\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\n updateProps(bgEl, {\n shape: shape\n }, animationModel, newIndex);\n }\n\n var el = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(el);\n el = null;\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n isClipped = clip[coord.type](coordSysClipArea, layout);\n\n if (isClipped) {\n group.remove(el);\n }\n }\n\n if (!el) {\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\n } // Not change anything if only order changed.\n // Especially not change label.\n\n\n if (!isChangeOrder) {\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\n } else {\n updateProps(el, {\n shape: layout\n }, seriesModel, newIndex, null);\n }\n\n data.setItemGraphicEl(newIndex, el);\n el.ignore = isClipped;\n group.add(el);\n }).remove(function (dataIndex) {\n var el = oldData.getItemGraphicEl(dataIndex);\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\n }).execute();\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\n bgGroup.removeAll();\n\n for (var i = 0; i < bgEls.length; ++i) {\n bgGroup.add(bgEls[i]);\n }\n\n group.add(bgGroup);\n this._backgroundEls = bgEls;\n this._data = data;\n };\n\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n this._removeBackground();\n\n createLarge(seriesModel, this.group, true);\n };\n\n BarView.prototype._updateLargeClip = function (seriesModel) {\n // Use clipPath in large mode.\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n };\n\n BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) {\n var _this = this; // If no data in the first frame, wait for data to initSort\n\n\n if (!data.count()) {\n return;\n }\n\n var baseAxis = realtimeSortCfg.baseAxis;\n\n if (this._isFirstFrame) {\n this._dispatchInitSort(data, realtimeSortCfg, api);\n\n this._isFirstFrame = false;\n } else {\n var orderMapping_1 = function (idx) {\n var el = data.getItemGraphicEl(idx);\n\n if (el) {\n var shape = el.shape; // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\n\n return (baseAxis.isHorizontal() // The result should be consistent with the initial sort by data value.\n // Do not support the case that both positive and negative exist.\n ? Math.abs(shape.height) : Math.abs(shape.width)) || 0;\n } else {\n return 0;\n }\n };\n\n this._onRendered = function () {\n _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api);\n };\n\n api.getZr().on('rendered', this._onRendered);\n }\n };\n\n BarView.prototype._dataSort = function (data, baseAxis, orderMapping) {\n var info = [];\n data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) {\n var mappedValue = orderMapping(dataIdx);\n mappedValue = mappedValue == null ? NaN : mappedValue;\n info.push({\n dataIndex: dataIdx,\n mappedValue: mappedValue,\n ordinalNumber: ordinalNumber\n });\n });\n info.sort(function (a, b) {\n // If NaN, it will be treated as min val.\n return b.mappedValue - a.mappedValue;\n });\n return {\n ordinalNumbers: map(info, function (item) {\n return item.ordinalNumber;\n })\n };\n };\n\n BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) {\n var scale = baseAxis.scale;\n var ordinalDataDim = data.mapDimension(baseAxis.dim);\n var lastValue = Number.MAX_VALUE;\n\n for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\n var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\n var value = rawIdx < 0 // If some tick have no bar, the tick will be treated as min.\n ? Number.MIN_VALUE // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\n : orderMapping(data.indexOfRawIndex(rawIdx));\n\n if (value > lastValue) {\n return true;\n }\n\n lastValue = value;\n }\n\n return false;\n };\n /*\n * Consider the case when A and B changed order, whose representing\n * bars are both out of sight, we don't wish to trigger reorder action\n * as long as the order in the view doesn't change.\n */\n\n\n BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) {\n var scale = baseAxis.scale;\n var extent = scale.getExtent();\n var tickNum = Math.max(0, extent[0]);\n var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\n\n for (; tickNum <= tickMax; ++tickNum) {\n if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\n return true;\n }\n }\n };\n\n BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) {\n if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\n return;\n }\n\n var sortInfo = this._dataSort(data, baseAxis, orderMapping);\n\n if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\n this._removeOnRenderedListener(api);\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n axisId: baseAxis.index,\n sortInfo: sortInfo\n });\n }\n };\n\n BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) {\n var baseAxis = realtimeSortCfg.baseAxis;\n\n var sortResult = this._dataSort(data, baseAxis, function (dataIdx) {\n return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);\n });\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n isInitSort: true,\n axisId: baseAxis.index,\n sortInfo: sortResult,\n animation: {\n // Update the axis label from the natural initial layout to\n // sorted layout should has no animation.\n duration: 0\n }\n });\n };\n\n BarView.prototype.remove = function (ecModel, api) {\n this._clear(this._model);\n\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype.dispose = function (ecModel, api) {\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype._removeOnRenderedListener = function (api) {\n if (this._onRendered) {\n api.getZr().off('rendered', this._onRendered);\n this._onRendered = null;\n }\n };\n\n BarView.prototype._clear = function (model) {\n var group = this.group;\n var data = this._data;\n\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\n this._removeBackground();\n\n this._backgroundEls = [];\n data.eachItemGraphicEl(function (el) {\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\n });\n } else {\n group.removeAll();\n }\n\n this._data = null;\n this._isFirstFrame = true;\n };\n\n BarView.prototype._removeBackground = function () {\n this.group.remove(this._backgroundGroup);\n this._backgroundGroup = null;\n };\n\n BarView.type = 'bar';\n return BarView;\n}(ChartView);\n\nvar clip = {\n cartesian2d: function (coordSysBoundingRect, layout) {\n var signWidth = layout.width < 0 ? -1 : 1;\n var signHeight = layout.height < 0 ? -1 : 1; // Needs positive width and height\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\n var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\n var x = mathMax(layout.x, coordSysBoundingRect.x);\n var x2 = mathMin(layout.x + layout.width, coordSysX2);\n var y = mathMax(layout.y, coordSysBoundingRect.y);\n var y2 = mathMin(layout.y + layout.height, coordSysY2);\n var xClipped = x2 < x;\n var yClipped = y2 < y; // When xClipped or yClipped, the element will be marked as `ignore`.\n // But we should also place the element at the edge of the coord sys bounding rect.\n // Beause if data changed and the bar show again, its transition animaiton\n // will begin at this place.\n\n layout.x = xClipped && x > coordSysX2 ? x2 : x;\n layout.y = yClipped && y > coordSysY2 ? y2 : y;\n layout.width = xClipped ? 0 : x2 - x;\n layout.height = yClipped ? 0 : y2 - y; // Reverse back\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n return xClipped || yClipped;\n },\n polar: function (coordSysClipArea, layout) {\n var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n var r = mathMin(layout.r, coordSysClipArea.r);\n var r0 = mathMax(layout.r0, coordSysClipArea.r0);\n layout.r = r;\n layout.r0 = r0;\n var clipped = r - r0 < 0; // Reverse back\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n return clipped;\n }\n};\nvar elementCreator = {\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\n var rect = new Rect({\n shape: extend({}, layout),\n z2: 1\n });\n rect.__dataIndex = newIndex;\n rect.name = 'item';\n\n if (animationModel) {\n var rectShape = rect.shape;\n var animateProperty = isHorizontal ? 'height' : 'width';\n rectShape[animateProperty] = 0;\n }\n\n return rect;\n },\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\n // Keep the same logic with bar in catesion: use end value to control\n // direction. Notice that if clockwise is true (by default), the sector\n // will always draw clockwisely, no matter whether endAngle is greater\n // or less than startAngle.\n var clockwise = layout.startAngle < layout.endAngle;\n var ShapeClass = !isRadial && roundCap ? Sausage : Sector;\n var sector = new ShapeClass({\n shape: defaults({\n clockwise: clockwise\n }, layout),\n z2: 1\n });\n sector.name = 'item'; // Animation\n\n if (animationModel) {\n var sectorShape = sector.shape;\n var animateProperty = isRadial ? 'r' : 'endAngle';\n var animateTarget = {};\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\n animateTarget[animateProperty] = layout[animateProperty];\n (isUpdate ? updateProps : initProps)(sector, {\n shape: animateTarget // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\n\n }, animationModel);\n }\n\n return sector;\n }\n};\n\nfunction shouldRealtimeSort(seriesModel, coordSys) {\n var realtimeSortOption = seriesModel.get('realtimeSort', true);\n var baseAxis = coordSys.getBaseAxis();\n\n if (process.env.NODE_ENV !== 'production') {\n if (realtimeSortOption) {\n if (baseAxis.type !== 'category') {\n warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\n }\n\n if (coordSys.type !== 'cartesian2d') {\n warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\n }\n }\n }\n\n if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\n return {\n baseAxis: baseAxis,\n otherAxis: coordSys.getOtherAxis(baseAxis)\n };\n }\n}\n\nfunction updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\n var seriesTarget;\n var axisTarget;\n\n if (isHorizontal) {\n axisTarget = {\n x: layout.x,\n width: layout.width\n };\n seriesTarget = {\n y: layout.y,\n height: layout.height\n };\n } else {\n axisTarget = {\n y: layout.y,\n height: layout.height\n };\n seriesTarget = {\n x: layout.x,\n width: layout.width\n };\n }\n\n if (!isChangeOrder) {\n // Keep the original growth animation if only axis order changed.\n // Not start a new animation.\n (isUpdate ? updateProps : initProps)(el, {\n shape: seriesTarget\n }, seriesAnimationModel, newIndex, null);\n }\n\n var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\n (isUpdate ? updateProps : initProps)(el, {\n shape: axisTarget\n }, axisAnimationModel, newIndex);\n}\n\nvar getLayout = {\n // itemModel is only used to get borderWidth, which is not needed\n // when calculating bar background layout.\n cartesian2d: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth\n\n var signX = layout.width > 0 ? 1 : -1;\n var signY = layout.height > 0 ? 1 : -1;\n return {\n x: layout.x + signX * fixedLineWidth / 2,\n y: layout.y + signY * fixedLineWidth / 2,\n width: layout.width - signX * fixedLineWidth,\n height: layout.height - signY * fixedLineWidth\n };\n },\n polar: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n return {\n cx: layout.cx,\n cy: layout.cy,\n r0: layout.r0,\n r: layout.r,\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n };\n }\n};\n\nfunction isZeroOnPolar(layout) {\n return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;\n}\n\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\n var style = data.getItemVisual(dataIndex, 'style');\n\n if (!isPolar) {\n el.setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0);\n }\n\n el.useStyle(style);\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && el.attr('cursor', cursorStyle);\n\n if (!isPolar) {\n var labelPositionOutside = isHorizontal ? layout.height > 0 ? 'bottom' : 'top' : layout.width > 0 ? 'left' : 'right';\n var labelStatesModels = getLabelStatesModels(itemModel);\n setLabelStyle(el, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n inheritColor: style.fill,\n defaultOpacity: style.opacity,\n defaultOutsidePosition: labelPositionOutside\n });\n var label = el.getTextContent();\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) {\n return getDefaultInterpolatedLabel(data, value);\n });\n }\n\n var emphasisModel = itemModel.getModel(['emphasis']);\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n setStatesStylesFromModel(el, itemModel);\n\n if (isZeroOnPolar(layout)) {\n el.style.fill = 'none';\n el.style.stroke = 'none';\n each(el.states, function (state) {\n if (state.style) {\n state.style.fill = state.style.stroke = 'none';\n }\n });\n }\n} // In case width or height are too small.\n\n\nfunction getLineWidth(itemModel, rawLayout) {\n // Has no border.\n var borderColor = itemModel.get(['itemStyle', 'borderColor']);\n\n if (!borderColor || borderColor === 'none') {\n return 0;\n }\n\n var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; // width or height may be NaN for empty data\n\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\n return Math.min(lineWidth, width, height);\n}\n\nvar LagePathShape =\n/** @class */\nfunction () {\n function LagePathShape() {}\n\n return LagePathShape;\n}();\n\nvar LargePath =\n/** @class */\nfunction (_super) {\n __extends(LargePath, _super);\n\n function LargePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeBar';\n return _this;\n }\n\n ;\n\n LargePath.prototype.getDefaultShape = function () {\n return new LagePathShape();\n };\n\n LargePath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n var startPoint = this.__startPoint;\n var baseDimIdx = this.__baseDimIdx;\n\n for (var i = 0; i < points.length; i += 2) {\n startPoint[baseDimIdx] = points[i + baseDimIdx];\n ctx.moveTo(startPoint[0], startPoint[1]);\n ctx.lineTo(points[i], points[i + 1]);\n }\n };\n\n return LargePath;\n}(Path);\n\nfunction createLarge(seriesModel, group, incremental) {\n // TODO support polar\n var data = seriesModel.getData();\n var startPoint = [];\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\n var largeDataIndices = data.getLayout('largeDataIndices');\n var barWidth = data.getLayout('barWidth');\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var drawBackground = seriesModel.get('showBackground', true);\n\n if (drawBackground) {\n var points = data.getLayout('largeBackgroundPoints');\n var backgroundStartPoint = [];\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\n var bgEl = new LargePath({\n shape: {\n points: points\n },\n incremental: !!incremental,\n silent: true,\n z2: 0\n });\n bgEl.__startPoint = backgroundStartPoint;\n bgEl.__baseDimIdx = baseDimIdx;\n bgEl.__largeDataIndices = largeDataIndices;\n bgEl.__barWidth = barWidth;\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\n group.add(bgEl);\n }\n\n var el = new LargePath({\n shape: {\n points: data.getLayout('largePoints')\n },\n incremental: !!incremental\n });\n el.__startPoint = startPoint;\n el.__baseDimIdx = baseDimIdx;\n el.__largeDataIndices = largeDataIndices;\n el.__barWidth = barWidth;\n group.add(el);\n setLargeStyle(el, seriesModel, data); // Enable tooltip and user mouse/touch event handlers.\n\n getECData(el).seriesIndex = seriesModel.seriesIndex;\n\n if (!seriesModel.get('silent')) {\n el.on('mousedown', largePathUpdateDataIndex);\n el.on('mousemove', largePathUpdateDataIndex);\n }\n} // Use throttle to avoid frequently traverse to find dataIndex.\n\n\nvar largePathUpdateDataIndex = throttle(function (event) {\n var largePath = this;\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\n}, 30, false);\n\nfunction largePathFindDataIndex(largePath, x, y) {\n var baseDimIdx = largePath.__baseDimIdx;\n var valueDimIdx = 1 - baseDimIdx;\n var points = largePath.shape.points;\n var largeDataIndices = largePath.__largeDataIndices;\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\n var startValueVal = largePath.__startPoint[valueDimIdx];\n _eventPos[0] = x;\n _eventPos[1] = y;\n var pointerBaseVal = _eventPos[baseDimIdx];\n var pointerValueVal = _eventPos[1 - baseDimIdx];\n var baseLowerBound = pointerBaseVal - barWidthHalf;\n var baseUpperBound = pointerBaseVal + barWidthHalf;\n\n for (var i = 0, len = points.length / 2; i < len; i++) {\n var ii = i * 2;\n var barBaseVal = points[ii + baseDimIdx];\n var barValueVal = points[ii + valueDimIdx];\n\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound && (startValueVal <= barValueVal ? pointerValueVal >= startValueVal && pointerValueVal <= barValueVal : pointerValueVal >= barValueVal && pointerValueVal <= startValueVal)) {\n return largeDataIndices[i];\n }\n }\n\n return -1;\n}\n\nfunction setLargeStyle(el, seriesModel, data) {\n var globalStyle = data.getVisual('style');\n el.useStyle(extend({}, globalStyle)); // Use stroke instead of fill.\n\n el.style.fill = null;\n el.style.stroke = globalStyle.fill;\n el.style.lineWidth = data.getLayout('barWidth');\n}\n\nfunction setLargeBackgroundStyle(el, backgroundModel, data) {\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\n var itemStyle = backgroundModel.getItemStyle();\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n el.style.lineWidth = data.getLayout('barWidth');\n}\n\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var rectShape = layout;\n var coordLayout = coord.getArea();\n return {\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\n };\n } else {\n var coordLayout = coord.getArea();\n var sectorShape = layout;\n return {\n cx: coordLayout.cx,\n cy: coordLayout.cy,\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\n };\n }\n}\n\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\n return new ElementClz({\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\n silent: true,\n z2: 0\n });\n}\n\nexport default BarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { layout, largeLayout } from '../../layout/barGrid';\nimport dataSample from '../../processor/dataSample';\nimport BarSeries from './BarSeries';\nimport BarView from './BarView';\nexport function install(registers) {\n registers.registerChartView(BarView);\n registers.registerSeriesModel(BarSeries);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar')); // Use higher prority to avoid to be blocked by other overall layout, which do not\n // only exist in this module, but probably also exist in other modules, like `barPolar`.\n\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n /**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n\n registers.registerAction({\n type: 'changeAxisOrder',\n event: 'changeAxisOrder',\n update: 'update'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n if (payload.sortInfo) {\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\n }\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parsePercent, linearMap } from '../../util/number';\nimport * as layout from '../../util/layout';\nimport * as zrUtil from 'zrender/lib/core/util';\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport default function pieLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var viewRect = getViewRect(seriesModel, api);\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = parsePercent(viewRect.width, api.getWidth());\n var height = parsePercent(viewRect.height, api.getHeight());\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width) + viewRect.x;\n var cy = parsePercent(center[1], height) + viewRect.y;\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var validDataCount = 0;\n data.each(valueDim, function (value) {\n !isNaN(value) && validDataCount++;\n });\n var sum = data.getSum(valueDim); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var clockwise = seriesModel.get('clockwise');\n var roseType = seriesModel.get('roseType');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max]\n\n var extent = data.getDataExtent(valueDim);\n extent[0] = 0; // In the case some sector angle is smaller than minAngle\n\n var restAngle = PI2;\n var valueSumLargerThanMinAngle = 0;\n var currentAngle = startAngle;\n var dir = clockwise ? 1 : -1;\n data.setLayout({\n viewRect: viewRect,\n r: r\n });\n data.each(valueDim, function (value, idx) {\n var angle;\n\n if (isNaN(value)) {\n data.setItemLayout(idx, {\n angle: NaN,\n startAngle: NaN,\n endAngle: NaN,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? NaN : r\n });\n return;\n } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\n\n\n if (roseType !== 'area') {\n angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n } else {\n angle = PI2 / validDataCount;\n }\n\n if (angle < minAngle) {\n angle = minAngle;\n restAngle -= minAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n\n var endAngle = currentAngle + dir * angle;\n data.setItemLayout(idx, {\n angle: angle,\n startAngle: currentAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? linearMap(value, extent, [r0, r]) : r\n });\n currentAngle = endAngle;\n }); // Some sector is constrained by minAngle\n // Rest sectors needs recalculate angle\n\n if (restAngle < PI2 && validDataCount) {\n // Average the angle if rest angle is not enough after all angles is\n // Constrained by minAngle\n if (restAngle <= 1e-3) {\n var angle_1 = PI2 / validDataCount;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_1 = data.getItemLayout(idx);\n layout_1.angle = angle_1;\n layout_1.startAngle = startAngle + dir * idx * angle_1;\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\n }\n });\n } else {\n unitRadian = restAngle / valueSumLargerThanMinAngle;\n currentAngle = startAngle;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_2 = data.getItemLayout(idx);\n var angle = layout_2.angle === minAngle ? minAngle : value * unitRadian;\n layout_2.startAngle = currentAngle;\n layout_2.endAngle = currentAngle + dir * angle;\n currentAngle += dir * angle;\n }\n });\n }\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function dataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n // @ts-ignore FIXME: LegendModel\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME emphasis label position is not same with normal label position\nimport { parsePercent } from '../../util/number';\nimport { Point } from '../../util/graphic';\nimport { each } from 'zrender/lib/core/util';\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper';\nimport { shiftLayoutOnY } from '../../label/labelLayoutHelper';\nvar RADIAN = Math.PI / 180;\n\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\n if (list.length < 2) {\n return;\n }\n\n ;\n\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\n var rB = semi.rB;\n var rB2 = rB * rB;\n\n for (var i = 0; i < semi.list.length; i++) {\n var item = semi.list[i];\n var dy = Math.abs(item.label.y - cy); // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len;\n var rA2 = rA * rA; // Use ellipse implicit function to calculate x\n\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\n item.label.x = cx + (dx + item.len2) * dir;\n }\n } // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\n\n\n function recalculateX(items) {\n // Extremes of\n var topSemi = {\n list: [],\n maxY: 0\n };\n var bottomSemi = {\n list: [],\n maxY: 0\n };\n\n for (var i = 0; i < items.length; i++) {\n if (items[i].labelAlignTo !== 'none') {\n continue;\n }\n\n var item = items[i];\n var semi = item.label.y > cy ? bottomSemi : topSemi;\n var dy = Math.abs(item.label.y - cy);\n\n if (dy > semi.maxY) {\n var dx = item.label.x - cx - item.len2 * dir; // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len; // Canculate rB based on the topest / bottemest label.\n\n var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA;\n semi.rB = rB;\n semi.maxY = dy;\n }\n\n semi.list.push(item);\n }\n\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\n }\n\n var len = list.length;\n\n for (var i = 0; i < len; i++) {\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\n var dx = list[i].label.x - farthestX;\n list[i].linePoints[1][0] += dx;\n list[i].label.x = farthestX;\n }\n }\n\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\n recalculateX(list);\n }\n}\n\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\n var leftList = [];\n var rightList = [];\n var leftmostX = Number.MAX_VALUE;\n var rightmostX = -Number.MAX_VALUE;\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var label = labelLayoutList[i].label;\n\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n\n if (label.x < cx) {\n leftmostX = Math.min(leftmostX, label.x);\n leftList.push(labelLayoutList[i]);\n } else {\n rightmostX = Math.max(rightmostX, label.x);\n rightList.push(labelLayoutList[i]);\n }\n }\n\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n var label = layout.label;\n\n if (isPositionCenter(layout)) {\n continue;\n }\n\n var linePoints = layout.linePoints;\n\n if (linePoints) {\n var isAlignToEdge = layout.labelAlignTo === 'edge';\n var realTextWidth = layout.rect.width;\n var targetTextWidth = void 0;\n\n if (isAlignToEdge) {\n if (label.x < cx) {\n targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance;\n } else {\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance;\n }\n } else {\n if (label.x < cx) {\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\n }\n }\n\n if (targetTextWidth < layout.rect.width) {\n // TODOTODO\n // layout.text = textContain.truncateText(layout.text, targetTextWidth, layout.font);\n layout.label.style.width = targetTextWidth;\n\n if (layout.labelAlignTo === 'edge') {\n realTextWidth = targetTextWidth; // realTextWidth = textContain.getWidth(layout.text, layout.font);\n }\n }\n\n var dist = linePoints[1][0] - linePoints[2][0];\n\n if (isAlignToEdge) {\n if (label.x < cx) {\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\n } else {\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance;\n }\n } else {\n if (label.x < cx) {\n linePoints[2][0] = label.x + layout.labelDistance;\n } else {\n linePoints[2][0] = label.x - layout.labelDistance;\n }\n\n linePoints[1][0] = linePoints[2][0] + dist;\n }\n\n linePoints[1][1] = linePoints[2][1] = label.y;\n }\n }\n}\n\nfunction isPositionCenter(sectorShape) {\n // Not change x for center label\n return sectorShape.position === 'center';\n}\n\nexport default function pieLabelLayout(seriesModel) {\n var data = seriesModel.getData();\n var labelLayoutList = [];\n var cx;\n var cy;\n var hasLabelRotate = false;\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\n var viewRect = data.getLayout('viewRect');\n var r = data.getLayout('r');\n var viewWidth = viewRect.width;\n var viewLeft = viewRect.x;\n var viewTop = viewRect.y;\n var viewHeight = viewRect.height;\n\n function setNotShow(el) {\n el.ignore = true;\n }\n\n function isLabelShown(label) {\n if (!label.ignore) {\n return true;\n }\n\n for (var key in label.states) {\n if (label.states[key].ignore === false) {\n return true;\n }\n }\n\n return false;\n }\n\n data.each(function (idx) {\n var sector = data.getItemGraphicEl(idx);\n var sectorShape = sector.shape;\n var label = sector.getTextContent();\n var labelLine = sector.getTextGuideLine();\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis\n\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\n var labelDistance = labelModel.get('distanceToLabelLine');\n var labelAlignTo = labelModel.get('alignTo');\n var edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\n var bleedMargin = labelModel.get('bleedMargin');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineLen = labelLineModel.get('length');\n labelLineLen = parsePercent(labelLineLen, viewWidth);\n var labelLineLen2 = labelLineModel.get('length2');\n labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\n\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\n each(label.states, setNotShow);\n label.ignore = true;\n return;\n }\n\n if (!isLabelShown(label)) {\n return;\n }\n\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\n var nx = Math.cos(midAngle);\n var ny = Math.sin(midAngle);\n var textX;\n var textY;\n var linePoints;\n var textAlign;\n cx = sectorShape.cx;\n cy = sectorShape.cy;\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n\n if (labelPosition === 'center') {\n textX = sectorShape.cx;\n textY = sectorShape.cy;\n textAlign = 'center';\n } else {\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\n textX = x1 + nx * 3;\n textY = y1 + ny * 3;\n\n if (!isLabelInside) {\n // For roseType\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\n var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;\n var y3 = y2;\n\n if (labelAlignTo === 'edge') {\n // Adjust textX because text align of edge is opposite\n textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;\n } else {\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\n }\n\n textY = y3;\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n }\n\n textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right';\n }\n\n var labelRotate;\n var rotate = labelModel.get('rotate');\n\n if (typeof rotate === 'number') {\n labelRotate = rotate * (Math.PI / 180);\n } else {\n labelRotate = rotate ? nx < 0 ? -midAngle + Math.PI : -midAngle : 0;\n }\n\n hasLabelRotate = !!labelRotate;\n label.x = textX;\n label.y = textY;\n label.rotation = labelRotate;\n label.setStyle({\n verticalAlign: 'middle'\n }); // Not sectorShape the inside label\n\n if (!isLabelInside) {\n var textRect = label.getBoundingRect().clone();\n textRect.applyTransform(label.getComputedTransform()); // Text has a default 1px stroke. Exclude this.\n\n var margin = (label.style.margin || 0) + 2.1;\n textRect.y -= margin / 2;\n textRect.height += margin;\n labelLayoutList.push({\n label: label,\n labelLine: labelLine,\n position: labelPosition,\n len: labelLineLen,\n len2: labelLineLen2,\n minTurnAngle: labelLineModel.get('minTurnAngle'),\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\n surfaceNormal: new Point(nx, ny),\n linePoints: linePoints,\n textAlign: textAlign,\n labelDistance: labelDistance,\n labelAlignTo: labelAlignTo,\n edgeDistance: edgeDistance,\n bleedMargin: bleedMargin,\n rect: textRect\n });\n } else {\n label.setStyle({\n align: textAlign\n });\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n sector.setTextConfig({\n inside: isLabelInside\n });\n });\n\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\n }\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n var label = layout.label;\n var labelLine = layout.labelLine;\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\n\n if (label) {\n label.setStyle({\n align: layout.textAlign\n });\n\n if (notShowLabel) {\n each(label.states, setNotShow);\n label.ignore = true;\n }\n\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n if (labelLine) {\n var linePoints = layout.linePoints;\n\n if (notShowLabel || !linePoints) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n } else {\n limitTurnAngle(linePoints, layout.minTurnAngle);\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\n labelLine.setShape({\n points: linePoints\n }); // Set the anchor to the midpoint of sector\n\n label.__hostTarget.textGuideLineConfig = {\n anchor: new Point(linePoints[0][0], linePoints[0][1])\n };\n }\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util';\nimport { parsePercent } from 'zrender/lib/contain/text';\nexport function getSectorCornerRadius(model, shape) {\n var cornerRadius = model.get('borderRadius');\n\n if (cornerRadius == null) {\n return null;\n }\n\n if (!isArray(cornerRadius)) {\n cornerRadius = [cornerRadius, cornerRadius];\n }\n\n return {\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __assign, __extends } from \"tslib\";\nimport { extend, retrieve3 } from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport ChartView from '../../view/Chart';\nimport labelLayout from './labelLayout';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport { getSectorCornerRadius } from '../helper/pieHelper';\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\n\nvar PiePiece =\n/** @class */\nfunction (_super) {\n __extends(PiePiece, _super);\n\n function PiePiece(data, idx, startAngle) {\n var _this = _super.call(this) || this;\n\n _this.z2 = 2;\n var text = new graphic.Text();\n\n _this.setTextContent(text);\n\n _this.updateData(data, idx, startAngle, true);\n\n return _this;\n }\n\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n var sector = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = data.getItemLayout(idx);\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout); // Ignore NaN data.\n\n if (isNaN(sectorShape.startAngle)) {\n // Use NaN shape to avoid drawing shape.\n sector.setShape(sectorShape);\n return;\n }\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n var animationType = seriesModel.getShallow('animationType');\n\n if (animationType === 'scale') {\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, idx);\n } // Expansion\n else {\n if (startAngle != null) {\n sector.setShape({\n startAngle: startAngle,\n endAngle: startAngle\n });\n graphic.initProps(sector, {\n shape: {\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n } else {\n sector.shape.endAngle = layout.startAngle;\n graphic.updateProps(sector, {\n shape: {\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n }\n }\n } else {\n // Transition animation from the old shape\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel, idx);\n }\n\n sector.useStyle(data.getItemVisual(idx, 'style'));\n setStatesStylesFromModel(sector, itemModel);\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var offset = seriesModel.get('selectedOffset');\n var dx = Math.cos(midAngle) * offset;\n var dy = Math.sin(midAngle) * offset;\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n\n this._updateLabel(seriesModel, data, idx);\n\n sector.ensureState('emphasis').shape = __assign({\n r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)\n }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\n extend(sector.ensureState('select'), {\n x: dx,\n y: dy,\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\n });\n extend(sector.ensureState('blur'), {\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\n });\n var labelLine = sector.getTextGuideLine();\n var labelText = sector.getTextContent();\n labelLine && extend(labelLine.ensureState('select'), {\n x: dx,\n y: dy\n }); // TODO: needs dx, dy in zrender?\n\n extend(labelText.ensureState('select'), {\n x: dx,\n y: dy\n });\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n };\n\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\n var sector = this;\n var itemModel = data.getItemModel(idx);\n var labelLineModel = itemModel.getModel('labelLine');\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style && style.fill;\n var visualOpacity = style && style.opacity;\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx)\n });\n var labelText = sector.getTextContent(); // Set textConfig on sector.\n\n sector.setTextConfig({\n // reset position, rotation\n position: null,\n rotation: null\n }); // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n labelText.attr({\n z2: 10\n });\n var labelPosition = seriesModel.get(['label', 'position']);\n\n if (labelPosition !== 'outside' && labelPosition !== 'outer') {\n sector.removeTextGuideLine();\n } else {\n var polyline = this.getTextGuideLine();\n\n if (!polyline) {\n polyline = new graphic.Polyline();\n this.setTextGuideLine(polyline);\n } // Default use item visual color\n\n\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\n stroke: visualColor,\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\n });\n }\n };\n\n return PiePiece;\n}(graphic.Sector); // Pie view\n\n\nvar PieView =\n/** @class */\nfunction (_super) {\n __extends(PieView, _super);\n\n function PieView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n PieView.prototype.init = function () {\n var sectorGroup = new graphic.Group();\n this._sectorGroup = sectorGroup;\n };\n\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var startAngle; // First render\n\n if (!oldData && data.count() > 0) {\n var shape = data.getItemLayout(0);\n\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\n shape = data.getItemLayout(s);\n }\n\n if (shape) {\n startAngle = shape.startAngle;\n }\n }\n\n data.diff(oldData).add(function (idx) {\n var piePiece = new PiePiece(data, idx, startAngle);\n data.setItemGraphicEl(idx, piePiece);\n group.add(piePiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx, startAngle);\n piePiece.off('click');\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\n }).execute();\n labelLayout(seriesModel); // Always use initial animation.\n\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\n this._data = data;\n }\n };\n\n PieView.prototype.dispose = function () {};\n\n PieView.prototype.containPoint = function (point, seriesModel) {\n var data = seriesModel.getData();\n var itemLayout = data.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n PieView.type = 'pie';\n return PieView;\n}(ChartView);\n\nexport default PieView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createDimensions from '../../data/helper/createDimensions';\nimport List from '../../data/List';\nimport { extend, isArray } from 'zrender/lib/core/util';\n/**\n * [Usage]:\n * (1)\n * createListSimply(seriesModel, ['value']);\n * (2)\n * createListSimply(seriesModel, {\n * coordDimensions: ['value'],\n * dimensionsCount: 5\n * });\n */\n\nexport default function createListSimply(seriesModel, opt, nameList) {\n opt = isArray(opt) && {\n coordDimensions: opt\n } || extend({}, opt);\n var source = seriesModel.getSource();\n var dimensionsInfo = createDimensions(source, opt);\n var list = new List(dimensionsInfo, seriesModel);\n list.initData(source, nameList);\n return list;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * LegendVisualProvider is an bridge that pick encoded color from data and\n * provide to the legend component.\n */\nvar LegendVisualProvider =\n/** @class */\nfunction () {\n function LegendVisualProvider( // Function to get data after filtered. It stores all the encoding info\n getDataWithEncodedVisual, // Function to get raw data before filtered.\n getRawData) {\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\n this._getRawData = getRawData;\n }\n\n LegendVisualProvider.prototype.getAllNames = function () {\n var rawData = this._getRawData(); // We find the name from the raw data. In case it's filtered by the legend component.\n // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\n\n\n return rawData.mapArray(rawData.getName);\n };\n\n LegendVisualProvider.prototype.containName = function (name) {\n var rawData = this._getRawData();\n\n return rawData.indexOfName(name) >= 0;\n };\n\n LegendVisualProvider.prototype.indexOfName = function (name) {\n // Only get data when necessary.\n // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n // Invoking Series#getData immediately will throw an error.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.indexOfName(name);\n };\n\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\n // Get encoded visual properties from final filtered data.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\n };\n\n return LegendVisualProvider;\n}();\n\nexport default LegendVisualProvider;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createListSimply from '../helper/createListSimply';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nimport { getPercentWithPrecision } from '../../util/number';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\nimport SeriesModel from '../../model/Series';\n\nvar PieSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PieSeriesModel, _super);\n\n function PieSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.useColorPaletteOnData = true;\n return _this;\n }\n /**\n * @overwrite\n */\n\n\n PieSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n\n this._defaultLabelLine(option);\n };\n /**\n * @overwrite\n */\n\n\n PieSeriesModel.prototype.mergeOption = function () {\n _super.prototype.mergeOption.apply(this, arguments);\n };\n /**\n * @overwrite\n */\n\n\n PieSeriesModel.prototype.getInitialData = function () {\n return createListSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n /**\n * @overwrite\n */\n\n\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n\n var params = _super.prototype.getDataParams.call(this, dataIndex); // FIXME toFixed?\n\n\n var valueList = [];\n data.each(data.mapDimension('value'), function (value) {\n valueList.push(value);\n });\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\n params.$vars.push('percent');\n return params;\n };\n\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n };\n\n PieSeriesModel.type = 'series.pie';\n PieSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If the angle of a sector less than `minShowLabelAngle`,\n // the label will not be displayed.\n minShowLabelAngle: 0,\n // 选中时扇区偏移量\n selectedOffset: 10,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)\n // roseType: null,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // cursor: null,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: null,\n height: null,\n label: {\n // color: 'inherit',\n // If rotate around circle\n rotate: 0,\n show: true,\n overflow: 'truncate',\n // 'outer', 'inside', 'center'\n position: 'outer',\n // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\n alignTo: 'none',\n // Closest distance between label and chart edge.\n // Works only position is 'outer' and alignTo is 'edge'.\n edgeDistance: '25%',\n // Works only position is 'outer' and alignTo is not 'edge'.\n bleedMargin: 10,\n // Distance between text and label line.\n distanceToLabelLine: 5 // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n // 默认使用全局文本样式,详见TEXTSTYLE\n // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数\n\n },\n // Enabled when label.normal.position is 'outer'\n labelLine: {\n show: true,\n // 引导线两段中的第一段长度\n length: 15,\n // 引导线两段中的第二段长度\n length2: 15,\n smooth: false,\n minTurnAngle: 90,\n maxSurfaceAngle: 90,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n borderWidth: 1\n },\n labelLayout: {\n // Hide the overlapped label.\n hideOverlap: true\n },\n emphasis: {\n scale: true,\n scaleSize: 5\n },\n // If use strategy to avoid label overlapping\n avoidLabelOverlap: true,\n // Animation type. Valid values: expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n // Animation type when update. Valid values: transition, expansion\n animationTypeUpdate: 'transition',\n animationEasingUpdate: 'cubicInOut',\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut'\n };\n return PieSeriesModel;\n}(SeriesModel);\n\nexport default PieSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction';\nimport pieLayout from '../pie/pieLayout';\nimport dataFilter from '../../processor/dataFilter';\nimport { curry } from 'zrender/lib/core/util';\nimport PieView from './PieView';\nimport PieSeriesModel from './PieSeries';\nexport function install(registers) {\n registers.registerChartView(PieView);\n registers.registerSeriesModel(PieSeriesModel);\n createLegacyDataSelectAction('pie', registers.registerAction);\n registers.registerLayout(curry(pieLayout, 'pie'));\n registers.registerProcessor(dataFilter('pie'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createListFromArray from '../helper/createListFromArray';\nimport SeriesModel from '../../model/Series';\n\nvar ScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ScatterSeriesModel, _super);\n\n function ScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: true\n });\n };\n\n ScatterSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n // PENDING\n return this.option.large ? 5e3 : this.get('progressive');\n }\n\n return progressive;\n };\n\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n // PENDING\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n ScatterSeriesModel.type = 'series.scatter';\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n ScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n symbolSize: 10,\n // symbolRotate: null, // 图形旋转控制\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // cursor: null,\n itemStyle: {\n opacity: 0.8 // color: 各异\n\n },\n emphasis: {\n scale: true\n },\n // If clip the overflow graphics\n // Works on cartesian / polar series\n clip: true,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n } // progressive: null\n\n };\n return ScatterSeriesModel;\n}(SeriesModel);\n\nexport default ScatterSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Float32Array */\n// TODO Batch by color\n\nimport * as graphic from '../../util/graphic';\nimport { createSymbol } from '../../util/symbol';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable';\nimport { getECData } from '../../util/innerStore';\nvar BOOST_SIZE_THRESHOLD = 4;\n\nvar LargeSymbolPathShape =\n/** @class */\nfunction () {\n function LargeSymbolPathShape() {}\n\n return LargeSymbolPathShape;\n}();\n\nvar LargeSymbolPath =\n/** @class */\nfunction (_super) {\n __extends(LargeSymbolPath, _super);\n\n function LargeSymbolPath(opts) {\n return _super.call(this, opts) || this;\n }\n\n LargeSymbolPath.prototype.getDefaultShape = function () {\n return new LargeSymbolPathShape();\n };\n\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\n var points = shape.points;\n var size = shape.size;\n var symbolProxy = this.symbolProxy;\n var symbolProxyShape = symbolProxy.shape;\n var ctx = path.getContext ? path.getContext() : path;\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; // Do draw in afterBrush.\n\n if (canBoost) {\n this._ctx = ctx;\n return;\n }\n\n this._ctx = null;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\n continue;\n }\n\n symbolProxyShape.x = x - size[0] / 2;\n symbolProxyShape.y = y - size[1] / 2;\n symbolProxyShape.width = size[0];\n symbolProxyShape.height = size[1];\n symbolProxy.buildPath(path, symbolProxyShape, true);\n }\n };\n\n LargeSymbolPath.prototype.afterBrush = function () {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var ctx = this._ctx;\n\n if (!ctx) {\n return;\n } // PENDING If style or other canvas status changed?\n\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\n continue;\n } // fillRect is faster than building a rect path and draw.\n // And it support light globalCompositeOperation.\n\n\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n }\n };\n\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\n // TODO ???\n // Consider transform\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = Math.max(size[0], 4);\n var h = Math.max(size[1], 4); // Not consider transform\n // Treat each element as a rect\n // top down traverse\n\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n var i = idx * 2;\n var x0 = points[i] - w / 2;\n var y0 = points[i + 1] - h / 2;\n\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n return idx;\n }\n }\n\n return -1;\n };\n\n return LargeSymbolPath;\n}(graphic.Path);\n\nvar LargeSymbolDraw =\n/** @class */\nfunction () {\n function LargeSymbolDraw() {\n this.group = new graphic.Group();\n }\n\n LargeSymbolDraw.prototype.isPersistent = function () {\n return !this._incremental;\n };\n\n ;\n /**\n * Update symbols draw by new data\n */\n\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\n this.group.removeAll();\n var symbolEl = new LargeSymbolPath({\n rectHover: true,\n cursor: 'default'\n });\n symbolEl.setShape({\n points: data.getLayout('points')\n });\n\n this._setCommon(symbolEl, data, false, opt);\n\n this.group.add(symbolEl);\n this._incremental = null;\n };\n\n LargeSymbolDraw.prototype.updateLayout = function (data) {\n if (this._incremental) {\n return;\n }\n\n var points = data.getLayout('points');\n this.group.eachChild(function (child) {\n if (child.startIndex != null) {\n var len = (child.endIndex - child.startIndex) * 2;\n var byteOffset = child.startIndex * 4 * 2;\n points = new Float32Array(points.buffer, byteOffset, len);\n }\n\n child.setShape('points', points);\n });\n };\n\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clearIncremental(); // Only use incremental displayables when data amount is larger than 2 million.\n // PENDING Incremental data?\n\n\n if (data.count() > 2e6) {\n if (!this._incremental) {\n this._incremental = new IncrementalDisplayable({\n silent: true\n });\n }\n\n this.group.add(this._incremental);\n } else {\n this._incremental = null;\n }\n };\n\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n var symbolEl;\n\n if (this._incremental) {\n symbolEl = new LargeSymbolPath();\n\n this._incremental.addDisplayable(symbolEl, true);\n } else {\n symbolEl = new LargeSymbolPath({\n rectHover: true,\n cursor: 'default',\n startIndex: taskParams.start,\n endIndex: taskParams.end\n });\n symbolEl.incremental = true;\n this.group.add(symbolEl);\n }\n\n symbolEl.setShape({\n points: data.getLayout('points')\n });\n\n this._setCommon(symbolEl, data, !!this._incremental, opt);\n };\n\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\n var hostModel = data.hostModel;\n opt = opt || {};\n var size = data.getVisual('symbolSize');\n symbolEl.setShape('size', size instanceof Array ? size : [size, size]);\n symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data\n\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method\n\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow.\n hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n var globalStyle = data.getVisual('style');\n var visualColor = globalStyle && globalStyle.fill;\n\n if (visualColor) {\n symbolEl.setColor(visualColor);\n }\n\n if (!isIncremental) {\n var ecData_1 = getECData(symbolEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData_1.seriesIndex = hostModel.seriesIndex;\n symbolEl.on('mousemove', function (e) {\n ecData_1.dataIndex = null;\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\n\n if (dataIndex >= 0) {\n // Provide dataIndex for tooltip\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n }\n });\n }\n };\n\n LargeSymbolDraw.prototype.remove = function () {\n this._clearIncremental();\n\n this._incremental = null;\n this.group.removeAll();\n };\n\n LargeSymbolDraw.prototype._clearIncremental = function () {\n var incremental = this._incremental;\n\n if (incremental) {\n incremental.clearDisplaybles();\n }\n };\n\n return LargeSymbolDraw;\n}();\n\nexport default LargeSymbolDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw';\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw';\nimport pointsLayout from '../../layout/points';\nimport ChartView from '../../view/Chart';\n\nvar ScatterView =\n/** @class */\nfunction (_super) {\n __extends(ScatterView, _super);\n\n function ScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterView.type;\n return _this;\n }\n\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.updateData(data, {\n // TODO\n // If this parameter should be a shape or a bounding volume\n // shape will be more general.\n // But bounding volume like bounding rect will be much faster in the contain calculation\n clipShape: this._getClipShape(seriesModel)\n });\n this._finished = true;\n };\n\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.incrementalPrepareUpdate(data);\n this._finished = false;\n };\n\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\n clipShape: this._getClipShape(seriesModel)\n });\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared\n // PENDING\n\n this.group.dirty();\n\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\n return {\n update: true\n };\n } else {\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout(data);\n }\n };\n\n ScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\n var symbolDraw = this._symbolDraw;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n symbolDraw && symbolDraw.remove();\n symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(symbolDraw.group);\n return symbolDraw;\n };\n\n ScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n this._symbolDraw = null;\n };\n\n ScatterView.prototype.dispose = function () {};\n\n ScatterView.type = 'scatter';\n return ScatterView;\n}(ChartView);\n\nexport default ScatterView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar GridModel =\n/** @class */\nfunction (_super) {\n __extends(GridModel, _super);\n\n function GridModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GridModel.type = 'grid';\n GridModel.dependencies = ['xAxis', 'yAxis'];\n GridModel.layoutMode = 'box';\n GridModel.defaultOption = {\n show: false,\n zlevel: 0,\n z: 0,\n left: '10%',\n top: 60,\n right: '10%',\n bottom: 70,\n // If grid size contain label\n containLabel: false,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 1,\n borderColor: '#ccc'\n };\n return GridModel;\n}(ComponentModel);\n\nexport default GridModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar AxisModelCommonMixin =\n/** @class */\nfunction () {\n function AxisModelCommonMixin() {}\n\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n var option = this.option;\n return !option.scale;\n };\n /**\n * Should be implemented by each axis model if necessary.\n * @return coordinate system model\n */\n\n\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n return;\n };\n\n return AxisModelCommonMixin;\n}();\n\nexport { AxisModelCommonMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nvar CartesianAxisModel =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisModel, _super);\n\n function CartesianAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n CartesianAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n };\n\n CartesianAxisModel.type = 'cartesian2dAxis';\n return CartesianAxisModel;\n}(ComponentModel);\n\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar defaultOption = {\n show: true,\n zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By default auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#6E7079',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#E0E6F1'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\n }\n }\n};\nvar categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n boundaryGap: [0, 0],\n axisLine: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n axisTick: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n splitNumber: 5,\n minorTick: {\n // Minor tick, not available for cateogry axis.\n show: false,\n // Split number of minor ticks. The value should be in range of (0, 100)\n splitNumber: 5,\n // Lenght of minor tick\n length: 3,\n // Line style\n lineStyle: {// Default to be same with axisTick\n }\n },\n minorSplitLine: {\n show: false,\n lineStyle: {\n color: '#F4F7FD',\n width: 1\n }\n }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n scale: true,\n splitNumber: 6,\n axisLabel: {\n // To eliminate labels that are not nice\n showMinLabel: false,\n showMaxLabel: false,\n rich: {\n primary: {\n fontWeight: 'bold'\n }\n }\n },\n splitLine: {\n show: false\n }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n scale: true,\n logBase: 10\n}, valueAxis);\nexport default {\n category: categoryAxis,\n value: valueAxis,\n time: timeAxis,\n log: logAxis\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, map } from 'zrender/lib/core/util';\n\nvar OrdinalMeta =\n/** @class */\nfunction () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n }\n\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n\n ;\n\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\n * @return The ordinal. If not found, return NaN.\n */\n\n\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = this._getOrCreateMap(); // @ts-ignore\n\n\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category; // @ts-ignore\n\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n }; // Consider big data, do not create map until needed.\n\n\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n\n return OrdinalMeta;\n}();\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nexport default OrdinalMeta;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var AXIS_TYPES = {\n value: 1,\n category: 1,\n time: 1,\n log: 1\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout';\nimport OrdinalMeta from '../data/OrdinalMeta';\nimport { AXIS_TYPES } from './axisCommonTypes';\nimport { each, merge } from 'zrender/lib/core/util';\n/**\n * Generate sub axis model class\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\n */\n\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n each(AXIS_TYPES, function (v, axisType) {\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n __extends(AxisModel, _super);\n\n function AxisModel() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n merge(option, themeModel.get(axisType + 'Axis'));\n merge(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\n\nfunction getAxisType(option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as clazzUtil from '../util/clazz';\n\nvar Scale =\n/** @class */\nfunction () {\n function Scale(setting) {\n this._setting = setting || {};\n this._extent = [Infinity, -Infinity];\n }\n\n Scale.prototype.getSetting = function (name) {\n return this._setting[name];\n };\n /**\n * Set extent from data\n */\n\n\n Scale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power\n // this.setExtent(extent[0], extent[1]);\n };\n /**\n * Set extent from data\n */\n\n\n Scale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * Get extent\n *\n * Extent is always in increase order.\n */\n\n\n Scale.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\n * Set extent\n */\n\n\n Scale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n\n if (!isNaN(start)) {\n thisExtent[0] = start;\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = end;\n }\n };\n /**\n * If value is in extent range\n */\n\n\n Scale.prototype.isInExtentRange = function (value) {\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n /**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\n\n\n Scale.prototype.isBlank = function () {\n return this._isBlank;\n };\n /**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\n\n\n Scale.prototype.setBlank = function (isBlank) {\n this._isBlank = isBlank;\n };\n\n return Scale;\n}();\n\nclazzUtil.enableClassManagement(Scale);\nexport default Scale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as numberUtil from '../util/number';\nvar roundNumber = numberUtil.round;\n/**\n * @param extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param splitNumber splitNumber should be >= 1.\n */\n\nexport function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = numberUtil.nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [roundNumber(Math.ceil(extent[0] / interval) * interval, precision), roundNumber(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\n/**\n * @return interval precision\n */\n\nexport function getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return numberUtil.getPrecisionSafe(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nexport function fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\nexport function contain(val, extent) {\n return val >= extent[0] && val <= extent[1];\n}\nexport function normalize(val, extent) {\n if (extent[1] === extent[0]) {\n return 0.5;\n }\n\n return (val - extent[0]) / (extent[1] - extent[0]);\n}\nexport function scale(val, extent) {\n return val * (extent[1] - extent[0]) + extent[0];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Linear continuous scale\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */\n// FIXME only one data\n\nimport Scale from './Scale';\nimport OrdinalMeta from '../data/OrdinalMeta';\nimport * as scaleHelper from './helper';\nimport { isArray, map, isObject } from 'zrender/lib/core/util';\n\nvar OrdinalScale =\n/** @class */\nfunction (_super) {\n __extends(OrdinalScale, _super);\n\n function OrdinalScale(setting) {\n var _this = _super.call(this, setting) || this;\n\n _this.type = 'ordinal';\n\n var ordinalMeta = _this.getSetting('ordinalMeta'); // Caution: Should not use instanceof, consider ec-extensions using\n // import approach to get OrdinalMeta class.\n\n\n if (!ordinalMeta) {\n ordinalMeta = new OrdinalMeta({});\n }\n\n if (isArray(ordinalMeta)) {\n ordinalMeta = new OrdinalMeta({\n categories: map(ordinalMeta, function (item) {\n return isObject(item) ? item.value : item;\n })\n });\n }\n\n _this._ordinalMeta = ordinalMeta;\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\n return _this;\n }\n\n OrdinalScale.prototype.parse = function (val) {\n return typeof val === 'string' ? this._ordinalMeta.getOrdinal(val) // val might be float.\n : Math.round(val);\n };\n\n OrdinalScale.prototype.contain = function (rank) {\n rank = this.parse(rank);\n return scaleHelper.contain(rank, this._extent) && this._ordinalMeta.categories[rank] != null;\n };\n /**\n * Normalize given rank or name to linear [0, 1]\n * @param val raw ordinal number.\n * @return normalized value in [0, 1].\n */\n\n\n OrdinalScale.prototype.normalize = function (val) {\n val = this._getTickNumber(this.parse(val));\n return scaleHelper.normalize(val, this._extent);\n };\n /**\n * @param val normalized value in [0, 1].\n * @return raw ordinal number.\n */\n\n\n OrdinalScale.prototype.scale = function (val) {\n val = Math.round(scaleHelper.scale(val, this._extent));\n return this.getRawOrdinalNumber(val);\n };\n\n OrdinalScale.prototype.getTicks = function () {\n var ticks = [];\n var extent = this._extent;\n var rank = extent[0];\n\n while (rank <= extent[1]) {\n ticks.push({\n value: rank\n });\n rank++;\n }\n\n return ticks;\n };\n\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\n // Not support.\n return;\n };\n /**\n * @see `Ordinal['_ordinalNumbersByTick']`\n */\n\n\n OrdinalScale.prototype.setSortInfo = function (info) {\n if (info == null) {\n this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\n return;\n }\n\n var infoOrdinalNumbers = info.ordinalNumbers;\n var ordinalsByTick = this._ordinalNumbersByTick = [];\n var ticksByOrdinal = this._ticksByOrdinalNumber = []; // Unnecessary support negative tick in `realtimeSort`.\n\n var tickNum = 0;\n var allCategoryLen = this._ordinalMeta.categories.length;\n\n for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\n var ordinalNumber = infoOrdinalNumbers[tickNum];\n ordinalsByTick[tickNum] = ordinalNumber;\n ticksByOrdinal[ordinalNumber] = tickNum;\n } // Handle that `series.data` only covers part of the `axis.category.data`.\n\n\n var unusedOrdinal = 0;\n\n for (; tickNum < allCategoryLen; ++tickNum) {\n while (ticksByOrdinal[unusedOrdinal] != null) {\n unusedOrdinal++;\n }\n\n ;\n ordinalsByTick.push(unusedOrdinal);\n ticksByOrdinal[unusedOrdinal] = tickNum;\n }\n };\n\n OrdinalScale.prototype._getTickNumber = function (ordinal) {\n var ticksByOrdinalNumber = this._ticksByOrdinalNumber; // also support ordinal out of range of `ordinalMeta.categories.length`,\n // where ordinal numbers are used as tick value directly.\n\n return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;\n };\n /**\n * @usage\n * ```js\n * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\n *\n * // case0\n * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\n * // case1\n * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\n * // case2\n * const coord = axis.dataToCoord(ordinalNumber);\n * ```\n *\n * @param {OrdinalNumber} tickNumber index of display\n */\n\n\n OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) {\n var ordinalNumbersByTick = this._ordinalNumbersByTick; // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\n // where ordinal numbers are used as tick value directly.\n\n return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;\n };\n /**\n * Get item on tick\n */\n\n\n OrdinalScale.prototype.getLabel = function (tick) {\n if (!this.isBlank()) {\n var ordinalNumber = this.getRawOrdinalNumber(tick.value);\n var cateogry = this._ordinalMeta.categories[ordinalNumber]; // Note that if no data, ordinalMeta.categories is an empty array.\n // Return empty if it's not exist.\n\n return cateogry == null ? '' : cateogry + '';\n }\n };\n\n OrdinalScale.prototype.count = function () {\n return this._extent[1] - this._extent[0] + 1;\n };\n\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * @override\n * If value is in extent range\n */\n\n\n OrdinalScale.prototype.isInExtentRange = function (value) {\n value = this._getTickNumber(value);\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n\n OrdinalScale.prototype.getOrdinalMeta = function () {\n return this._ordinalMeta;\n };\n\n OrdinalScale.prototype.niceTicks = function () {};\n\n OrdinalScale.prototype.niceExtent = function () {};\n\n OrdinalScale.type = 'ordinal';\n return OrdinalScale;\n}(Scale);\n\nScale.registerClass(OrdinalScale);\nexport default OrdinalScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number';\nimport * as formatUtil from '../util/format';\nimport Scale from './Scale';\nimport * as helper from './helper';\nvar roundNumber = numberUtil.round;\n\nvar IntervalScale =\n/** @class */\nfunction (_super) {\n __extends(IntervalScale, _super);\n\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'interval'; // Step is calculated in adjustExtent.\n\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent; // start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n this.setExtent(extent[0], extent[1]);\n };\n\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user setted extent\n // We assume user wan't to set both interval, min, max to get a better result\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\n */\n\n\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n }); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n\n return ticks;\n };\n\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n };\n /**\n * @param opt.precision If 'auto', use nice presision.\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\n */\n\n\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecisionSafe(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\n * @param splitNumber By default `5`.\n */\n\n\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n\n IntervalScale.prototype.niceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n var expandSize = extent[0]; // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\n\nScale.registerClass(IntervalScale);\nexport default IntervalScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/*\n* A third-party license is embeded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design have\n// concidered these common case:\n// (1) Time that is persistent in server is in UTC, but it is needed to be diplayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\n\nimport * as numberUtil from '../util/number';\nimport { ONE_SECOND, ONE_MINUTE, ONE_HOUR, ONE_DAY, ONE_YEAR, format, leveledFormat, getUnitValue, timeUnits, fullLeveledFormatter, getPrimaryTimeUnit, isPrimaryTimeUnit, getDefaultFormatPrecisionOfInterval, fullYearGetterName, monthSetterName, fullYearSetterName, dateSetterName, hoursGetterName, hoursSetterName, minutesSetterName, secondsSetterName, millisecondsSetterName, monthGetterName, dateGetterName, minutesGetterName, secondsGetterName, millisecondsGetterName } from '../util/time';\nimport * as scaleHelper from './helper';\nimport IntervalScale from './Interval';\nimport Scale from './Scale';\nimport { warn } from '../util/log';\nimport { filter, map } from 'zrender/lib/core/util'; // FIXME 公用?\n\nvar bisect = function (a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n\n if (a[mid][1] < x) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n return lo;\n};\n\nvar TimeScale =\n/** @class */\nfunction (_super) {\n __extends(TimeScale, _super);\n\n function TimeScale(settings) {\n var _this = _super.call(this, settings) || this;\n\n _this.type = 'time';\n return _this;\n }\n /**\n * Get label is mainly for other components like dataZoom, tooltip.\n */\n\n\n TimeScale.prototype.getLabel = function (tick) {\n var useUTC = this.getSetting('useUTC');\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\n };\n\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\n var isUTC = this.getSetting('useUTC');\n var lang = this.getSetting('locale');\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\n };\n /**\n * @override\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\n */\n\n\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n }\n\n ticks.push({\n value: extent[0],\n level: 0\n });\n var useUTC = this.getSetting('useUTC');\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\n ticks = ticks.concat(innerTicks);\n ticks.push({\n value: extent[1],\n level: 0\n });\n return ticks;\n };\n\n TimeScale.prototype.niceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n // Expand extent\n extent[0] -= ONE_DAY;\n extent[1] += ONE_DAY;\n } // If there are no data and extent are [Infinity, -Infinity]\n\n\n if (extent[1] === -Infinity && extent[0] === Infinity) {\n var d = new Date();\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n extent[0] = extent[1] - ONE_DAY;\n }\n\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n };\n\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n this._approxInterval = span / approxTickNum;\n\n if (minInterval != null && this._approxInterval < minInterval) {\n this._approxInterval = minInterval;\n }\n\n if (maxInterval != null && this._approxInterval > maxInterval) {\n this._approxInterval = maxInterval;\n }\n\n var scaleIntervalsLen = scaleIntervals.length;\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); // Interval that can be used to calculate ticks\n\n this._interval = scaleIntervals[idx][1]; // Min level used when picking ticks from top down.\n // We check one more level to avoid the ticks are to sparse in some case.\n\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\n };\n\n TimeScale.prototype.parse = function (val) {\n // val might be float.\n return typeof val === 'number' ? val : +numberUtil.parseDate(val);\n };\n\n TimeScale.prototype.contain = function (val) {\n return scaleHelper.contain(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.normalize = function (val) {\n return scaleHelper.normalize(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.scale = function (val) {\n return scaleHelper.scale(val, this._extent);\n };\n\n TimeScale.type = 'time';\n return TimeScale;\n}(IntervalScale);\n/**\n * This implementation was originally copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/time/scale.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\n\nvar scaleIntervals = [// Format interval\n['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y\n];\n\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\n var dateA = numberUtil.parseDate(valueA);\n var dateB = numberUtil.parseDate(valueB);\n\n var isSame = function (unit) {\n return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC);\n };\n\n var isSameYear = function () {\n return isSame('year');\n }; // const isSameHalfYear = () => isSameYear() && isSame('half-year');\n // const isSameQuater = () => isSameYear() && isSame('quarter');\n\n\n var isSameMonth = function () {\n return isSameYear() && isSame('month');\n };\n\n var isSameDay = function () {\n return isSameMonth() && isSame('day');\n }; // const isSameHalfDay = () => isSameDay() && isSame('half-day');\n\n\n var isSameHour = function () {\n return isSameDay() && isSame('hour');\n };\n\n var isSameMinute = function () {\n return isSameHour() && isSame('minute');\n };\n\n var isSameSecond = function () {\n return isSameMinute() && isSame('second');\n };\n\n var isSameMilliSecond = function () {\n return isSameSecond() && isSame('millisecond');\n };\n\n switch (unit) {\n case 'year':\n return isSameYear();\n\n case 'month':\n return isSameMonth();\n\n case 'day':\n return isSameDay();\n\n case 'hour':\n return isSameHour();\n\n case 'minute':\n return isSameMinute();\n\n case 'second':\n return isSameSecond();\n\n case 'millisecond':\n return isSameMilliSecond();\n }\n} // const primaryUnitGetters = {\n// year: fullYearGetterName(),\n// month: monthGetterName(),\n// day: dateGetterName(),\n// hour: hoursGetterName(),\n// minute: minutesGetterName(),\n// second: secondsGetterName(),\n// millisecond: millisecondsGetterName()\n// };\n// const primaryUnitUTCGetters = {\n// year: fullYearGetterName(true),\n// month: monthGetterName(true),\n// day: dateGetterName(true),\n// hour: hoursGetterName(true),\n// minute: minutesGetterName(true),\n// second: secondsGetterName(true),\n// millisecond: millisecondsGetterName(true)\n// };\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\n// step = step || 1;\n// switch (getPrimaryTimeUnit(unitName)) {\n// case 'year':\n// date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\n// break;\n// case 'month':\n// date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\n// break;\n// case 'day':\n// date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\n// break;\n// case 'hour':\n// date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\n// break;\n// case 'minute':\n// date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\n// break;\n// case 'second':\n// date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\n// break;\n// case 'millisecond':\n// date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\n// break;\n// }\n// return date.getTime();\n// }\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\n\n\nfunction getDateInterval(approxInterval, daysInMonth) {\n approxInterval /= ONE_DAY;\n return approxInterval > 16 ? 16 // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick betwen two month.\n : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\n : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;\n}\n\nfunction getMonthInterval(approxInterval) {\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\n approxInterval /= APPROX_ONE_MONTH;\n return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getHourInterval(approxInterval) {\n approxInterval /= ONE_HOUR;\n return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\n return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMillisecondsInterval(approxInterval) {\n return numberUtil.nice(approxInterval, true);\n}\n\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\n var outDate = new Date(date);\n\n switch (getPrimaryTimeUnit(unitName)) {\n case 'year':\n case 'month':\n outDate[monthSetterName(isUTC)](0);\n\n case 'day':\n outDate[dateSetterName(isUTC)](1);\n\n case 'hour':\n outDate[hoursSetterName(isUTC)](0);\n\n case 'minute':\n outDate[minutesSetterName(isUTC)](0);\n\n case 'second':\n outDate[secondsSetterName(isUTC)](0);\n outDate[millisecondsSetterName(isUTC)](0);\n }\n\n return outDate.getTime();\n}\n\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\n var safeLimit = 10000;\n var unitNames = timeUnits;\n var iter = 0;\n\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\n var date = new Date(minTimestamp);\n var dateTime = minTimestamp;\n var d = date[getMethodName](); // if (isDate) {\n // d -= 1; // Starts with 0; PENDING\n // }\n\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\n out.push({\n value: dateTime\n });\n d += interval;\n date[setMethodName](d);\n dateTime = date.getTime();\n } // This extra tick is for calcuating ticks of next level. Will not been added to the final result\n\n\n out.push({\n value: dateTime,\n notAdd: true\n });\n }\n\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\n var newAddedTicks = [];\n var isFirstLevel = !lastLevelTicks.length;\n\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\n return;\n }\n\n if (isFirstLevel) {\n lastLevelTicks = [{\n // TODO Optimize. Not include so may ticks.\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\n }, {\n value: extent[1]\n }];\n }\n\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\n var startTick = lastLevelTicks[i].value;\n var endTick = lastLevelTicks[i + 1].value;\n\n if (startTick === endTick) {\n continue;\n }\n\n var interval = void 0;\n var getterName = void 0;\n var setterName = void 0;\n var isDate = false;\n\n switch (unitName) {\n case 'year':\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\n getterName = fullYearGetterName(isUTC);\n setterName = fullYearSetterName(isUTC);\n break;\n\n case 'half-year':\n case 'quarter':\n case 'month':\n interval = getMonthInterval(approxInterval);\n getterName = monthGetterName(isUTC);\n setterName = monthSetterName(isUTC);\n break;\n\n case 'week': // PENDING If week is added. Ignore day.\n\n case 'half-week':\n case 'day':\n interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\n\n getterName = dateGetterName(isUTC);\n setterName = dateSetterName(isUTC);\n isDate = true;\n break;\n\n case 'half-day':\n case 'quarter-day':\n case 'hour':\n interval = getHourInterval(approxInterval);\n getterName = hoursGetterName(isUTC);\n setterName = hoursSetterName(isUTC);\n break;\n\n case 'minute':\n interval = getMinutesAndSecondsInterval(approxInterval, true);\n getterName = minutesGetterName(isUTC);\n setterName = minutesSetterName(isUTC);\n break;\n\n case 'second':\n interval = getMinutesAndSecondsInterval(approxInterval, false);\n getterName = secondsGetterName(isUTC);\n setterName = secondsSetterName(isUTC);\n break;\n\n case 'millisecond':\n interval = getMillisecondsInterval(approxInterval);\n getterName = millisecondsGetterName(isUTC);\n setterName = millisecondsSetterName(isUTC);\n break;\n }\n\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\n\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\n // Add nearest years to the left extent.\n levelTicks.unshift({\n value: levelTicks[0].value - interval\n });\n }\n }\n\n for (var i = 0; i < newAddedTicks.length; i++) {\n levelTicks.push(newAddedTicks[i]);\n } // newAddedTicks.length && console.log(unitName, newAddedTicks);\n\n\n return newAddedTicks;\n }\n\n var levelsTicks = [];\n var currentLevelTicks = [];\n var tickCount = 0;\n var lastLevelTickCount = 0;\n\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\n\n if (!isPrimaryTimeUnit(unitNames[i])) {\n // TODO\n continue;\n }\n\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\n\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\n if (currentLevelTicks.length) {\n lastLevelTickCount = tickCount; // Remove the duplicate so the tick count can be precisely.\n\n currentLevelTicks.sort(function (a, b) {\n return a.value - b.value;\n });\n var levelTicksRemoveDuplicated = [];\n\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\n var tickValue = currentLevelTicks[i_1].value;\n\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\n\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\n tickCount++;\n }\n }\n }\n\n var targetTickNum = (extent[1] - extent[0]) / approxInterval; // Added too much in this level and not too less in last level\n\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\n break;\n } // Only treat primary time unit as one level.\n\n\n levelsTicks.push(levelTicksRemoveDuplicated);\n\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\n break;\n }\n } // Reset if next unitName is primary\n\n\n currentLevelTicks = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (iter >= safeLimit) {\n warn('Exceed safe limit.');\n }\n }\n\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\n return filter(levelTicks, function (tick) {\n return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd;\n });\n }), function (levelTicks) {\n return levelTicks.length > 0;\n });\n var ticks = [];\n var maxLevel = levelsTicksInExtent.length - 1;\n\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\n var levelTicks = levelsTicksInExtent[i];\n\n for (var k = 0; k < levelTicks.length; ++k) {\n ticks.push({\n value: levelTicks[k].value,\n level: maxLevel - i\n });\n }\n }\n\n ticks.sort(function (a, b) {\n return a.value - b.value;\n }); // Remove duplicates\n\n var result = [];\n\n for (var i = 0; i < ticks.length; ++i) {\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\n result.push(ticks[i]);\n }\n }\n\n return result;\n}\n\nScale.registerClass(TimeScale);\nexport default TimeScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Scale from './Scale';\nimport * as numberUtil from '../util/number';\nimport * as scaleHelper from './helper'; // Use some method of IntervalScale\n\nimport IntervalScale from './Interval';\nvar scaleProto = Scale.prototype; // FIXME:TS refactor: not good to call it directly with `this`?\n\nvar intervalScaleProto = IntervalScale.prototype;\nvar getPrecisionSafe = numberUtil.getPrecisionSafe;\nvar roundingErrorFix = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\n\nvar LogScale =\n/** @class */\nfunction (_super) {\n __extends(LogScale, _super);\n\n function LogScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'log';\n _this.base = 10;\n _this._originalScale = new IntervalScale(); // FIXME:TS actually used by `IntervalScale`\n\n _this._interval = 0;\n return _this;\n }\n /**\n * @param Whether expand the ticks to niced extent.\n */\n\n\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\n var originalScale = this._originalScale;\n var extent = this._extent;\n var originalExtent = originalScale.getExtent();\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\n return zrUtil.map(ticks, function (tick) {\n var val = tick.value;\n var powVal = numberUtil.round(mathPow(this.base, val)); // Fix #4158\n\n powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;\n powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;\n return {\n value: powVal\n };\n }, this);\n };\n\n LogScale.prototype.setExtent = function (start, end) {\n var base = this.base;\n start = mathLog(start) / mathLog(base);\n end = mathLog(end) / mathLog(base);\n intervalScaleProto.setExtent.call(this, start, end);\n };\n /**\n * @return {number} end\n */\n\n\n LogScale.prototype.getExtent = function () {\n var base = this.base;\n var extent = scaleProto.getExtent.call(this);\n extent[0] = mathPow(base, extent[0]);\n extent[1] = mathPow(base, extent[1]); // Fix #4158\n\n var originalScale = this._originalScale;\n var originalExtent = originalScale.getExtent();\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n return extent;\n };\n\n LogScale.prototype.unionExtent = function (extent) {\n this._originalScale.unionExtent(extent);\n\n var base = this.base;\n extent[0] = mathLog(extent[0]) / mathLog(base);\n extent[1] = mathLog(extent[1]) / mathLog(base);\n scaleProto.unionExtent.call(this, extent);\n };\n\n LogScale.prototype.unionExtentFromData = function (data, dim) {\n // TODO\n // filter value that <= 0\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * Update interval and extent of intervals for nice ticks\n * @param approxTickNum default 10 Given approx tick number\n */\n\n\n LogScale.prototype.niceTicks = function (approxTickNum) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (span === Infinity || span <= 0) {\n return;\n }\n\n var interval = numberUtil.quantity(span);\n var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count.\n\n if (err <= 0.5) {\n interval *= 10;\n } // Interval should be integer\n\n\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n interval *= 10;\n }\n\n var niceExtent = [numberUtil.round(mathCeil(extent[0] / interval) * interval), numberUtil.round(mathFloor(extent[1] / interval) * interval)];\n this._interval = interval;\n this._niceExtent = niceExtent;\n };\n\n LogScale.prototype.niceExtent = function (opt) {\n intervalScaleProto.niceExtent.call(this, opt);\n this._fixMin = opt.fixMin;\n this._fixMax = opt.fixMax;\n };\n\n LogScale.prototype.parse = function (val) {\n return val;\n };\n\n LogScale.prototype.contain = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.contain(val, this._extent);\n };\n\n LogScale.prototype.normalize = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.normalize(val, this._extent);\n };\n\n LogScale.prototype.scale = function (val) {\n val = scaleHelper.scale(val, this._extent);\n return mathPow(this.base, val);\n };\n\n LogScale.type = 'log';\n return LogScale;\n}(Scale);\n\nvar proto = LogScale.prototype;\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\nproto.getLabel = intervalScaleProto.getLabel;\n\nfunction fixRoundingError(val, originalVal) {\n return roundingErrorFix(val, getPrecisionSafe(originalVal));\n}\n\nScale.registerClass(LogScale);\nexport default LogScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util';\nimport { parsePercent } from 'zrender/lib/contain/text';\n\nvar ScaleRawExtentInfo =\n/** @class */\nfunction () {\n function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\n originalExtent) {\n this._prepareParams(scale, model, originalExtent);\n }\n /**\n * Parameters depending on ouside (like model, user callback)\n * are prepared and fixed here.\n */\n\n\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis.\n dataExtent) {\n if (dataExtent[1] < dataExtent[0]) {\n dataExtent = [NaN, NaN];\n }\n\n this._dataMin = dataExtent[0];\n this._dataMax = dataExtent[1];\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\n\n if (isFunction(modelMinRaw)) {\n // This callback alway provide users the full data extent (before data filtered).\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMinRaw !== 'dataMin') {\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n }\n\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n\n if (isFunction(modelMaxRaw)) {\n // This callback alway provide users the full data extent (before data filtered).\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMaxRaw !== 'dataMax') {\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n }\n\n if (isOrdinal) {\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n // and progressive rendering is using, here the category result might just only contain\n // the processed chunk rather than the entire result.\n this._axisDataLen = model.getCategories().length;\n } else {\n var boundaryGap = model.get('boundaryGap');\n var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., \"20%\". Currently, ' + 'boundaryGap is set to be 0.');\n }\n\n this._boundaryGapInner = [0, 0];\n } else {\n this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n }\n }\n };\n /**\n * Calculate extent by prepared parameters.\n * This method has no external dependency and can be called duplicatedly,\n * getting the same result.\n * If parameters changed, should call this method to recalcuate.\n */\n\n\n ScaleRawExtentInfo.prototype.calculate = function () {\n // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n var isOrdinal = this._isOrdinal;\n var dataMin = this._dataMin;\n var dataMax = this._dataMax;\n var axisDataLen = this._axisDataLen;\n var boundaryGapInner = this._boundaryGapInner;\n var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n\n var minFixed = min != null;\n var maxFixed = max != null;\n\n if (min == null) {\n min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n }\n\n if (max == null) {\n max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n\n if (min > max) {\n min = NaN;\n max = NaN;\n }\n\n var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero.\n\n if (this._needCrossZero) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !minFixed) {\n min = 0; // minFixed = true;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !maxFixed) {\n max = 0; // maxFixed = true;\n } // PENDING:\n // When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n // If so, here `minFixed`/`maxFixed` need to be set.\n\n }\n\n var determinedMin = this._determinedMin;\n var determinedMax = this._determinedMax;\n\n if (determinedMin != null) {\n min = determinedMin;\n minFixed = true;\n }\n\n if (determinedMax != null) {\n max = determinedMax;\n maxFixed = true;\n } // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n // `NaN` means min/max axis is blank.\n\n\n return {\n min: min,\n max: max,\n minFixed: minFixed,\n maxFixed: maxFixed,\n isBlank: isBlank\n };\n };\n\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen);\n }\n\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n };\n\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen // Earse them usually means logic flaw.\n && this[attr] == null);\n }\n\n this[attr] = val;\n };\n\n ScaleRawExtentInfo.prototype.freeze = function () {\n // @ts-ignore\n this.frozen = true;\n };\n\n return ScaleRawExtentInfo;\n}();\n\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n min: '_determinedMin',\n max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n min: '_dataMin',\n max: '_dataMax'\n};\n/**\n * Get scale min max and related info only depends on model settings.\n * This method can be called after coordinate system created.\n * For example, in data processing stage.\n *\n * Scale extent info probably be required multiple times during a workflow.\n * For example:\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\n * (3) `coordSys.update` use it to finally decide the scale extent.\n * But the callback of `min`/`max` should not be called multiple times.\n * The code below should not be implemented repeatedly either.\n * So we cache the result in the scale instance, which will be recreated at the begining\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\n */\n\nexport function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport OrdinalScale from '../scale/Ordinal';\nimport IntervalScale from '../scale/Interval';\nimport Scale from '../scale/Scale';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport TimeScale from '../scale/Time';\nimport LogScale from '../scale/Log';\nimport { getStackedDimension } from '../data/helper/dataStackHelper';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo';\n/**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n *\n * Caution:\n * Precondition of calling this method:\n * The scale extent has been initialized using series data extent via\n * `scale.setExtent` or `scale.unionExtentFromData`;\n */\n\nexport function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, // Only support cartesian coord yet.\nbarWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow\n\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow\n\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n} // Precondition of calling this method:\n// The scale extent has been initailized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\n\n\nexport function niceScaleExtent(scale, model) {\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale instanceof LogScale) {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n scale.setExtent(extent[0], extent[1]);\n scale.niceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null,\n maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n var interval = model.get('interval');\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\n * @param axisType Default retrieve from model.type\n */\n\nexport function createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // case 'value'/'interval', 'log', or others.\n return new (Scale.getClass(axisType) || IntervalScale)();\n }\n }\n}\n/**\n * Check if the axis cross 0\n */\n\nexport function ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\n * @param axis\n * @return Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not required.\n * return: {string} label string.\n */\n\nexport function makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (axis.scale.type === 'time') {\n return function (tpl) {\n return function (tick, idx) {\n return axis.scale.getFormattedLabel(tick, idx, tpl);\n };\n }(labelFormatter);\n } else if (typeof labelFormatter === 'string') {\n return function (tpl) {\n return function (tick) {\n // For category axis, get raw value; for numeric axis,\n // get formatted label like '1,333,444'.\n var label = axis.scale.getLabel(tick);\n var text = tpl.replace('{value}', label != null ? label : '');\n return text;\n };\n }(labelFormatter);\n } else if (typeof labelFormatter === 'function') {\n return function (cb) {\n return function (tick, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tick.value - categoryTickStart;\n }\n\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\n level: tick.level\n } : null);\n };\n }(labelFormatter);\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\nexport function getAxisRawValue(axis, tick) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\n * @param axis\n * @return Be null/undefined if no labels.\n */\n\nexport function estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n return;\n }\n\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (scale instanceof OrdinalScale) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1; // Simple optimization for large amount of labels\n\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n\n for (var i = 0; i < tickCount; i += step) {\n var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n value: categoryScaleExtent[0] + i\n };\n var label = labelFormatter(tick, i);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n\n return rect;\n}\n\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var beforeWidth = textRect.width;\n var beforeHeight = textRect.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\n * @param model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\n\n\nexport function getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\n * Set `categoryInterval` as 0 implicitly indicates that\n * show all labels reguardless of overlap.\n * @param {Object} axis axisModel.axis\n */\n\nexport function shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\n var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n // there has been stacked result dim?\n\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n // For example, the extent of the original dimension\n // is [0.1, 0.5], the extent of the `stackResultDimension`\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\n // because there is no graphic corresponding to [0.1, 0.5].\n // See the case in `test/area-stack.html` `main1`, where area line\n // stack needs `yAxis` not start from 0.\n dataDimMap[getStackedDimension(data, dataDim)] = true;\n });\n return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n if (data) {\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n var seriesExtent = data.getApproximateExtent(dim);\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nvar Cartesian =\n/** @class */\nfunction () {\n function Cartesian(name) {\n this.type = 'cartesian';\n this._dimList = [];\n this._axes = {};\n this.name = name || '';\n }\n\n Cartesian.prototype.getAxis = function (dim) {\n return this._axes[dim];\n };\n\n Cartesian.prototype.getAxes = function () {\n return zrUtil.map(this._dimList, function (dim) {\n return this._axes[dim];\n }, this);\n };\n\n Cartesian.prototype.getAxesByScale = function (scaleType) {\n scaleType = scaleType.toLowerCase();\n return zrUtil.filter(this.getAxes(), function (axis) {\n return axis.scale.type === scaleType;\n });\n };\n\n Cartesian.prototype.addAxis = function (axis) {\n var dim = axis.dim;\n this._axes[dim] = axis;\n\n this._dimList.push(dim);\n };\n\n return Cartesian;\n}();\n\n;\nexport default Cartesian;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport Cartesian from './Cartesian';\nimport { invert } from 'zrender/lib/core/matrix';\nimport { applyTransform } from 'zrender/lib/core/vector';\nexport var cartesian2DDimensions = ['x', 'y'];\n\nfunction canCalculateAffineTransform(scale) {\n return scale.type === 'interval' || scale.type === 'time';\n}\n\nvar Cartesian2D =\n/** @class */\nfunction (_super) {\n __extends(Cartesian2D, _super);\n\n function Cartesian2D() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'cartesian2d';\n _this.dimensions = cartesian2DDimensions;\n return _this;\n }\n /**\n * Calculate an affine transform matrix if two axes are time or value.\n * It's mainly for accelartion on the large time series data.\n */\n\n\n Cartesian2D.prototype.calcAffineTransform = function () {\n this._transform = this._invTransform = null;\n var xAxisScale = this.getAxis('x').scale;\n var yAxisScale = this.getAxis('y').scale;\n\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n return;\n }\n\n var xScaleExtent = xAxisScale.getExtent();\n var yScaleExtent = yAxisScale.getExtent();\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n\n if (!xScaleSpan || !yScaleSpan) {\n return;\n } // Accelerate data to point calculation on the special large time series data.\n\n\n var scaleX = (end[0] - start[0]) / xScaleSpan;\n var scaleY = (end[1] - start[1]) / yScaleSpan;\n var translateX = start[0] - xScaleExtent[0] * scaleX;\n var translateY = start[1] - yScaleExtent[0] * scaleY;\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n this._invTransform = invert([], m);\n };\n /**\n * Base axis will be used on stacking.\n */\n\n\n Cartesian2D.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n };\n\n Cartesian2D.prototype.containPoint = function (point) {\n var axisX = this.getAxis('x');\n var axisY = this.getAxis('y');\n return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n };\n\n Cartesian2D.prototype.containData = function (data) {\n return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n };\n\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\n out = out || [];\n var xVal = data[0];\n var yVal = data[1]; // Fast path\n\n if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n return applyTransform(out, data, this._transform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\n return out;\n };\n\n Cartesian2D.prototype.clampData = function (data, out) {\n var xScale = this.getAxis('x').scale;\n var yScale = this.getAxis('y').scale;\n var xAxisExtent = xScale.getExtent();\n var yAxisExtent = yScale.getExtent();\n var x = xScale.parse(data[0]);\n var y = yScale.parse(data[1]);\n out = out || [];\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n return out;\n };\n\n Cartesian2D.prototype.pointToData = function (point, out) {\n out = out || [];\n\n if (this._invTransform) {\n return applyTransform(out, point, this._invTransform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\n return out;\n };\n\n Cartesian2D.prototype.getOtherAxis = function (axis) {\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n };\n /**\n * Get rect area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n\n\n Cartesian2D.prototype.getArea = function () {\n var xExtent = this.getAxis('x').getGlobalExtent();\n var yExtent = this.getAxis('y').getGlobalExtent();\n var x = Math.min(xExtent[0], xExtent[1]);\n var y = Math.min(yExtent[0], yExtent[1]);\n var width = Math.max(xExtent[0], xExtent[1]) - x;\n var height = Math.max(yExtent[0], yExtent[1]) - y;\n return new BoundingRect(x, y, width, height);\n };\n\n return Cartesian2D;\n}(Cartesian);\n\n;\nexport default Cartesian2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as textContain from 'zrender/lib/contain/text';\nimport { makeInner } from '../util/model';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper';\nvar inner = makeInner();\nexport function createAxisLabels(axis) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.<number>\n * tickCategoryInterval: number\n * }\n */\n\nexport function createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: zrUtil.map(axis.scale.getTicks(), function (tick) {\n return tick.value;\n })\n };\n}\n\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\n\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n\n if (result) {\n return result;\n }\n\n var labels;\n var numericLabelInterval;\n\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\n\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n\n if (result) {\n return result;\n }\n\n var ticks;\n var tickCategoryInterval; // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n } // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\n\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tick, idx) {\n return {\n formattedLabel: labelFormatter(tick, idx),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: tick.value\n };\n })\n };\n}\n\nfunction getListCache(axis, prop) {\n // Because key can be funciton, and cache size always be small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\n\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\n\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\n\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\n * Calculate interval for category axis ticks and labels.\n * To get precise result, at least one of `getRotate` and `isHorizontal`\n * should be implemented in axis.\n */\n\n\nexport function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}\n\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\n\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n } // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n\n\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n } // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n\n\n var tickValue = startTick;\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n\n function addItem(tickValue) {\n var tickObj = {\n value: tickValue\n };\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickObj),\n rawLabel: ordinalScale.getLabel(tickObj),\n tickValue: tickValue\n });\n }\n\n return result;\n}\n\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\n var rawLabel = ordinalScale.getLabel(tick);\n var tickValue = tick.value;\n\n if (categoryInterval(tick.value, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tick),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map } from 'zrender/lib/core/util';\nimport { linearMap, getPixelPrecision, round } from '../util/number';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval } from './axisTickLabelBuilder';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n */\n\nvar Axis =\n/** @class */\nfunction () {\n function Axis(dim, scale, extent) {\n this.onBand = false;\n this.inverse = false;\n this.dim = dim;\n this.scale = scale;\n this._extent = extent || [0, 0];\n }\n /**\n * If axis extent contain given coord\n */\n\n\n Axis.prototype.contain = function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n };\n /**\n * If axis extent contain given data\n */\n\n\n Axis.prototype.containData = function (data) {\n return this.scale.contain(data);\n };\n /**\n * Get coord extent.\n */\n\n\n Axis.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\n * Get precision used for formatting\n */\n\n\n Axis.prototype.getPixelPrecision = function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n };\n /**\n * Set coord extent\n */\n\n\n Axis.prototype.setExtent = function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n };\n /**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n */\n\n\n Axis.prototype.dataToCoord = function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n };\n /**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n */\n\n\n Axis.prototype.coordToData = function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n };\n /**\n * Convert pixel point to data in axis\n */\n\n\n Axis.prototype.pointToData = function (point, clamp) {\n // Should be implemented in derived class if necessary.\n return;\n };\n /**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param opt.tickModel default: axis.model.getModel('axisTick')\n * @param opt.clamp If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n */\n\n\n Axis.prototype.getTicksCoords = function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickVal) {\n return {\n coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n tickValue: tickVal\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n };\n\n Axis.prototype.getMinorTicksCoords = function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber'); // Protection.\n\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n };\n\n Axis.prototype.getViewLabels = function () {\n return createAxisLabels(this).labels;\n };\n\n Axis.prototype.getLabelModel = function () {\n return this.model.getModel('axisLabel');\n };\n /**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overrided to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n */\n\n\n Axis.prototype.getTickModel = function () {\n return this.model.getModel('axisTick');\n };\n /**\n * Get width of band\n */\n\n\n Axis.prototype.getBandWidth = function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data.\n\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n };\n /**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return Auto interval for cateogry axis tick and label\n */\n\n\n Axis.prototype.calculateCategoryInterval = function () {\n return calculateCategoryInterval(this);\n };\n\n return Axis;\n}();\n\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n} // If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\n\n\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\n\nexport default Axis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar Axis2D =\n/** @class */\nfunction (_super) {\n __extends(Axis2D, _super);\n\n function Axis2D(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n /**\n * Index of axis, can be used as key\n * Injected outside.\n */\n\n\n _this.index = 0;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n\n Axis2D.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n /**\n * Each item cooresponds to this.getExtent(), which\n * means globalExtent[0] may greater than globalExtent[1],\n * unless `asc` is input.\n *\n * @param {boolean} [asc]\n * @return {Array.<number>}\n */\n\n\n Axis2D.prototype.getGlobalExtent = function (asc) {\n var ret = this.getExtent();\n ret[0] = this.toGlobalCoord(ret[0]);\n ret[1] = this.toGlobalCoord(ret[1]);\n asc && ret[0] > ret[1] && ret.reverse();\n return ret;\n };\n\n Axis2D.prototype.pointToData = function (point, clamp) {\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n };\n /**\n * Set ordinalSortInfo\n * @param info new OrdinalSortInfo\n */\n\n\n Axis2D.prototype.setCategorySortInfo = function (info) {\n if (this.type !== 'category') {\n return false;\n }\n\n this.model.option.categorySortInfo = info;\n this.scale.setSortInfo(info);\n };\n\n return Axis2D;\n}(Axis);\n\nexport default Axis2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */\nimport { isObject, each, indexOf, retrieve3 } from 'zrender/lib/core/util';\nimport { getLayoutRect } from '../../util/layout';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, estimateLabelUnionRect, getDataDimensionsOnAxis } from '../../coord/axisHelper';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D';\nimport Axis2D from './Axis2D';\nimport { SINGLE_REFERRING } from '../../util/model';\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper';\n\nvar Grid =\n/** @class */\nfunction () {\n function Grid(gridModel, ecModel, api) {\n // FIXME:TS where used (different from registered type 'cartesian2d')?\n this.type = 'grid';\n this._coordsMap = {};\n this._coordsList = [];\n this._axesMap = {};\n this._axesList = [];\n this.axisPointerEnabled = true;\n this.dimensions = cartesian2DDimensions;\n\n this._initCartesian(gridModel, ecModel, api);\n\n this.model = gridModel;\n }\n\n Grid.prototype.getRect = function () {\n return this._rect;\n };\n\n Grid.prototype.update = function (ecModel, api) {\n var axesMap = this._axesMap;\n\n this._updateScale(ecModel, this.model);\n\n each(axesMap.x, function (xAxis) {\n niceScaleExtent(xAxis.scale, xAxis.model);\n });\n each(axesMap.y, function (yAxis) {\n niceScaleExtent(yAxis.scale, yAxis.model);\n }); // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n\n var onZeroRecords = {};\n each(axesMap.x, function (xAxis) {\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n });\n each(axesMap.y, function (yAxis) {\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n }); // Resize again if containLabel is enabled\n // FIXME It may cause getting wrong grid size in data processing stage\n\n this.resize(this.model, api);\n };\n /**\n * Resize the grid\n */\n\n\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\n var boxLayoutParams = gridModel.getBoxLayoutParams();\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\n var gridRect = getLayoutRect(boxLayoutParams, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._rect = gridRect;\n var axesList = this._axesList;\n adjustAxes(); // Minus label size\n\n if (isContainLabel) {\n each(axesList, function (axis) {\n if (!axis.model.get(['axisLabel', 'inside'])) {\n var labelUnionRect = estimateLabelUnionRect(axis);\n\n if (labelUnionRect) {\n var dim = axis.isHorizontal() ? 'height' : 'width';\n var margin = axis.model.get(['axisLabel', 'margin']);\n gridRect[dim] -= labelUnionRect[dim] + margin;\n\n if (axis.position === 'top') {\n gridRect.y += labelUnionRect.height + margin;\n } else if (axis.position === 'left') {\n gridRect.x += labelUnionRect.width + margin;\n }\n }\n }\n });\n adjustAxes();\n }\n\n each(this._coordsList, function (coord) {\n // Calculate affine matrix to accelerate the data to point transform.\n // If all the axes scales are time or value.\n coord.calcAffineTransform();\n });\n\n function adjustAxes() {\n each(axesList, function (axis) {\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\n });\n }\n };\n\n Grid.prototype.getAxis = function (dim, axisIndex) {\n var axesMapOnDim = this._axesMap[dim];\n\n if (axesMapOnDim != null) {\n return axesMapOnDim[axisIndex || 0]; // if (axisIndex == null) {\n // Find first axis\n // for (let name in axesMapOnDim) {\n // if (axesMapOnDim.hasOwnProperty(name)) {\n // return axesMapOnDim[name];\n // }\n // }\n // }\n // return axesMapOnDim[axisIndex];\n }\n };\n\n Grid.prototype.getAxes = function () {\n return this._axesList.slice();\n };\n\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n if (xAxisIndex != null && yAxisIndex != null) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n return this._coordsMap[key];\n }\n\n if (isObject(xAxisIndex)) {\n yAxisIndex = xAxisIndex.yAxisIndex;\n xAxisIndex = xAxisIndex.xAxisIndex;\n }\n\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n return coordList[i];\n }\n }\n };\n\n Grid.prototype.getCartesians = function () {\n return this._coordsList.slice();\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n };\n\n Grid.prototype._findConvertTarget = function (finder) {\n var seriesModel = finder.seriesModel;\n var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n var gridModel = finder.gridModel;\n var coordsList = this._coordsList;\n var cartesian;\n var axis;\n\n if (seriesModel) {\n cartesian = seriesModel.coordinateSystem;\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n } else if (xAxisModel && yAxisModel) {\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n } else if (xAxisModel) {\n axis = this.getAxis('x', xAxisModel.componentIndex);\n } else if (yAxisModel) {\n axis = this.getAxis('y', yAxisModel.componentIndex);\n } // Lowest priority.\n else if (gridModel) {\n var grid = gridModel.coordinateSystem;\n\n if (grid === this) {\n cartesian = this._coordsList[0];\n }\n }\n\n return {\n cartesian: cartesian,\n axis: axis\n };\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.containPoint = function (point) {\n var coord = this._coordsList[0];\n\n if (coord) {\n return coord.containPoint(point);\n }\n };\n /**\n * Initialize cartesian coordinate systems\n */\n\n\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n var _this = this;\n\n var grid = this;\n var axisPositionUsed = {\n left: false,\n right: false,\n top: false,\n bottom: false\n };\n var axesMap = {\n x: {},\n y: {}\n };\n var axesCount = {\n x: 0,\n y: 0\n }; /// Create axis\n\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n\n if (!axesCount.x || !axesCount.y) {\n // Roll back when there no either x or y axis\n this._axesMap = {};\n this._axesList = [];\n return;\n }\n\n this._axesMap = axesMap; /// Create cartesian2d\n\n each(axesMap.x, function (xAxis, xAxisIndex) {\n each(axesMap.y, function (yAxis, yAxisIndex) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n var cartesian = new Cartesian2D(key);\n cartesian.master = _this;\n cartesian.model = gridModel;\n _this._coordsMap[key] = cartesian;\n\n _this._coordsList.push(cartesian);\n\n cartesian.addAxis(xAxis);\n cartesian.addAxis(yAxis);\n });\n });\n\n function createAxisCreator(dimName) {\n return function (axisModel, idx) {\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n return;\n }\n\n var axisPosition = axisModel.get('position');\n\n if (dimName === 'x') {\n // Fix position\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n // Default bottom of X\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n }\n } else {\n // Fix position\n if (axisPosition !== 'left' && axisPosition !== 'right') {\n // Default left of Y\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\n }\n }\n\n axisPositionUsed[axisPosition] = true;\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel\n\n axisModel.axis = axis; // Inject axisModel into axis\n\n axis.model = axisModel; // Inject grid info axis\n\n axis.grid = grid; // Index of axis, can be used as key\n\n axis.index = idx;\n\n grid._axesList.push(axis);\n\n axesMap[dimName][idx] = axis;\n axesCount[dimName]++;\n };\n }\n };\n /**\n * Update cartesian properties from series.\n */\n\n\n Grid.prototype._updateScale = function (ecModel, gridModel) {\n // Reset scale\n each(this._axesList, function (axis) {\n axis.scale.setExtent(Infinity, -Infinity);\n\n if (axis.type === 'category') {\n var categorySortInfo = axis.model.get('categorySortInfo');\n axis.scale.setSortInfo(categorySortInfo);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n if (isCartesian2DSeries(seriesModel)) {\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n return;\n }\n\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n var data = seriesModel.getData();\n var xAxis = cartesian.getAxis('x');\n var yAxis = cartesian.getAxis('y');\n\n if (data.type === 'list') {\n unionExtent(data, xAxis);\n unionExtent(data, yAxis);\n }\n }\n }, this);\n\n function unionExtent(data, axis) {\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n axis.scale.unionExtentFromData(data, dim);\n });\n }\n };\n /**\n * @param dim 'x' or 'y' or 'auto' or null/undefined\n */\n\n\n Grid.prototype.getTooltipAxes = function (dim) {\n var baseAxes = [];\n var otherAxes = [];\n each(this.getCartesians(), function (cartesian) {\n var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n var otherAxis = cartesian.getOtherAxis(baseAxis);\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n });\n return {\n baseAxes: baseAxes,\n otherAxes: otherAxes\n };\n };\n\n Grid.create = function (ecModel, api) {\n var grids = [];\n ecModel.eachComponent('grid', function (gridModel, idx) {\n var grid = new Grid(gridModel, ecModel, api);\n grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize\n // should be performed in create stage.\n\n grid.resize(gridModel, api, true);\n gridModel.coordinateSystem = grid;\n grids.push(grid);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (!isCartesian2DSeries(seriesModel)) {\n return;\n }\n\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n var gridModel = xAxisModel.getCoordSysModel();\n\n if (process.env.NODE_ENV !== 'production') {\n if (!gridModel) {\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n }\n\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n throw new Error('xAxis and yAxis must use the same grid');\n }\n }\n\n var grid = gridModel.coordinateSystem;\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n });\n return grids;\n }; // For deciding which dimensions to use when creating list data\n\n\n Grid.dimensions = cartesian2DDimensions;\n return Grid;\n}();\n/**\n * Check if the axis is used in the specified grid.\n */\n\n\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}\n\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n axis.getAxesOnZeroOf = function () {\n // TODO: onZero of multiple axes.\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n }; // onZero can not be enabled in these two situations:\n // 1. When any other axis is a category axis.\n // 2. When no axis is cross 0 point.\n\n\n var otherAxes = axesMap[otherAxisDim];\n var otherAxisOnZeroOf;\n var axisModel = axis.model;\n var onZero = axisModel.get(['axisLine', 'onZero']);\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n\n if (!onZero) {\n return;\n } // If target axis is specified.\n\n\n if (onZeroAxisIndex != null) {\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n }\n } else {\n // Find the first available other axis.\n for (var idx in otherAxes) {\n if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis,\n // if both onZero, the two Y axes overlap.\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n otherAxisOnZeroOf = otherAxes[idx];\n break;\n }\n }\n }\n\n if (otherAxisOnZeroOf) {\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n }\n\n function getOnZeroRecordKey(axis) {\n return axis.dim + '_' + axis.index;\n }\n}\n\nfunction canOnZeroToAxis(axis) {\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\n\nfunction updateAxisTransform(axis, coordBase) {\n var axisExtent = axis.getExtent();\n var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform\n\n axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n}\n\nexport default Grid;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieve, defaults, extend, each, isObject } from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport { createTextStyle } from '../../label/labelStyle';\nimport Model from '../../model/Model';\nimport { isRadianAroundZero, remRadian } from '../../util/number';\nimport { createSymbol } from '../../util/symbol';\nimport * as matrixUtil from 'zrender/lib/core/matrix';\nimport { applyTransform as v2ApplyTransform } from 'zrender/lib/core/vector';\nimport { shouldShowAllLabels } from '../../coord/axisHelper';\nvar PI = Math.PI;\n/**\n * A final axis is translated and rotated from a \"standard axis\".\n * So opt.position and opt.rotation is required.\n *\n * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],\n * for example: (0, 0) ------------> (0, 50)\n *\n * nameDirection or tickDirection or labelDirection is 1 means tick\n * or label is below the standard axis, whereas is -1 means above\n * the standard axis. labelOffset means offset between label and axis,\n * which is useful when 'onZero', where axisLabel is in the grid and\n * label in outside grid.\n *\n * Tips: like always,\n * positive rotation represents anticlockwise, and negative rotation\n * represents clockwise.\n * The direction of position coordinate is the same as the direction\n * of screen coordinate.\n *\n * Do not need to consider axis 'inverse', which is auto processed by\n * axis extent.\n */\n\nvar AxisBuilder =\n/** @class */\nfunction () {\n function AxisBuilder(axisModel, opt) {\n this.group = new graphic.Group();\n this.opt = opt;\n this.axisModel = axisModel; // Default value\n\n defaults(opt, {\n labelOffset: 0,\n nameDirection: 1,\n tickDirection: 1,\n labelDirection: 1,\n silent: true,\n handleAutoShown: function () {\n return true;\n }\n }); // FIXME Not use a seperate text group?\n\n var transformGroup = new graphic.Group({\n x: opt.position[0],\n y: opt.position[1],\n rotation: opt.rotation\n }); // this.group.add(transformGroup);\n // this._transformGroup = transformGroup;\n\n transformGroup.updateTransform();\n this._transformGroup = transformGroup;\n }\n\n AxisBuilder.prototype.hasBuilder = function (name) {\n return !!builders[name];\n };\n\n AxisBuilder.prototype.add = function (name) {\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\n };\n\n AxisBuilder.prototype.getGroup = function () {\n return this.group;\n };\n\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\n var rotationDiff = remRadian(textRotation - axisRotation);\n var textAlign;\n var textVerticalAlign;\n\n if (isRadianAroundZero(rotationDiff)) {\n // Label is parallel with axis line.\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI)) {\n // Label is inverse parallel with axis line.\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff > 0 && rotationDiff < PI) {\n textAlign = direction > 0 ? 'right' : 'left';\n } else {\n textAlign = direction > 0 ? 'left' : 'right';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n };\n\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\n var eventData = {\n componentType: axisModel.mainType,\n componentIndex: axisModel.componentIndex\n };\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\n return eventData;\n };\n\n AxisBuilder.isLabelSilent = function (axisModel) {\n var tooltipOpt = axisModel.get('tooltip');\n return axisModel.get('silent') // Consider mouse cursor, add these restrictions.\n || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);\n };\n\n return AxisBuilder;\n}();\n\n;\nvar builders = {\n axisLine: function (opt, axisModel, group, transformGroup) {\n var shown = axisModel.get(['axisLine', 'show']);\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisLine');\n }\n\n if (!shown) {\n return;\n }\n\n var extent = axisModel.axis.getExtent();\n var matrix = transformGroup.transform;\n var pt1 = [extent[0], 0];\n var pt2 = [extent[1], 0];\n\n if (matrix) {\n v2ApplyTransform(pt1, pt1, matrix);\n v2ApplyTransform(pt2, pt2, matrix);\n }\n\n var lineStyle = extend({\n lineCap: 'round'\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\n var line = new graphic.Line({\n // Id for animation\n subPixelOptimize: true,\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: lineStyle,\n strokeContainThreshold: opt.strokeContainThreshold || 5,\n silent: true,\n z2: 1\n });\n line.anid = 'line';\n group.add(line);\n var arrows = axisModel.get(['axisLine', 'symbol']);\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\n\n if (typeof arrowOffset === 'number') {\n arrowOffset = [arrowOffset, arrowOffset];\n }\n\n if (arrows != null) {\n if (typeof arrows === 'string') {\n // Use the same arrow for start and end point\n arrows = [arrows, arrows];\n }\n\n if (typeof arrowSize === 'string' || typeof arrowSize === 'number') {\n // Use the same size for width and height\n arrowSize = [arrowSize, arrowSize];\n }\n\n var symbolWidth_1 = arrowSize[0];\n var symbolHeight_1 = arrowSize[1];\n each([{\n rotate: opt.rotation + Math.PI / 2,\n offset: arrowOffset[0],\n r: 0\n }, {\n rotate: opt.rotation - Math.PI / 2,\n offset: arrowOffset[1],\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\n }], function (point, index) {\n if (arrows[index] !== 'none' && arrows[index] != null) {\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset\n\n var r = point.r + point.offset;\n symbol.attr({\n rotation: point.rotate,\n x: pt1[0] + r * Math.cos(opt.rotation),\n y: pt1[1] - r * Math.sin(opt.rotation),\n silent: true,\n z2: 11\n });\n group.add(symbol);\n }\n });\n }\n },\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\n },\n axisName: function (opt, axisModel, group, transformGroup) {\n var name = retrieve(opt.axisName, axisModel.get('name'));\n\n if (!name) {\n return;\n }\n\n var nameLocation = axisModel.get('nameLocation');\n var nameDirection = opt.nameDirection;\n var textStyleModel = axisModel.getModel('nameTextStyle');\n var gap = axisModel.get('nameGap') || 0;\n var extent = axisModel.axis.getExtent();\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\n var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // Reuse labelOffset.\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0];\n var labelLayout;\n var nameRotation = axisModel.get('nameRotate');\n\n if (nameRotation != null) {\n nameRotation = nameRotation * PI / 180; // To radian.\n }\n\n var axisNameAvailableWidth;\n\n if (isNameLocationCenter(nameLocation)) {\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis.\n nameDirection);\n } else {\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\n\n if (axisNameAvailableWidth != null) {\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\n }\n }\n\n var textFont = textStyleModel.getFont();\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\n var ellipsis = truncateOpt.ellipsis;\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\n var textEl = new graphic.Text({\n x: pos[0],\n y: pos[1],\n rotation: labelLayout.rotation,\n silent: AxisBuilder.isLabelSilent(axisModel),\n style: createTextStyle(textStyleModel, {\n text: name,\n font: textFont,\n overflow: 'truncate',\n width: maxWidth,\n ellipsis: ellipsis,\n fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']),\n align: textStyleModel.get('align') || labelLayout.textAlign,\n verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign\n }),\n z2: 1\n });\n graphic.setTooltipConfig({\n el: textEl,\n componentModel: axisModel,\n itemName: name\n });\n textEl.__fullText = name; // Id for animation\n\n textEl.anid = 'name';\n\n if (axisModel.get('triggerEvent')) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisName';\n eventData.name = name;\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n group.add(textEl);\n textEl.decomposeTransform();\n }\n};\n\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\n var rotationDiff = remRadian(textRotate - rotation);\n var textAlign;\n var textVerticalAlign;\n var inverse = extent[0] > extent[1];\n var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse;\n\n if (isRadianAroundZero(rotationDiff - PI / 2)) {\n textVerticalAlign = onLeft ? 'bottom' : 'top';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\n textVerticalAlign = onLeft ? 'top' : 'bottom';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\n textAlign = onLeft ? 'left' : 'right';\n } else {\n textAlign = onLeft ? 'right' : 'left';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\n\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\n if (shouldShowAllLabels(axisModel.axis)) {\n return;\n } // If min or max are user set, we need to check\n // If the tick on min(max) are overlap on their neighbour tick\n // If they are overlapped, we need to hide the min(max) tick label\n\n\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); // FIXME\n // Have not consider onBand yet, where tick els is more than label els.\n\n labelEls = labelEls || [];\n tickEls = tickEls || [];\n var firstLabel = labelEls[0];\n var nextLabel = labelEls[1];\n var lastLabel = labelEls[labelEls.length - 1];\n var prevLabel = labelEls[labelEls.length - 2];\n var firstTick = tickEls[0];\n var nextTick = tickEls[1];\n var lastTick = tickEls[tickEls.length - 1];\n var prevTick = tickEls[tickEls.length - 2];\n\n if (showMinLabel === false) {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\n if (showMinLabel) {\n ignoreEl(nextLabel);\n ignoreEl(nextTick);\n } else {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n }\n }\n\n if (showMaxLabel === false) {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\n if (showMaxLabel) {\n ignoreEl(prevLabel);\n ignoreEl(prevTick);\n } else {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n }\n }\n}\n\nfunction ignoreEl(el) {\n el && (el.ignore = true);\n}\n\nfunction isTwoLabelOverlapped(current, next) {\n // current and next has the same rotation.\n var firstRect = current && current.getBoundingRect().clone();\n var nextRect = next && next.getBoundingRect().clone();\n\n if (!firstRect || !nextRect) {\n return;\n } // When checking intersect of two rotated labels, we use mRotationBack\n // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\n\n\n var mRotationBack = matrixUtil.identity([]);\n matrixUtil.rotate(mRotationBack, mRotationBack, -current.rotation);\n firstRect.applyTransform(matrixUtil.mul([], mRotationBack, current.getLocalTransform()));\n nextRect.applyTransform(matrixUtil.mul([], mRotationBack, next.getLocalTransform()));\n return firstRect.intersect(nextRect);\n}\n\nfunction isNameLocationCenter(nameLocation) {\n return nameLocation === 'middle' || nameLocation === 'center';\n}\n\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\n var tickEls = [];\n var pt1 = [];\n var pt2 = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = ticksCoords[i].coord;\n pt1[0] = tickCoord;\n pt1[1] = 0;\n pt2[0] = tickCoord;\n pt2[1] = tickEndCoord;\n\n if (tickTransform) {\n v2ApplyTransform(pt1, pt1, tickTransform);\n v2ApplyTransform(pt2, pt2, tickTransform);\n } // Tick line, Not use group transform to have better line draw\n\n\n var tickEl = new graphic.Line({\n subPixelOptimize: true,\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: tickLineStyle,\n z2: 2,\n autoBatch: true,\n silent: true\n });\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\n tickEls.push(tickEl);\n }\n\n return tickEls;\n}\n\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var tickModel = axisModel.getModel('axisTick');\n var shown = tickModel.get('show');\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisTick');\n }\n\n if (!shown || axis.scale.isBlank()) {\n return;\n }\n\n var lineStyleModel = tickModel.getModel('lineStyle');\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\n var ticksCoords = axis.getTicksCoords();\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }), 'ticks');\n\n for (var i = 0; i < ticksEls.length; i++) {\n group.add(ticksEls[i]);\n }\n\n return ticksEls;\n}\n\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\n var axis = axisModel.axis;\n var minorTickModel = axisModel.getModel('minorTick');\n\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\n return;\n }\n\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var lineStyleModel = minorTickModel.getModel('lineStyle');\n var tickEndCoord = tickDirection * minorTickModel.get('length');\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }));\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\n\n for (var k = 0; k < minorTicksEls.length; k++) {\n group.add(minorTicksEls[k]);\n }\n }\n}\n\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\n\n if (!show || axis.scale.isBlank()) {\n return;\n }\n\n var labelModel = axisModel.getModel('axisLabel');\n var labelMargin = labelModel.get('margin');\n var labels = axis.getViewLabels(); // Special label rotate.\n\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\n var labelEls = [];\n var silent = AxisBuilder.isLabelSilent(axisModel);\n var triggerEvent = axisModel.get('triggerEvent');\n each(labels, function (labelItem, index) {\n var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n var formattedLabel = labelItem.formattedLabel;\n var rawLabel = labelItem.rawLabel;\n var itemLabelModel = labelModel;\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\n }\n }\n\n var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']);\n var tickCoord = axis.dataToCoord(tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: opt.labelOffset + opt.labelDirection * labelMargin,\n rotation: labelLayout.rotation,\n silent: silent,\n z2: 10,\n style: createTextStyle(itemLabelModel, {\n text: formattedLabel,\n align: itemLabelModel.getShallow('align', true) || labelLayout.textAlign,\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign,\n fill: typeof textColor === 'function' ? textColor( // (1) In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n // (2) Compatible with previous version, which always use formatted label as\n // input. But in interval scale the formatted label is like '223,445', which\n // maked user repalce ','. So we modify it to return original val but remain\n // it as 'string' to avoid error in replacing.\n axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor\n })\n });\n textEl.anid = 'label_' + tickValue; // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = rawLabel;\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n labelEls.push(textEl);\n group.add(textEl);\n textEl.decomposeTransform();\n });\n return labelEls;\n}\n\nexport default AxisBuilder;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../../model/Model';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util'; // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\n\nexport function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}\n\nfunction collectAxesInfo(result, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global.\n\n var linksOption = globalAxisPointerModel.get('link', true) || [];\n var linkGroups = []; // Collect axes info.\n\n each(api.getCoordinateSystems(), function (coordSys) {\n // Some coordinate system do not support axes, like geo.\n if (!coordSys.axisPointerEnabled) {\n return;\n }\n\n var coordSysKey = makeKey(coordSys.model);\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convienent way to show axisPointer\n // for user. So we enable seting tooltip on coordSys model.\n\n var coordSysModel = coordSys.model;\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys.\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n\n if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not\n // show but axisPointer will show as normal.\n && baseTooltipModel.get('show')) {\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n\n if (triggerAxis || cross) {\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n }\n\n if (cross) {\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n }\n } // fromTooltip: true | false | 'cross'\n // triggerTooltip: true | false | null\n\n\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }\n });\n}\n\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n var volatileOption = {};\n each(fields, function (field) {\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n }); // category axis do not auto snap, otherwise some tick that do not\n // has value can not be hovered. value/time/log axis default snap if\n // triggered from tooltip and trigger tooltip.\n\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatibel with previous behavior, tooltip axis do not show label by default.\n // Only these properties can be overrided from tooltip to axisPointer.\n\n if (tooltipAxisPointerModel.get('type') === 'cross') {\n volatileOption.type = 'line';\n }\n\n var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default.\n\n labelOption.show == null && (labelOption.show = false);\n\n if (fromTooltip === 'cross') {\n // When 'cross', both axes show labels.\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style\n // (cross style is dashed by default)\n\n if (!triggerTooltip) {\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n crossStyle && defaults(labelOption, crossStyle.textStyle);\n }\n }\n\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\n\nfunction collectSeriesInfo(result, ecModel) {\n // Prepare data for axis trigger\n ecModel.eachSeries(function (seriesModel) {\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n var coordSys = seriesModel.coordinateSystem;\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n\n if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n return;\n }\n\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n var axis = axisInfo.axis;\n\n if (coordSys.getAxis(axis.dim) === axis) {\n axisInfo.seriesModels.push(seriesModel);\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n axisInfo.seriesDataCount += seriesModel.getData().count();\n }\n });\n });\n}\n/**\n * For example:\n * {\n * axisPointer: {\n * links: [{\n * xAxisIndex: [2, 4],\n * yAxisIndex: 'all'\n * }, {\n * xAxisId: ['a5', 'a7'],\n * xAxisName: 'xxx'\n * }]\n * }\n * }\n */\n\n\nfunction getLinkGroupIndex(linksOption, axis) {\n var axisModel = axis.model;\n var dim = axis.dim;\n\n for (var i = 0; i < linksOption.length; i++) {\n var linkOption = linksOption[i] || {};\n\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n return i;\n }\n }\n}\n\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\n\nexport function fixValue(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n\n if (!axisInfo) {\n return;\n }\n\n var axisPointerModel = axisInfo.axisPointerModel;\n var scale = axisInfo.axis.scale;\n var option = axisPointerModel.option;\n var status = axisPointerModel.get('status');\n var value = axisPointerModel.get('value'); // Parse init value for category and time axis.\n\n if (value != null) {\n value = scale.parse(value);\n }\n\n var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value\n // and status should be initialized.\n\n if (status == null) {\n option.status = useHandle ? 'show' : 'hide';\n }\n\n var extent = scale.getExtent().slice();\n extent[0] > extent[1] && extent.reverse();\n\n if ( // Pick a value on axis when initializing.\n value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n // where we should re-pick a value to keep `handle` displaying normally.\n || value > extent[1]) {\n // Make handle displayed on the end of the axis when init, which looks better.\n value = extent[1];\n }\n\n if (value < extent[0]) {\n value = extent[0];\n }\n\n option.value = value;\n\n if (useHandle) {\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n }\n}\nexport function getAxisInfo(axisModel) {\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n return axisInfo && axisInfo.axisPointerModel;\n}\n\nfunction isHandleTrigger(axisPointerModel) {\n return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\n * @param {module:echarts/model/Model} model\n * @return {string} unique key\n */\n\n\nexport function makeKey(model) {\n return model.type + '||' + model.id;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper';\nimport ComponentView from '../../view/Component';\nvar axisPointerClazz = {};\n/**\n * Base class of AxisView.\n */\n\nvar AxisView =\n/** @class */\nfunction (_super) {\n __extends(AxisView, _super);\n\n function AxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisView.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n // FIXME\n // This process should proformed after coordinate systems updated\n // (axis scale updated), and should be performed each time update.\n // So put it here temporarily, although it is not appropriate to\n // put a model-writing procedure in `view`.\n this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\n\n _super.prototype.render.apply(this, arguments);\n\n this._doUpdateAxisPointerClass(axisModel, api, true);\n };\n /**\n * Action handler.\n */\n\n\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\n this._doUpdateAxisPointerClass(axisModel, api, false);\n };\n /**\n * @override\n */\n\n\n AxisView.prototype.remove = function (ecModel, api) {\n var axisPointer = this._axisPointer;\n axisPointer && axisPointer.remove(api);\n };\n /**\n * @override\n */\n\n\n AxisView.prototype.dispose = function (ecModel, api) {\n this._disposeAxisPointer(api);\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\n\n if (!Clazz) {\n return;\n }\n\n var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);\n };\n\n AxisView.prototype._disposeAxisPointer = function (api) {\n this._axisPointer && this._axisPointer.dispose(api);\n this._axisPointer = null;\n };\n\n AxisView.registerAxisPointerClass = function (type, clazz) {\n if (process.env.NODE_ENV !== 'production') {\n if (axisPointerClazz[type]) {\n throw new Error('axisPointer ' + type + ' exists');\n }\n }\n\n axisPointerClazz[type] = clazz;\n };\n\n ;\n\n AxisView.getAxisPointerClass = function (type) {\n return type && axisPointerClazz[type];\n };\n\n ;\n AxisView.type = 'axis';\n return AxisView;\n}(ComponentView);\n\nexport default AxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\nexport function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n } // TODO: TYPE\n\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = inner(axisView).splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n autoBatch: true,\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n inner(axisView).splitAreaColors = newSplitAreaColors;\n}\nexport function rectCoordAxisHandleRemove(axisView) {\n inner(axisView).splitAreaColors = null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport AxisBuilder from './AxisBuilder';\nimport AxisView from './AxisView';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\n\nvar CartesianAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisView, _super);\n\n function CartesianAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianAxisView.type;\n _this.axisPointerClass = 'CartesianAxisPointer';\n return _this;\n }\n /**\n * @override\n */\n\n\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\n handleAutoShown: function (elementType) {\n var cartesians = gridModel.coordinateSystem.getCartesians();\n\n for (var i = 0; i < cartesians.length; i++) {\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\n\n if (otherAxisType === 'value' || otherAxisType === 'log') {\n // Still show axis tick or axisLine if other axis is value / log\n return true;\n }\n } // Not show axisTick or axisLine if other axis is category / time\n\n\n return false;\n }\n }, layout));\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n CartesianAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n CartesianAxisView.type = 'cartesianAxis';\n return CartesianAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n axisGroup.add(new graphic.Line({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n subPixelOptimize: true,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n }));\n }\n },\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n axisGroup.add(new graphic.Line({\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n subPixelOptimize: true,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: lineStyle,\n silent: true\n }));\n }\n }\n },\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n }\n};\n\nvar CartesianXAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianXAxisView, _super);\n\n function CartesianXAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianXAxisView.type = 'xAxis';\n return CartesianXAxisView;\n}(CartesianAxisView);\n\nexport { CartesianXAxisView };\n\nvar CartesianYAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianYAxisView, _super);\n\n function CartesianYAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianYAxisView.type = 'yAxis';\n return CartesianYAxisView;\n}(CartesianAxisView);\n\nexport { CartesianYAxisView };\nexport default CartesianAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component';\nimport GridModel from '../../coord/cartesian/GridModel';\nimport { Rect } from '../../util/graphic';\nimport { defaults } from 'zrender/lib/core/util';\nimport { CartesianAxisModel } from '../../coord/cartesian/AxisModel';\nimport axisModelCreator from '../../coord/axisModelCreator';\nimport Grid from '../../coord/cartesian/Grid';\nimport { CartesianXAxisView, CartesianYAxisView } from '../axis/CartesianAxisView'; // Grid view\n\nvar GridView =\n/** @class */\nfunction (_super) {\n __extends(GridView, _super);\n\n function GridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'grid';\n return _this;\n }\n\n GridView.prototype.render = function (gridModel, ecModel) {\n this.group.removeAll();\n\n if (gridModel.get('show')) {\n this.group.add(new Rect({\n shape: gridModel.coordinateSystem.getRect(),\n style: defaults({\n fill: gridModel.get('backgroundColor')\n }, gridModel.getItemStyle()),\n silent: true,\n z2: -1\n }));\n }\n };\n\n GridView.type = 'grid';\n return GridView;\n}(ComponentView);\n\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n offset: 0\n};\nexport function install(registers) {\n registers.registerComponentView(GridView);\n registers.registerComponentModel(GridModel);\n registers.registerCoordinateSystem('cartesian2d', Grid);\n axisModelCreator(registers, 'x', CartesianAxisModel, extraOption);\n axisModelCreator(registers, 'y', CartesianAxisModel, extraOption);\n registers.registerComponentView(CartesianXAxisView);\n registers.registerComponentView(CartesianYAxisView);\n registers.registerPreprocessor(function (option) {\n // Only create grid when need\n if (option.xAxis && option.yAxis && !option.grid) {\n option.grid = {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport ScatterSeriesModel from './ScatterSeries';\nimport ScatterView from './ScatterView';\nimport { install as installGridSimple } from '../../component/grid/installSimple';\nimport layoutPoints from '../../layout/points';\nexport function install(registers) {\n // In case developer forget to include grid component\n use(installGridSimple);\n registers.registerSeriesModel(ScatterSeriesModel);\n registers.registerChartView(ScatterView);\n registers.registerLayout(layoutPoints('scatter'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function radarLayout(ecModel) {\n ecModel.eachSeriesByType('radar', function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n return;\n }\n\n var axes = coordSys.getIndicatorAxes();\n zrUtil.each(axes, function (axis, axisIndex) {\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\n points[dataIndex] = points[dataIndex] || [];\n var point = coordSys.dataToPoint(val, axisIndex);\n points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);\n });\n }); // Close polygon\n\n data.each(function (idx) {\n // TODO\n // Is it appropriate to connect to the next data when some data is missing?\n // Or, should trade it like `connectNull` in line chart?\n var firstPoint = zrUtil.find(points[idx], function (point) {\n return isValidPoint(point);\n }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array\n\n points[idx].push(firstPoint.slice());\n data.setItemLayout(idx, points[idx]);\n });\n });\n}\n\nfunction isValidPoint(point) {\n return !isNaN(point[0]) && !isNaN(point[1]);\n}\n\nfunction getValueMissingPoint(coordSys) {\n // It is error-prone to input [NaN, NaN] into polygon, polygon.\n // (probably cause problem when refreshing or animating)\n return [coordSys.cx, coordSys.cy];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\n// Backward compat for radar chart in 2\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function radarBackwardCompat(option) {\n var polarOptArr = option.polar;\n\n if (polarOptArr) {\n if (!zrUtil.isArray(polarOptArr)) {\n polarOptArr = [polarOptArr];\n }\n\n var polarNotRadar_1 = [];\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\n if (polarOpt.indicator) {\n if (polarOpt.type && !polarOpt.shape) {\n polarOpt.shape = polarOpt.type;\n }\n\n option.radar = option.radar || [];\n\n if (!zrUtil.isArray(option.radar)) {\n option.radar = [option.radar];\n }\n\n option.radar.push(polarOpt);\n } else {\n polarNotRadar_1.push(polarOpt);\n }\n });\n option.polar = polarNotRadar_1;\n }\n\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n seriesOpt.radarIndex = seriesOpt.polarIndex;\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as symbolUtil from '../../util/symbol';\nimport ChartView from '../../view/Chart';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport ZRImage from 'zrender/lib/graphic/Image';\n\nfunction normalizeSymbolSize(symbolSize) {\n if (!zrUtil.isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return symbolSize;\n}\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle.\n\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore.\n\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n }\n\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n enableHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n });\n this._data = data;\n };\n\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\n\nexport default RadarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport createListSimply from '../helper/createListSimply';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\nimport { createTooltipMarkup, retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup';\n\nvar RadarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(RadarSeriesModel, _super);\n\n function RadarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarSeriesModel.type;\n _this.useColorPaletteOnData = true;\n _this.hasSymbolVisual = true;\n return _this;\n } // Overwrite\n\n\n RadarSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListSimply(this, {\n generateCoord: 'indicator_',\n generateCoordCount: Infinity\n });\n };\n\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var coordSys = this.coordinateSystem;\n var indicatorAxes = coordSys.getIndicatorAxes();\n var name = this.getData().getName(dataIndex);\n var nameToDisplay = name === '' ? this.name : name;\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\n return createTooltipMarkup('section', {\n header: nameToDisplay,\n sortBlocks: true,\n blocks: zrUtil.map(indicatorAxes, function (axis) {\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\n return createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: markerColor,\n name: axis.name,\n value: val,\n sortParam: val\n });\n })\n });\n };\n\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var data_1 = this.getData();\n var coordSys = this.coordinateSystem;\n var values = data_1.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data_1.mapDimension(dim);\n }), dataIndex);\n\n for (var i = 0, len = values.length; i < len; i++) {\n if (!isNaN(values[i])) {\n var indicatorAxes = coordSys.getIndicatorAxes();\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\n }\n }\n }\n };\n\n RadarSeriesModel.type = 'series.radar';\n RadarSeriesModel.dependencies = ['radar'];\n RadarSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'radar',\n legendHoverLink: true,\n radarIndex: 0,\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n label: {\n position: 'top'\n },\n // areaStyle: {\n // },\n // itemStyle: {}\n symbolSize: 8 // symbolRotate: null\n\n };\n return RadarSeriesModel;\n}(SeriesModel);\n\nexport default RadarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport axisDefault from '../axisDefault';\nimport Model from '../../model/Model';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport ComponentModel from '../../model/Component';\nvar valueAxisDefault = axisDefault.value;\n\nfunction defaultsShow(opt, show) {\n return zrUtil.defaults({\n show: show\n }, opt);\n}\n\nvar RadarModel =\n/** @class */\nfunction (_super) {\n __extends(RadarModel, _super);\n\n function RadarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarModel.type;\n return _this;\n }\n\n RadarModel.prototype.optionUpdated = function () {\n var boundaryGap = this.get('boundaryGap');\n var splitNumber = this.get('splitNumber');\n var scale = this.get('scale');\n var axisLine = this.get('axisLine');\n var axisTick = this.get('axisTick'); // let axisType = this.get('axisType');\n\n var axisLabel = this.get('axisLabel');\n var nameTextStyle = this.get('axisName');\n var showName = this.get(['axisName', 'show']);\n var nameFormatter = this.get(['axisName', 'formatter']);\n var nameGap = this.get('axisNameGap');\n var triggerEvent = this.get('triggerEvent');\n var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n // PENDING\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n indicatorOpt.min = 0;\n } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n indicatorOpt.max = 0;\n }\n\n var iNameTextStyle = nameTextStyle;\n\n if (indicatorOpt.color != null) {\n iNameTextStyle = zrUtil.defaults({\n color: indicatorOpt.color\n }, nameTextStyle);\n } // Use same configuration\n\n\n var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n boundaryGap: boundaryGap,\n splitNumber: splitNumber,\n scale: scale,\n axisLine: axisLine,\n axisTick: axisTick,\n // axisType: axisType,\n axisLabel: axisLabel,\n // Compatible with 2 and use text\n name: indicatorOpt.text,\n nameLocation: 'end',\n nameGap: nameGap,\n // min: 0,\n nameTextStyle: iNameTextStyle,\n triggerEvent: triggerEvent\n }, false);\n\n if (!showName) {\n innerIndicatorOpt.name = '';\n }\n\n if (typeof nameFormatter === 'string') {\n var indName = innerIndicatorOpt.name;\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n } else if (typeof nameFormatter === 'function') {\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n }\n\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\n zrUtil.mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent.\n\n model.mainType = 'radar';\n model.componentIndex = this.componentIndex;\n return model;\n }, this);\n this._indicatorModels = indicatorModels;\n };\n\n RadarModel.prototype.getIndicatorModels = function () {\n return this._indicatorModels;\n };\n\n RadarModel.type = 'radar';\n RadarModel.defaultOption = {\n zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '75%',\n startAngle: 90,\n axisName: {\n show: true // formatter: null\n // textStyle: {}\n\n },\n boundaryGap: [0, 0],\n splitNumber: 5,\n axisNameGap: 15,\n scale: false,\n // Polygon or circle\n shape: 'polygon',\n axisLine: zrUtil.merge({\n lineStyle: {\n color: '#bbb'\n }\n }, valueAxisDefault.axisLine),\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n // axisType: 'value',\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n // {text, min, max}\n indicator: []\n };\n return RadarModel;\n}(ComponentModel);\n\nexport default RadarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport AxisBuilder from '../axis/AxisBuilder';\nimport * as graphic from '../../util/graphic';\nimport ComponentView from '../../view/Component';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (radarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n this._buildAxes(radarModel);\n\n this._buildSplitLineAndArea(radarModel);\n };\n\n RadarView.prototype._buildAxes = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\n position: [radar.cx, radar.cy],\n rotation: indicatorAxis.angle,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1\n });\n return axisBuilder;\n });\n zrUtil.each(axisBuilders, function (axisBuilder) {\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this.group.add(axisBuilder.getGroup());\n }, this);\n };\n\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n\n if (!indicatorAxes.length) {\n return;\n }\n\n var shape = radarModel.get('shape');\n var splitLineModel = radarModel.getModel('splitLine');\n var splitAreaModel = radarModel.getModel('splitArea');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var showSplitLine = splitLineModel.get('show');\n var showSplitArea = splitAreaModel.get('show');\n var splitLineColors = lineStyleModel.get('color');\n var splitAreaColors = areaStyleModel.get('color');\n var splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\n var splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\n var splitLines = [];\n var splitAreas = [];\n\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\n var colorIndex = idx % areaOrLineColorList.length;\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\n return colorIndex;\n }\n\n if (shape === 'circle') {\n var ticksRadius = indicatorAxes[0].getTicksCoords();\n var cx = radar.cx;\n var cy = radar.cy;\n\n for (var i = 0; i < ticksRadius.length; i++) {\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: cx,\n cy: cy,\n r: ticksRadius[i].coord\n }\n }));\n }\n\n if (showSplitArea && i < ticksRadius.length - 1) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\n splitAreas[colorIndex].push(new graphic.Ring({\n shape: {\n cx: cx,\n cy: cy,\n r0: ticksRadius[i].coord,\n r: ticksRadius[i + 1].coord\n }\n }));\n }\n }\n } // Polyyon\n else {\n var realSplitNumber_1;\n var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\n var ticksCoords = indicatorAxis.getTicksCoords();\n realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);\n return zrUtil.map(ticksCoords, function (tickCoord) {\n return radar.coordToPoint(tickCoord.coord, idx);\n });\n });\n var prevPoints = [];\n\n for (var i = 0; i <= realSplitNumber_1; i++) {\n var points = [];\n\n for (var j = 0; j < indicatorAxes.length; j++) {\n points.push(axesTicksPoints[j][i]);\n } // Close\n\n\n if (points[0]) {\n points.push(points[0].slice());\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Can\\'t draw value axis ' + i);\n }\n }\n\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Polyline({\n shape: {\n points: points\n }\n }));\n }\n\n if (showSplitArea && prevPoints) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\n splitAreas[colorIndex].push(new graphic.Polygon({\n shape: {\n points: points.concat(prevPoints)\n }\n }));\n }\n\n prevPoints = points.slice().reverse();\n }\n }\n\n var lineStyle = lineStyleModel.getLineStyle();\n var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine\n\n zrUtil.each(splitAreas, function (splitAreas, idx) {\n this.group.add(graphic.mergePath(splitAreas, {\n style: zrUtil.defaults({\n stroke: 'none',\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\n }, areaStyle),\n silent: true\n }));\n }, this);\n zrUtil.each(splitLines, function (splitLines, idx) {\n this.group.add(graphic.mergePath(splitLines, {\n style: zrUtil.defaults({\n fill: 'none',\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\n }, lineStyle),\n silent: true\n }));\n }, this);\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ComponentView);\n\nexport default RadarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar IndicatorAxis =\n/** @class */\nfunction (_super) {\n __extends(IndicatorAxis, _super);\n\n function IndicatorAxis(dim, scale, radiusExtent) {\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\n\n _this.type = 'value';\n _this.angle = 0;\n _this.name = '';\n return _this;\n }\n\n return IndicatorAxis;\n}(Axis);\n\nexport default IndicatorAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis';\nimport IntervalScale from '../../scale/Interval';\nimport * as numberUtil from '../../util/number';\nimport { getScaleExtent, niceScaleExtent } from '../axisHelper';\nimport { parseAxisModelMinMax } from '../scaleRawExtentInfo';\nimport { map, each } from 'zrender/lib/core/util';\n\nvar Radar =\n/** @class */\nfunction () {\n function Radar(radarModel, ecModel, api) {\n /**\n *\n * Radar dimensions\n */\n this.dimensions = [];\n this._model = radarModel;\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n var dim = 'indicator_' + idx;\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n );\n indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis\n\n indicatorAxis.model = indicatorModel;\n indicatorModel.axis = indicatorAxis;\n this.dimensions.push(dim);\n return indicatorAxis;\n }, this);\n this.resize(radarModel, api);\n }\n\n Radar.prototype.getIndicatorAxes = function () {\n return this._indicatorAxes;\n };\n\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n }; // TODO: API should be coordToPoint([coord, indicatorIndex])\n\n\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n var angle = indicatorAxis.angle;\n var x = this.cx + coord * Math.cos(angle);\n var y = this.cy - coord * Math.sin(angle);\n return [x, y];\n };\n\n Radar.prototype.pointToData = function (pt) {\n var dx = pt[0] - this.cx;\n var dy = pt[1] - this.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx); // Find the closest angle\n // FIXME index can calculated directly\n\n var minRadianDiff = Infinity;\n var closestAxis;\n var closestAxisIdx = -1;\n\n for (var i = 0; i < this._indicatorAxes.length; i++) {\n var indicatorAxis = this._indicatorAxes[i];\n var diff = Math.abs(radian - indicatorAxis.angle);\n\n if (diff < minRadianDiff) {\n closestAxis = indicatorAxis;\n closestAxisIdx = i;\n minRadianDiff = diff;\n }\n }\n\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n };\n\n Radar.prototype.resize = function (radarModel, api) {\n var center = radarModel.get('center');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n\n var radius = radarModel.get('radius');\n\n if (typeof radius === 'string' || typeof radius === 'number') {\n radius = [0, radius];\n }\n\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n this.r = numberUtil.parsePercent(radius[1], viewSize);\n each(this._indicatorAxes, function (indicatorAxis, idx) {\n indicatorAxis.setExtent(this.r0, this.r);\n var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI]\n\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n indicatorAxis.angle = angle;\n }, this);\n };\n\n Radar.prototype.update = function (ecModel, api) {\n var indicatorAxes = this._indicatorAxes;\n var radarModel = this._model;\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\n });\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n return;\n }\n\n var data = radarSeries.getData();\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n });\n }, this);\n var splitNumber = radarModel.get('splitNumber');\n\n function increaseInterval(interval) {\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10)); // Increase interval\n\n var f = interval / exp10;\n\n if (f === 2) {\n f = 5;\n } else {\n // f is 2 or 5\n f *= 2;\n }\n\n return f * exp10;\n } // Force all the axis fixing the maxSplitNumber.\n\n\n each(indicatorAxes, function (indicatorAxis, idx) {\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\n var axisModel = indicatorAxis.model;\n var scale = indicatorAxis.scale;\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\n var interval = scale.getInterval();\n\n if (fixedMin != null && fixedMax != null) {\n // User set min, max, divide to get new interval\n scale.setExtent(+fixedMin, +fixedMax);\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\n } else if (fixedMin != null) {\n var max = void 0; // User set min, expand extent on the other side\n\n do {\n max = fixedMin + interval * splitNumber;\n scale.setExtent(+fixedMin, max); // Interval must been set after extent\n // FIXME\n\n scale.setInterval(interval);\n interval = increaseInterval(interval);\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\n } else if (fixedMax != null) {\n var min = void 0; // User set min, expand extent on the other side\n\n do {\n min = fixedMax - interval * splitNumber;\n scale.setExtent(min, +fixedMax);\n scale.setInterval(interval);\n interval = increaseInterval(interval);\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\n } else {\n var nicedSplitNumber = scale.getTicks().length - 1;\n\n if (nicedSplitNumber > splitNumber) {\n interval = increaseInterval(interval);\n } // TODO\n\n\n var max = Math.ceil(rawExtent[1] / interval) * interval;\n var min = numberUtil.round(max - interval * splitNumber);\n scale.setExtent(min, max);\n scale.setInterval(interval);\n }\n });\n };\n\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n\n Radar.create = function (ecModel, api) {\n var radarList = [];\n ecModel.eachComponent('radar', function (radarModel) {\n var radar = new Radar(radarModel, ecModel, api);\n radarList.push(radar);\n radarModel.coordinateSystem = radar;\n });\n ecModel.eachSeriesByType('radar', function (radarSeries) {\n if (radarSeries.get('coordinateSystem') === 'radar') {\n // Inject coordinate system\n // @ts-ignore\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n }\n });\n return radarList;\n };\n /**\n * Radar dimensions is based on the data\n */\n\n\n Radar.dimensions = [];\n return Radar;\n}();\n\nexport default Radar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadarModel from '../../coord/radar/RadarModel';\nimport RadarView from './RadarView';\nimport Radar from '../../coord/radar/Radar';\nexport function install(registers) {\n registers.registerCoordinateSystem('radar', Radar);\n registers.registerComponentModel(RadarModel);\n registers.registerComponentView(RadarView);\n registers.registerVisual({\n seriesType: 'radar',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // itemVisual symbol is for selected data\n\n data.each(function (idx) {\n data.setItemVisual(idx, 'legendSymbol', 'roundRect');\n }); // visual is for unselected data\n\n data.setVisual('legendSymbol', 'roundRect');\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport radarLayout from '../radar/radarLayout';\nimport dataFilter from '../../processor/dataFilter';\nimport backwardCompat from '../radar/backwardCompat';\nimport RadarView from './RadarView';\nimport RadarSeriesModel from './RadarSeries';\nimport { install as installRadarComponent } from '../../component/radar/install';\nexport function install(registers) {\n use(installRadarComponent);\n registers.registerChartView(RadarView);\n registers.registerSeriesModel(RadarSeriesModel);\n registers.registerLayout(radarLayout);\n registers.registerProcessor(dataFilter('radar'));\n registers.registerPreprocessor(backwardCompat);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as echarts from '../../core/echarts';\nvar ATTR = '\\0_ec_interaction_mutex';\nexport function take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\nexport function release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\nexport function isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */\n// TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, function () {});","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Eventful from 'zrender/lib/core/Eventful';\nimport * as eventTool from 'zrender/lib/core/event';\nimport * as interactionMutex from './interactionMutex';\nimport { isString, bind, defaults, clone } from 'zrender/lib/core/util';\n\nvar RoamController =\n/** @class */\nfunction (_super) {\n __extends(RoamController, _super);\n\n function RoamController(zr) {\n var _this = _super.call(this) || this;\n\n _this._zr = zr; // Avoid two roamController bind the same handler\n\n var mousedownHandler = bind(_this._mousedownHandler, _this);\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\n var mouseupHandler = bind(_this._mouseupHandler, _this);\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\n var pinchHandler = bind(_this._pinchHandler, _this);\n /**\n * Notice: only enable needed types. For example, if 'zoom'\n * is not needed, 'zoom' should not be enabled, otherwise\n * default mousewheel behaviour (scroll page) will be disabled.\n */\n\n _this.enable = function (controlType, opt) {\n // Disable previous first\n this.disable();\n this._opt = defaults(clone(opt) || {}, {\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n // By default, wheel do not trigger move.\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n\n if (controlType == null) {\n controlType = true;\n }\n\n if (controlType === true || controlType === 'move' || controlType === 'pan') {\n zr.on('mousedown', mousedownHandler);\n zr.on('mousemove', mousemoveHandler);\n zr.on('mouseup', mouseupHandler);\n }\n\n if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n zr.on('mousewheel', mousewheelHandler);\n zr.on('pinch', pinchHandler);\n }\n };\n\n _this.disable = function () {\n zr.off('mousedown', mousedownHandler);\n zr.off('mousemove', mousemoveHandler);\n zr.off('mouseup', mouseupHandler);\n zr.off('mousewheel', mousewheelHandler);\n zr.off('pinch', pinchHandler);\n };\n\n return _this;\n }\n\n RoamController.prototype.isDragging = function () {\n return this._dragging;\n };\n\n RoamController.prototype.isPinching = function () {\n return this._pinching;\n };\n\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\n this.pointerChecker = pointerChecker;\n };\n\n RoamController.prototype.dispose = function () {\n this.disable();\n };\n\n RoamController.prototype._mousedownHandler = function (e) {\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e) || e.target && e.target.draggable) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY; // Only check on mosedown, but not mousemove.\n // Mouse can be out of target when mouse moving.\n\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\n this._x = x;\n this._y = y;\n this._dragging = true;\n }\n };\n\n RoamController.prototype._mousemoveHandler = function (e) {\n if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY;\n var oldX = this._x;\n var oldY = this._y;\n var dx = x - oldX;\n var dy = y - oldY;\n this._x = x;\n this._y = y;\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\n trigger(this, 'pan', 'moveOnMouseMove', e, {\n dx: dx,\n dy: dy,\n oldX: oldX,\n oldY: oldY,\n newX: x,\n newY: y,\n isAvailableBehavior: null\n });\n };\n\n RoamController.prototype._mouseupHandler = function (e) {\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n this._dragging = false;\n }\n };\n\n RoamController.prototype._mousewheelHandler = function (e) {\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n var wheelDelta = e.wheelDelta;\n var absWheelDeltaDelta = Math.abs(wheelDelta);\n var originX = e.offsetX;\n var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac.\n\n if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n return;\n } // If both `shouldZoom` and `shouldMove` is true, trigger\n // their event both, and the final behavior is determined\n // by event listener themselves.\n\n\n if (shouldZoom) {\n // Convenience:\n // Mac and VM Windows on Mac: scroll up: zoom out.\n // Windows: scroll up: zoom in.\n // FIXME: Should do more test in different environment.\n // wheelDelta is too complicated in difference nvironment\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n // although it has been normallized by zrender.\n // wheelDelta of mouse wheel is bigger than touch pad.\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n var scale = wheelDelta > 0 ? factor : 1 / factor;\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\n scale: scale,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n\n if (shouldMove) {\n // FIXME: Should do more test in different environment.\n var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad.\n\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\n scrollDelta: scrollDelta,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n };\n\n RoamController.prototype._pinchHandler = function (e) {\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n checkPointerAndTrigger(this, 'zoom', null, e, {\n scale: scale,\n originX: e.pinchX,\n originY: e.pinchY,\n isAvailableBehavior: null\n });\n };\n\n return RoamController;\n}(Eventful);\n\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\n // When mouse is out of roamController rect,\n // default befavoius should not be be disabled, otherwise\n // page sliding is disabled, contrary to expectation.\n eventTool.stop(e.event);\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n }\n}\n\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n // Also provide behavior checker for event listener, for some case that\n // multiple components share one listener.\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\n controller.trigger(eventName, contollerEvent);\n} // settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n\n\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n}\n\nexport default RoamController;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * For geo and graph.\n */\nexport function updateViewOnPan(controllerHost, dx, dy) {\n var target = controllerHost.target;\n target.x += dx;\n target.y += dy;\n target.dirty();\n}\n/**\n * For geo and graph.\n */\n\nexport function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\n target.x -= (zoomX - target.x) * (zoomScale - 1);\n target.y -= (zoomY - target.y) * (zoomScale - 1);\n target.scaleX *= zoomScale;\n target.scaleY *= zoomScale;\n target.dirty();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar IRRELEVANT_EXCLUDES = {\n 'axisPointer': 1,\n 'tooltip': 1,\n 'brush': 1\n};\n/**\n * Avoid that: mouse click on a elements that is over geo or graph,\n * but roam is triggered.\n */\n\nexport function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport RoamController from './RoamController';\nimport * as roamHelper from '../../component/helper/roamHelper';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis, enableComponentHighDownFeatures, setDefaultStateProxy } from '../../util/states';\nimport geoSourceManager from '../../coord/geo/geoSourceManager';\nimport { getUID } from '../../util/component';\nimport { setLabelStyle, getLabelStatesModels, enableLayoutLayoutFeatures } from '../../label/labelStyle';\nimport { getECData } from '../../util/innerStore';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\nimport Displayable from 'zrender/lib/graphic/Displayable';\nimport { makeInner } from '../../util/model';\n/**\n * Only these tags enable use `itemStyle` if they are named in SVG.\n * Other tags like <text> <tspan> <image> might not suitable for `itemStyle`.\n * They will not be considered to be styled until some requirements come.\n */\n\nvar OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'];\nvar OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS);\nvar STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar LABEL_HOST_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar mapLabelRaw = makeInner();\n\nfunction getFixedItemStyle(model) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n}\n\nvar MapDraw =\n/** @class */\nfunction () {\n function MapDraw(api) {\n var group = new graphic.Group();\n this.uid = getUID('ec_map_draw');\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n this.group = group;\n group.add(this._regionsGroup = new graphic.Group());\n group.add(this._svgGroup = new graphic.Group());\n }\n\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var transformInfo = geo.getTransformInfo();\n var transformInfoRaw = transformInfo.raw;\n var transformInfoRoam = transformInfo.roam; // No animation when first draw or in action\n\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\n\n if (isFirstDraw) {\n group.x = transformInfoRoam.x;\n group.y = transformInfoRoam.y;\n group.scaleX = transformInfoRoam.scaleX;\n group.scaleY = transformInfoRoam.scaleY;\n group.dirty();\n } else {\n graphic.updateProps(group, transformInfoRoam, mapOrGeoModel);\n }\n\n var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0;\n var viewBuildCtx = {\n api: api,\n geo: geo,\n mapOrGeoModel: mapOrGeoModel,\n data: data,\n isVisualEncodedByVisualMap: isVisualEncodedByVisualMap,\n isGeo: isGeo,\n transformInfoRaw: transformInfoRaw\n };\n\n if (geo.resourceType === 'geoJSON') {\n this._buildGeoJSON(viewBuildCtx);\n } else if (geo.resourceType === 'geoSVG') {\n this._buildSVG(viewBuildCtx);\n }\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\n };\n\n MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) {\n var nameMap = this._regionsGroupByName = zrUtil.createHashMap();\n var regionsGroup = this._regionsGroup;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n\n var transformPoint = function (point) {\n return [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];\n };\n\n regionsGroup.removeAll(); // Only when the resource is GeoJSON, there is `geo.regions`.\n\n zrUtil.each(viewBuildCtx.geo.regions, function (region) {\n var regionName = region.name;\n var regionModel = mapOrGeoModel.getRegionModel(regionName);\n var dataIdx = data ? data.indexOfName(regionName) : null; // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n\n var regionGroup = nameMap.get(regionName);\n var hasRegionGroup = !!regionGroup;\n\n if (!hasRegionGroup) {\n regionGroup = nameMap.set(regionName, new graphic.Group());\n regionsGroup.add(regionGroup);\n }\n\n var compoundPath = new graphic.CompoundPath({\n segmentIgnoreThreshold: 1,\n shape: {\n paths: []\n }\n });\n regionGroup.add(compoundPath);\n\n if (!hasRegionGroup) {\n // ensure children have been added to group before calling resetEventTriggerForRegion\n resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n }\n\n zrUtil.each(region.geometries, function (geometry) {\n if (geometry.type !== 'polygon') {\n return;\n }\n\n var points = [];\n\n for (var i = 0; i < geometry.exterior.length; ++i) {\n points.push(transformPoint(geometry.exterior[i]));\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n segmentIgnoreThreshold: 1,\n shape: {\n points: points\n }\n }));\n\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\n var interior = geometry.interiors[i];\n var points_1 = [];\n\n for (var j = 0; j < interior.length; ++j) {\n points_1.push(transformPoint(interior[j]));\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n segmentIgnoreThreshold: 1,\n shape: {\n points: points_1\n }\n }));\n }\n });\n applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);\n\n if (compoundPath instanceof Displayable) {\n compoundPath.culling = true;\n }\n\n var centerPt = transformPoint(region.getCenter());\n resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);\n }, this);\n };\n\n MapDraw.prototype._buildSVG = function (viewBuildCtx) {\n var mapName = viewBuildCtx.geo.map;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n this._svgGroup.x = transformInfoRaw.x;\n this._svgGroup.y = transformInfoRaw.y;\n this._svgGroup.scaleX = transformInfoRaw.scaleX;\n this._svgGroup.scaleY = transformInfoRaw.scaleY;\n\n if (this._svgResourceChanged(mapName)) {\n this._freeSVG();\n\n this._useSVG(mapName);\n }\n\n var svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\n var focusSelf = false;\n zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\n // Note that we also allow different elements have the same name.\n // For example, a glyph of a city and the label of the city have\n // the same name and their tooltip info can be defined in a single\n // region option.\n var regionName = namedItem.name;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var svgNodeTagLower = namedItem.svgNodeTagLower;\n var el = namedItem.el;\n var dataIdx = data ? data.indexOfName(regionName) : null;\n var regionModel = mapOrGeoModel.getRegionModel(regionName);\n\n if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {\n applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\n }\n\n if (el instanceof Displayable) {\n el.culling = true;\n } // We do not know how the SVG like so we'd better not to change z2.\n // Otherwise it might bring some unexpected result. For example,\n // an area hovered that make some inner city can not be clicked.\n\n\n el.z2EmphasisLift = 0; // If self named, that is, if tag is inside a named <g> (where `namedFrom` does not exists):\n\n if (!namedItem.namedFrom) {\n // label should batter to be displayed based on the center of <g>\n // if it is named rather than displayed on each child.\n if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\n resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);\n }\n\n resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\n var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (focus_1 === 'self') {\n focusSelf = true;\n }\n\n var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\n els.push(el);\n }\n }\n }, this);\n\n this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\n };\n\n MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) {\n // It's a little complicated to support blurring the entire geoSVG in series-map.\n // So do not suport it until some requirements come.\n // At present, in series-map, only regions can be blurred.\n if (focusSelf && viewBuildCtx.isGeo) {\n var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); // Only suport `opacity` here. Because not sure that other props are suitable for\n // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\n\n var opacity_1 = blurStyle.opacity;\n\n this._svgGraphicRecord.root.traverse(function (el) {\n if (!el.isGroup) {\n // PENDING: clear those settings to SVG elements when `_freeSVG`.\n // (Currently it happen not to be needed.)\n setDefaultStateProxy(el);\n var style = el.ensureState('blur').style || {}; // Do not overwrite the region style that already set from region option.\n\n if (style.opacity == null && opacity_1 != null) {\n style.opacity = opacity_1;\n } // If `ensureState('blur').style = {}`, there will be default opacity.\n // Enable `stateTransition` (animation).\n\n\n el.ensureState('emphasis');\n }\n });\n }\n };\n\n MapDraw.prototype.remove = function () {\n this._regionsGroup.removeAll();\n\n this._regionsGroupByName = null;\n\n this._svgGroup.removeAll();\n\n this._freeSVG();\n\n this._controller.dispose();\n\n this._controllerHost = null;\n };\n\n MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) {\n if (name == null) {\n return [];\n }\n\n var geo = geoModel.coordinateSystem;\n\n if (geo.resourceType === 'geoJSON') {\n var regionsGroupByName = this._regionsGroupByName;\n\n if (regionsGroupByName) {\n var regionGroup = regionsGroupByName.get(name);\n return regionGroup ? [regionGroup] : [];\n }\n } else if (geo.resourceType === 'geoSVG') {\n return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\n }\n };\n\n MapDraw.prototype._svgResourceChanged = function (mapName) {\n return this._svgMapName !== mapName;\n };\n\n MapDraw.prototype._useSVG = function (mapName) {\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n var svgGraphic = resource.useGraphic(this.uid);\n\n this._svgGroup.add(svgGraphic.root);\n\n this._svgGraphicRecord = svgGraphic;\n this._svgMapName = mapName;\n }\n };\n\n MapDraw.prototype._freeSVG = function () {\n var mapName = this._svgMapName;\n\n if (mapName == null) {\n return;\n }\n\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n resource.freeGraphic(this.uid);\n }\n\n this._svgGraphicRecord = null;\n this._svgDispatcherMap = null;\n\n this._svgGroup.removeAll();\n\n this._svgMapName = null;\n };\n\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost; // @ts-ignore FIXME:TS\n\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n // @ts-ignore FIXME:TS\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n }));\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n };\n /**\n * FIXME: this is a temporarily workaround.\n * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\n * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\n * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\n * props will have no chance to be restored.\n * Note: this reset should be after `clearStates` in `renderSeries` becuase `useStates` in\n * `renderSeries` will cache the modified `ignore` to `el._normalState`.\n * TODO:\n * Use clone/immutable in `LabelManager`?\n */\n\n\n MapDraw.prototype.resetForLabelLayout = function () {\n this.group.traverse(function (el) {\n var label = el.getTextContent();\n\n if (label) {\n label.ignore = mapLabelRaw(label).ignore;\n }\n });\n };\n\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\n var mapDraw = this;\n regionsGroup.off('mousedown');\n regionsGroup.off('click'); // @ts-ignore FIXME:TS resolve type conflict\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n });\n }\n };\n\n return MapDraw;\n}();\n\n;\n\nfunction applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {\n // All of the path are using `itemStyle`, becuase\n // (1) Some SVG also use fill on polyline (The different between\n // polyline and polygon is \"open\" or \"close\" but not fill or not).\n // (2) For the common props like opacity, if some use itemStyle\n // and some use `lineStyle`, it might confuse users.\n // (3) Most SVG use <path>, where can not detect wether draw a \"line\"\n // or a filled shape, so use `itemStyle` for <path>.\n var normalStyleModel = regionModel.getModel('itemStyle');\n var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\n var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\n var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); // NOTE: DONT use 'style' in visual when drawing map.\n // This component is used for drawing underlying map for both geo component and map series.\n\n var normalStyle = getFixedItemStyle(normalStyleModel);\n var emphasisStyle = getFixedItemStyle(emphasisStyleModel);\n var selectStyle = getFixedItemStyle(selectStyleModel);\n var blurStyle = getFixedItemStyle(blurStyleModel); // Update the itemStyle if has data visual\n\n var data = viewBuildCtx.data;\n\n if (data) {\n // Only visual color of each item will be used. It can be encoded by visualMap\n // But visual color of series is used in symbol drawing\n // Visual color for each series is for the symbol draw\n var style = data.getItemVisual(dataIndex, 'style');\n var decal = data.getItemVisual(dataIndex, 'decal');\n\n if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\n normalStyle.fill = style.fill;\n }\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\n }\n } // SVG text, tspan and image can be named but not supporeted\n // to be styled by region option yet.\n\n\n el.setStyle(normalStyle);\n el.style.strokeNoScale = true;\n el.ensureState('emphasis').style = emphasisStyle;\n el.ensureState('select').style = selectStyle;\n el.ensureState('blur').style = blurStyle; // Enable blur\n\n setDefaultStateProxy(el);\n}\n\nfunction resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx, // If labelXY not provided, use `textConfig.position: 'inside'`\nlabelXY) {\n var data = viewBuildCtx.data;\n var isGeo = viewBuildCtx.isGeo;\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 3. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : regionName;\n var labelFetcher = void 0; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var specifiedTextOpt = labelXY ? {\n normal: {\n align: 'center',\n verticalAlign: 'middle'\n }\n } : null; // Caveat: must be called after `setDefaultStateProxy(el);` called.\n // because textContent will be assign with `el.stateProxy` inside.\n\n setLabelStyle(el, getLabelStatesModels(regionModel), {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: regionName\n }, specifiedTextOpt);\n var textEl = el.getTextContent();\n\n if (textEl) {\n mapLabelRaw(textEl).ignore = textEl.ignore;\n\n if (el.textConfig) {\n if (labelXY) {\n // Compute a relative offset based on the el bounding rect.\n var rect = el.getBoundingRect().clone();\n el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%'];\n }\n }\n }\n\n enableLayoutLayoutFeatures(el, dataIdx, null);\n el.disableLabelAnimation = true;\n } else {\n el.removeTextContent();\n el.removeTextConfig();\n el.disableLabelAnimation = null;\n }\n}\n\nfunction resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx) {\n // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the rigionGroup\n if (viewBuildCtx.data) {\n // FIXME: when series-map use a SVG map, and there are duplicated name specified\n // on different SVG elements, after `data.setItemGraphicEl(...)`:\n // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\n // can be triggered only mouse hover. That's correct.\n // (2) only the last element will be kept in `data`, so that if trigger tooltip\n // by `dispatchAction`, only the last one can be found and triggered. That might be\n // not correct. We will fix it in future if anyone demanding that.\n viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\n } // series-map will not trigger \"geoselectchange\" no matter it is\n // based on a declared geo component. Becuause series-map will\n // trigger \"selectchange\". If it trigger both the two events,\n // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\n // it not easy to also fire event \"geoselectchanged\".\n else {\n // Package custom mouse event for geo component\n getECData(eventTrigger).eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: regionName,\n region: regionModel && regionModel.option || {}\n };\n }\n}\n\nfunction resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n if (!viewBuildCtx.data) {\n graphic.setTooltipConfig({\n el: el,\n componentModel: mapOrGeoModel,\n itemName: regionName,\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n itemTooltipOption: regionModel.get('tooltip')\n });\n }\n}\n\nfunction resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n\n var emphasisModel = regionModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n enableHoverEmphasis(el, focus, emphasisModel.get('blurScope'));\n\n if (viewBuildCtx.isGeo) {\n enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);\n }\n\n return focus;\n}\n\nexport default MapDraw; // @ts-ignore FIXME:TS fix the \"compatible with each other\"?","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport MapDraw from '../../component/helper/MapDraw';\nimport ChartView from '../../view/Chart';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states';\n\nvar MapView =\n/** @class */\nfunction (_super) {\n __extends(MapView, _super);\n\n function MapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapView.type;\n return _this;\n }\n\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\n // Not render if it is an toggleSelect action from self\n if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n return;\n }\n\n var group = this.group;\n group.removeAll();\n\n if (mapModel.getHostGeoModel()) {\n return;\n }\n\n if (this._mapDraw && payload && payload.type === 'geoRoam') {\n this._mapDraw.resetForLabelLayout();\n } // Not update map if it is an roam action from self\n\n\n if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n if (mapModel.needsDrawMap) {\n var mapDraw = this._mapDraw || new MapDraw(api);\n group.add(mapDraw.group);\n mapDraw.draw(mapModel, ecModel, api, this, payload);\n this._mapDraw = mapDraw;\n } else {\n // Remove drawed map\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n }\n } else {\n var mapDraw = this._mapDraw;\n mapDraw && group.add(mapDraw.group);\n }\n\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n };\n\n MapView.prototype.remove = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n this.group.removeAll();\n };\n\n MapView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n };\n\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\n var originalData = mapModel.originalData;\n var group = this.group;\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n if (isNaN(value)) {\n return;\n }\n\n var layout = originalData.getItemLayout(originalDataIndex);\n\n if (!layout || !layout.point) {\n // Not exists in map\n return;\n }\n\n var point = layout.point;\n var offset = layout.offset;\n var circle = new graphic.Circle({\n style: {\n // Because the special of map draw.\n // Which needs statistic of multiple series and draw on one map.\n // And each series also need a symbol with legend color\n //\n // Layout and visual are put one the different data\n // TODO\n fill: mapModel.getData().getVisual('style').fill\n },\n shape: {\n cx: point[0] + offset * 9,\n cy: point[1],\n r: 3\n },\n silent: true,\n // Do not overlap the first series, on which labels are displayed.\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\n }); // Only the series that has the first value on the same region is in charge of rendering the label.\n // But consider the case:\n // series: [\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n // ]\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n // For backward compatibility, we follow the rule that render label `A` by the\n // settings on series `X` but render label `C` by the settings on series `Y`.\n\n if (!offset) {\n var fullData = mapModel.mainSeries.getData();\n var name_1 = originalData.getName(originalDataIndex);\n var fullIndex_1 = fullData.indexOfName(name_1);\n var itemModel = originalData.getItemModel(originalDataIndex);\n var labelModel = itemModel.getModel('label');\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1); // `getFormattedLabel` needs to use `getData` inside. Here\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n // FIXME\n // If this is not the `mainSeries`, the item model (like label formatter)\n // set on original data item will never get. But it has been working\n // like that from the begining, and this scenario is rarely encountered.\n // So it won't be fixed until have to.\n\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (idx, state) {\n return mapModel.getFormattedLabel(fullIndex_1, state);\n }\n }\n });\n circle.disableLabelAnimation = true;\n\n if (!labelModel.get('position')) {\n circle.setTextConfig({\n position: 'bottom'\n });\n }\n\n regionGroup.onHoverStateChange = function (toState) {\n setStatesFlag(circle, toState);\n };\n }\n\n group.add(circle);\n });\n };\n\n MapView.type = 'map';\n return MapView;\n}(ChartView);\n\nexport default MapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport createListSimply from '../helper/createListSimply';\nimport SeriesModel from '../../model/Series';\nimport geoSourceManager from '../../coord/geo/geoSourceManager';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\nimport { createSymbol } from '../../util/symbol';\n\nvar MapSeries =\n/** @class */\nfunction (_super) {\n __extends(MapSeries, _super);\n\n function MapSeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapSeries.type; // Only first map series of same mapType will drawMap.\n\n _this.needsDrawMap = false; // Group of all map series with same mapType\n\n _this.seriesGroup = [];\n\n _this.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var name_1 = this.getData().getName(dataIndex);\n var geo = this.coordinateSystem;\n var region = geo.getRegion(name_1);\n return region && geo.dataToPoint(region.getCenter());\n }\n };\n\n return _this;\n }\n\n MapSeries.prototype.getInitialData = function (option) {\n var data = createListSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n var dataNameMap = zrUtil.createHashMap();\n var toAppendNames = [];\n\n for (var i = 0, len = data.count(); i < len; i++) {\n var name_2 = data.getName(i);\n dataNameMap.set(name_2, true);\n }\n\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\n zrUtil.each(geoSource.regions, function (region) {\n var name = region.name;\n\n if (!dataNameMap.get(name)) {\n toAppendNames.push(name);\n }\n }); // Complete data with missing regions. The consequent processes (like visual\n // map and render) can not be performed without a \"full data\". For example,\n // find `dataIndex` by name.\n\n data.appendValues([], toAppendNames);\n return data;\n };\n /**\n * If no host geo model, return null, which means using a\n * inner exclusive geo model.\n */\n\n\n MapSeries.prototype.getHostGeoModel = function () {\n var geoIndex = this.option.geoIndex;\n return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null;\n };\n\n MapSeries.prototype.getMapType = function () {\n return (this.getHostGeoModel() || this).option.map;\n }; // _fillOption(option, mapName) {\n // Shallow clone\n // option = zrUtil.extend({}, option);\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n // return option;\n // }\n\n\n MapSeries.prototype.getRawValue = function (dataIndex) {\n // Use value stored in data instead because it is calculated from multiple series\n // FIXME Provide all value of multiple series ?\n var data = this.getData();\n return data.get(data.mapDimension('value'), dataIndex);\n };\n /**\n * Get model of region\n */\n\n\n MapSeries.prototype.getRegionModel = function (regionName) {\n var data = this.getData();\n return data.getItemModel(data.indexOfName(regionName));\n };\n /**\n * Map tooltip formatter\n */\n\n\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // FIXME orignalData and data is a bit confusing\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n var seriesGroup = this.seriesGroup;\n var seriesNames = [];\n\n for (var i = 0; i < seriesGroup.length; i++) {\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n var valueDim = data.mapDimension('value');\n\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n seriesNames.push(seriesGroup[i].name);\n }\n }\n\n return createTooltipMarkup('section', {\n header: seriesNames.join(', '),\n noHeader: !seriesNames.length,\n blocks: [createTooltipMarkup('nameValue', {\n name: name,\n value: value\n })]\n });\n };\n\n MapSeries.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n MapSeries.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n MapSeries.prototype.getLegendIcon = function (opt) {\n var symbolType = opt.symbolType || 'roundRect';\n var symbol = createSymbol(symbolType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n symbol.setStyle(opt.itemStyle); // Map do not use itemStyle.borderWidth as border width\n\n symbol.style.stroke = 'none';\n\n if (symbolType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n\n return symbol;\n };\n\n MapSeries.type = 'series.map';\n MapSeries.dependencies = ['geo'];\n MapSeries.layoutMode = 'box';\n MapSeries.defaultOption = {\n // 一级层叠\n zlevel: 0,\n // 二级层叠\n z: 2,\n coordinateSystem: 'geo',\n // map should be explicitly specified since ec3.\n map: '',\n // If `geoIndex` is not specified, a exclusive geo will be\n // created. Otherwise use the specified geo component, and\n // `map` and `mapType` are ignored.\n // geoIndex: 0,\n // 'center' | 'left' | 'right' | 'x%' | {number}\n left: 'center',\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\n top: 'center',\n // right\n // bottom\n // width:\n // height\n // Aspect is width / height. Inited to be geoJson bbox aspect\n // This parameter is used for scale this aspect\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n ///// Layout with center and size\n // If you wan't to put map in a fixed size box with right aspect ratio\n // This two properties may more conveninet\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n showLegendSymbol: true,\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ],\n // higher priority than center and zoom\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n selectedMode: true,\n label: {\n show: false,\n color: '#000'\n },\n // scaleLimit: null,\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444',\n areaColor: '#eee'\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n areaColor: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n nameProperty: 'name'\n };\n return MapSeries;\n}(SeriesModel);\n\nexport default MapSeries;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // FIXME 公用?\n\nfunction dataStatistics(datas, statisticType) {\n var dataNameMap = {};\n zrUtil.each(datas, function (data) {\n data.each(data.mapDimension('value'), function (value, idx) {\n // Add prefix to avoid conflict with Object.prototype.\n var mapKey = 'ec-' + data.getName(idx);\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n\n if (!isNaN(value)) {\n dataNameMap[mapKey].push(value);\n }\n });\n });\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n var mapKey = 'ec-' + datas[0].getName(idx);\n var sum = 0;\n var min = Infinity;\n var max = -Infinity;\n var len = dataNameMap[mapKey].length;\n\n for (var i = 0; i < len; i++) {\n min = Math.min(min, dataNameMap[mapKey][i]);\n max = Math.max(max, dataNameMap[mapKey][i]);\n sum += dataNameMap[mapKey][i];\n }\n\n var result;\n\n if (statisticType === 'min') {\n result = min;\n } else if (statisticType === 'max') {\n result = max;\n } else if (statisticType === 'average') {\n result = sum / len;\n } else {\n result = sum;\n }\n\n return len === 0 ? NaN : result;\n });\n}\n\nexport default function mapDataStatistic(ecModel) {\n var seriesGroups = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var hostGeoModel = seriesModel.getHostGeoModel();\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n });\n zrUtil.each(seriesGroups, function (seriesList, key) {\n var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n return seriesModel.getData();\n }), seriesList[0].get('mapValueCalculation'));\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].originalData = seriesList[i].getData();\n } // FIXME Put where?\n\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].seriesGroup = seriesList;\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n seriesList[i].setData(data.cloneShallow());\n seriesList[i].mainSeries = seriesList[0];\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function mapSymbolLayout(ecModel) {\n var processedMapType = {};\n ecModel.eachSeriesByType('map', function (mapSeries) {\n var mapType = mapSeries.getMapType();\n\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n return;\n }\n\n var mapSymbolOffsets = {};\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n var geo = subMapSeries.coordinateSystem;\n var data = subMapSeries.originalData;\n\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n data.each(data.mapDimension('value'), function (value, idx) {\n var name = data.getName(idx);\n var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44],\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n // not be drawn. So here must validate if value is NaN.\n\n if (!region || isNaN(value)) {\n return;\n }\n\n var offset = mapSymbolOffsets[name] || 0;\n var point = geo.dataToPoint(region.getCenter());\n mapSymbolOffsets[name] = offset + 1;\n data.setItemLayout(idx, {\n point: point,\n offset: offset\n });\n });\n }\n }); // Show label of those region not has legendSymbol(which is offset 0)\n\n var data = mapSeries.getData();\n data.each(function (idx) {\n var name = data.getName(idx);\n var layout = data.getItemLayout(idx) || {};\n layout.showLabel = !mapSymbolOffsets[name];\n data.setItemLayout(idx, layout);\n });\n processedMapType[mapType] = true;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Simple view coordinate system\n * Mapping given x, y to transformd view x, y\n */\n\nimport * as vector from 'zrender/lib/core/vector';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport Transformable from 'zrender/lib/core/Transformable';\nvar v2ApplyTransform = vector.applyTransform;\n\nvar View =\n/** @class */\nfunction (_super) {\n __extends(View, _super);\n\n function View(name) {\n var _this = _super.call(this) || this;\n\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\n * Represents the transform brought by roam/zoom.\n * If `View['_viewRect']` applies roam transform,\n * we can get the final displayed rect.\n */\n\n _this._roamTransformable = new Transformable();\n /**\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\n */\n\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n\n\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\n * Transformed to particular position and size\n */\n\n\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n\n this._updateTransform();\n };\n /**\n * Set center of view\n */\n\n\n View.prototype.setCenter = function (centerCoord) {\n if (!centerCoord) {\n return;\n }\n\n this._center = centerCoord;\n\n this._updateCenterAndZoom();\n };\n\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n\n this._zoom = zoom;\n\n this._updateCenterAndZoom();\n };\n /**\n * Get default center without roam\n */\n\n\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\n * Remove roam\n */\n\n\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n\n this._updateTransform();\n };\n /**\n * Update transform props on `this` based on the current\n * `this._roamTransformable` and `this._rawTransformable`.\n */\n\n\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalcualte them.\n\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\n * Get view rect after roam transform\n */\n\n\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\n * Convert a single (lon, lat) data item to (x, y) point.\n */\n\n\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\n * Convert a (x, y) point to (lon, lat) data\n */\n\n\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\n * @implements\n */\n\n\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport View from '../View';\nimport geoSourceManager from './geoSourceManager';\nimport { SINGLE_REFERRING } from '../../util/model';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = ['lng', 'lat'];\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n _this.resourceType = resource ? resource.type : null;\n var defaultParmas = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this._invertLongitute = defaultParmas.invertLongitute;\n _this.regions = source.regions;\n _this.aspectScale = zrUtil.retrieve2(opt.aspectScale, defaultParmas.aspectScale);\n var boundingRect = source.boundingRect;\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);\n\n return _this;\n }\n /**\n * Whether contain the given [lng, lat] coord.\n */\n // Never used yet.\n // containCoord(coord: number[]) {\n // const regions = this.regions;\n // for (let i = 0; i < regions.length; i++) {\n // const region = regions[i];\n // if (region.type === 'geoJSON' && (region as GeoJSONRegion).contain(coord)) {\n // return true;\n // }\n // }\n // return false;\n // }\n\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitute is inverted\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\n * Add geoCoord for indexing by name\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\n * Get geoCoord by name\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // calcualte center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (typeof data === 'string') {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\n }\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Geo from './Geo';\nimport * as layout from '../../util/layout';\nimport * as numberUtil from '../../util/number';\nimport geoSourceManager from './geoSourceManager';\n/**\n * Resize method bound to the geo\n */\n\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n\n if (boundingCoords != null) {\n var leftTop = boundingCoords[0];\n var rightBottom = boundingCoords[1];\n\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\n }\n }\n\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n\n var viewRect;\n\n if (useCenterAndSize) {\n viewRect = {};\n\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'));\n this.setZoom(geoModel.get('zoom'));\n} // Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\n\n\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\n\nvar GeoCreator =\n/** @class */\nfunction () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = Geo.prototype.dimensions;\n }\n\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = []; // FIXME Create each time may be slow\n\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var name = geoModel.get('map');\n var geo = new Geo(name + idx, name, {\n nameMap: geoModel.get('nameMap'),\n nameProperty: geoModel.get('nameProperty'),\n aspectScale: geoModel.get('aspectScale')\n });\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo); // setGeoCoords(geo, geoModel);\n\n geoModel.coordinateSystem = geo;\n geo.model = geoModel; // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n }); // If has map series\n\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, {\n nameMap: zrUtil.mergeAll(nameMapList),\n nameProperty: mapSeries[0].get('nameProperty'),\n aspectScale: mapSeries[0].get('aspectScale')\n });\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo); // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\n * Fill given regions array\n */\n\n\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n\n return GeoCreator;\n}();\n\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nimport ComponentModel from '../../model/Component';\nimport Model from '../../model/Model';\nimport geoCreator from './geoCreator';\nimport geoSourceManager from './geoSourceManager';\n;\n\nvar GeoModel =\n/** @class */\nfunction (_super) {\n __extends(GeoModel, _super);\n\n function GeoModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoModel.type;\n return _this;\n }\n\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\n var source = geoSourceManager.getGeoResource(option.map);\n\n if (source && source.type === 'geoJSON') {\n var itemStyle = option.itemStyle = option.itemStyle || {};\n\n if (!('color' in itemStyle)) {\n itemStyle.color = '#eee';\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n };\n\n GeoModel.prototype.optionUpdated = function () {\n var _this = this;\n\n var option = this.option;\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n var selectedMap = {};\n this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n var regionName = regionOpt.name;\n\n if (regionName) {\n optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n\n if (regionOpt.selected) {\n selectedMap[regionName] = true;\n }\n }\n\n return optionModelMap;\n }, zrUtil.createHashMap());\n\n if (!option.selectedMap) {\n option.selectedMap = selectedMap;\n }\n };\n /**\n * Get model of region.\n */\n\n\n GeoModel.prototype.getRegionModel = function (name) {\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n };\n /**\n * Format label\n * @param name Region name\n */\n\n\n GeoModel.prototype.getFormattedLabel = function (name, status) {\n var regionModel = this.getRegionModel(name);\n var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n var params = {\n name: name\n };\n\n if (typeof formatter === 'function') {\n params.status = status;\n return formatter(params);\n } else if (typeof formatter === 'string') {\n return formatter.replace('{a}', name != null ? name : '');\n }\n };\n\n GeoModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GeoModel.prototype.setCenter = function (center) {\n this.option.center = center;\n }; // PENGING If selectedMode is null ?\n\n\n GeoModel.prototype.select = function (name) {\n var option = this.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n if (selectedMode !== 'multiple') {\n option.selectedMap = null;\n }\n\n var selectedMap = option.selectedMap || (option.selectedMap = {});\n selectedMap[name] = true;\n };\n\n GeoModel.prototype.unSelect = function (name) {\n var selectedMap = this.option.selectedMap;\n\n if (selectedMap) {\n selectedMap[name] = false;\n }\n };\n\n GeoModel.prototype.toggleSelected = function (name) {\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n };\n\n GeoModel.prototype.isSelected = function (name) {\n var selectedMap = this.option.selectedMap;\n return !!(selectedMap && selectedMap[name]);\n };\n\n GeoModel.type = 'geo';\n GeoModel.layoutMode = 'box';\n GeoModel.defaultOption = {\n zlevel: 0,\n z: 0,\n show: true,\n left: 'center',\n top: 'center',\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n ///// Layout with center and size\n // If you wan't to put map in a fixed size box with right aspect ratio\n // This two properties may more conveninet\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n silent: false,\n // Map type\n map: '',\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ]\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n // selectedMode: false\n label: {\n show: false,\n color: '#000'\n },\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444' // Default color:\n // + geoJSON: #eee\n // + geoSVG: null (use SVG original `fill`)\n // color: '#eee'\n\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n regions: [] // tooltip: {\n // show: false\n // }\n\n };\n return GeoModel;\n}(ComponentModel);\n\nexport default GeoModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function updateCenterAndZoom(view, payload, zoomLimit) {\n var previousZoom = view.getZoom();\n var center = view.getCenter();\n var zoom = payload.zoom;\n var point = view.dataToPoint(center);\n\n if (payload.dx != null && payload.dy != null) {\n point[0] -= payload.dx;\n point[1] -= payload.dy;\n view.setCenter(view.pointToData(point));\n }\n\n if (zoom != null) {\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\n } // Zoom on given point(originX, originY)\n\n\n view.scaleX *= zoom;\n view.scaleY *= zoom;\n var fixX = (payload.originX - view.x) * (zoom - 1);\n var fixY = (payload.originY - view.y) * (zoom - 1);\n view.x -= fixX;\n view.y -= fixY;\n view.updateTransform(); // Get the new center\n\n view.setCenter(view.pointToData(point));\n view.setZoom(zoom * previousZoom);\n }\n\n return {\n center: view.getCenter(),\n zoom: view.getZoom()\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MapDraw from '../helper/MapDraw';\nimport ComponentView from '../../view/Component';\nimport { getECData } from '../../util/innerStore';\nimport { findEventDispatcher } from '../../util/event';\n\nvar GeoView =\n/** @class */\nfunction (_super) {\n __extends(GeoView, _super);\n\n function GeoView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoView.type;\n _this.focusBlurEnabled = true;\n return _this;\n }\n\n GeoView.prototype.init = function (ecModel, api) {\n var mapDraw = new MapDraw(api);\n this._mapDraw = mapDraw;\n this.group.add(mapDraw.group);\n this._api = api;\n };\n\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\n var mapDraw = this._mapDraw;\n\n if (geoModel.get('show')) {\n mapDraw.draw(geoModel, ecModel, api, this, payload);\n } else {\n this._mapDraw.group.removeAll();\n }\n\n mapDraw.group.on('click', this._handleRegionClick, this);\n mapDraw.group.silent = geoModel.get('silent');\n this._model = geoModel;\n this.updateSelectStatus(geoModel, ecModel, api);\n };\n\n GeoView.prototype._handleRegionClick = function (e) {\n var eventData;\n findEventDispatcher(e.target, function (current) {\n return (eventData = getECData(current).eventData) != null;\n }, true);\n\n if (eventData) {\n this._api.dispatchAction({\n type: 'geoToggleSelect',\n geoId: this._model.id,\n name: eventData.name\n });\n }\n };\n\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\n var _this = this;\n\n this._mapDraw.group.traverse(function (node) {\n var eventData = getECData(node).eventData;\n\n if (eventData) {\n _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); // No need to traverse children.\n\n return true;\n }\n });\n };\n\n GeoView.prototype.findHighDownDispatchers = function (name) {\n return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\n };\n\n GeoView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n };\n\n GeoView.type = 'geo';\n return GeoView;\n}(ComponentView);\n\nexport default GeoView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GeoModel from '../../coord/geo/GeoModel';\nimport geoCreator from '../../coord/geo/geoCreator';\nimport { each } from 'zrender/lib/core/util';\nimport { updateCenterAndZoom } from '../../action/roamHelper';\nimport GeoView from './GeoView';\nexport function install(registers) {\n registers.registerCoordinateSystem('geo', geoCreator);\n registers.registerComponentModel(GeoModel);\n registers.registerComponentView(GeoView);\n\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n each(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n }); // Notice: there might be duplicated name in different regions.\n\n var names = [];\n each(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport MapView from './MapView';\nimport MapSeries from './MapSeries';\nimport mapDataStatistic from './mapDataStatistic';\nimport mapSymbolLayout from './mapSymbolLayout';\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction';\nimport { install as installGeo } from '../../component/geo/install';\nexport function install(registers) {\n use(installGeo);\n registers.registerChartView(MapView);\n registers.registerSeriesModel(MapSeries);\n registers.registerLayout(mapSymbolLayout);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\n createLegacyDataSelectAction('map', registers.registerAction);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The tree layoutHelper implementation was originally copied from\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\n* some modifications made for this project.\n* (see more details in the comment of the specific method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\n\n/**\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\n * the tree.\n */\nimport * as layout from '../../util/layout';\n/**\n * Initialize all computational message for following algorithm.\n */\n\nexport function init(inRoot) {\n var root = inRoot;\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n\n if (node.isExpand && children.length) {\n var n = children.length;\n\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes a preliminary x coordinate for node. Before that, this function is\n * applied recursively to the children of node, as well as the function\n * apportion(). After spacing out the children by calling executeShifts(), the\n * node is placed to the midpoint of its outermost children.\n */\n\nexport function firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes all real x-coordinates by summing up the modifiers recursively.\n */\n\nexport function secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\nexport function separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\n * Transform the common coordinate to radial coordinate.\n */\n\nexport function radialCoordinate(rad, r) {\n rad -= Math.PI / 2;\n return {\n x: r * Math.cos(rad),\n y: r * Math.sin(rad)\n };\n}\n/**\n * Get the layout position of the whole view.\n */\n\nexport function getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\n * All other shifts, applied to the smaller subtrees between w- and w+, are\n * performed by this function.\n *\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * The core of the algorithm. Here, a new subtree is combined with the\n * previous subtrees. Threads are used to traverse the inside and outside\n * contours of the left and right subtree up to the highest common level.\n * Whenever two nodes of the inside contours conflict, we compute the left\n * one of the greatest uncommon ancestors using the function nextAncestor()\n * and call moveSubtree() to shift the subtree and prepare the shifts of\n * smaller subtrees. Finally, we add a new thread (if necessary).\n */\n\n\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n\n return ancestor;\n}\n/**\n * This function is used to traverse the right contour of a subtree.\n * It returns the rightmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\n\n\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\n * This function is used to traverse the left contour of a subtree (or a subforest).\n * It returns the leftmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\n\n\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\n * Otherwise, returns the specified ancestor.\n */\n\n\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Shifts the current subtree rooted at wr.\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\n */\n\n\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\n\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport SymbolClz from '../helper/Symbol';\nimport { radialCoordinate } from './layoutHelper';\nimport * as bbox from 'zrender/lib/core/bbox';\nimport View from '../../coord/View';\nimport * as roamHelper from '../../component/helper/roamHelper';\nimport RoamController from '../../component/helper/RoamController';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper';\nimport { parsePercent } from '../../util/number';\nimport ChartView from '../../view/Chart';\nimport Path from 'zrender/lib/graphic/Path';\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states';\n\nvar TreeEdgeShape =\n/** @class */\nfunction () {\n function TreeEdgeShape() {\n this.parentPoint = [];\n this.childPoints = [];\n }\n\n return TreeEdgeShape;\n}();\n\nvar TreePath =\n/** @class */\nfunction (_super) {\n __extends(TreePath, _super);\n\n function TreePath(opts) {\n return _super.call(this, opts) || this;\n }\n\n TreePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n TreePath.prototype.getDefaultShape = function () {\n return new TreeEdgeShape();\n };\n\n TreePath.prototype.buildPath = function (ctx, shape) {\n var childPoints = shape.childPoints;\n var childLen = childPoints.length;\n var parentPoint = shape.parentPoint;\n var firstChildPos = childPoints[0];\n var lastChildPos = childPoints[childLen - 1];\n\n if (childLen === 1) {\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\n return;\n }\n\n var orient = shape.orient;\n var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;\n var otherDim = 1 - forkDim;\n var forkPosition = parsePercent(shape.forkPosition, 1);\n var tmpPoint = [];\n tmpPoint[forkDim] = parentPoint[forkDim];\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\n tmpPoint[forkDim] = firstChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n tmpPoint[forkDim] = lastChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\n\n for (var i = 1; i < childLen - 1; i++) {\n var point = childPoints[i];\n ctx.moveTo(point[0], point[1]);\n tmpPoint[forkDim] = point[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n }\n };\n\n return TreePath;\n}(Path);\n\nvar TreeView =\n/** @class */\nfunction (_super) {\n __extends(TreeView, _super);\n\n function TreeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreeView.type;\n _this._mainGroup = new graphic.Group();\n return _this;\n }\n\n TreeView.prototype.init = function (ecModel, api) {\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: this.group\n };\n this.group.add(this._mainGroup);\n };\n\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var layoutInfo = seriesModel.layoutInfo;\n var group = this._mainGroup;\n var layout = seriesModel.get('layout');\n\n if (layout === 'radial') {\n group.x = layoutInfo.x + layoutInfo.width / 2;\n group.y = layoutInfo.y + layoutInfo.height / 2;\n } else {\n group.x = layoutInfo.x;\n group.y = layoutInfo.y;\n }\n\n this._updateViewCoordSys(seriesModel);\n\n this._updateController(seriesModel, ecModel, api);\n\n var oldData = this._data;\n data.diff(oldData).add(function (newIdx) {\n if (symbolNeedsDraw(data, newIdx)) {\n // Create node and edge\n updateNode(data, newIdx, null, group, seriesModel);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n\n if (!symbolNeedsDraw(data, newIdx)) {\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n return;\n } // Update node and edge\n\n\n updateNode(data, newIdx, symbolEl, group, seriesModel);\n }).remove(function (oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed\n // node haven't been initialized with a symbol element,\n // you can't found it's symbol element through index.\n // so if we want to remove the symbol element we should insure\n // that the symbol element is not null.\n\n if (symbolEl) {\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n }\n }).execute();\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n\n this._updateNodeAndLinkScale(seriesModel);\n\n if (seriesModel.get('expandAndCollapse') === true) {\n data.eachItemGraphicEl(function (el, dataIndex) {\n el.off('click').on('click', function () {\n api.dispatchAction({\n type: 'treeExpandAndCollapse',\n seriesId: seriesModel.id,\n dataIndex: dataIndex\n });\n });\n });\n }\n\n this._data = data;\n };\n\n TreeView.prototype._updateViewCoordSys = function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n points.push([+layout.x, +layout.y]);\n }\n });\n var min = [];\n var max = [];\n bbox.fromPoints(points, min, max); // If don't Store min max when collapse the root node after roam,\n // the root node will disappear.\n\n var oldMin = this._min;\n var oldMax = this._max; // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\n }\n\n if (max[1] - min[1] === 0) {\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\n }\n\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n viewCoordSys.setCenter(seriesModel.get('center'));\n viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\n\n this.group.attr({\n x: viewCoordSys.x,\n y: viewCoordSys.y,\n scaleX: viewCoordSys.scaleX,\n scaleY: viewCoordSys.scaleY\n });\n this._min = min;\n this._max = max;\n };\n\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale(seriesModel); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\n var data = seriesModel.getData();\n\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n\n data.eachItemGraphicEl(function (el, idx) {\n el.setSymbolScale(nodeScale);\n });\n };\n\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupZoom = coordSys.scaleX || 1; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n };\n\n TreeView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n TreeView.prototype.remove = function () {\n this._mainGroup.removeAll();\n\n this._data = null;\n };\n\n TreeView.type = 'tree';\n return TreeView;\n}(ChartView);\n\nfunction symbolNeedsDraw(data, dataIndex) {\n var layout = data.getItemLayout(dataIndex);\n return layout && !isNaN(layout.x) && !isNaN(layout.y);\n}\n\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\n var isInit = !symbolEl;\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var itemModel = node.getModel();\n var visualColor = node.getVisual('style').fill;\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff';\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceLayout = source.getLayout();\n var sourceOldLayout = sourceSymbolEl ? {\n x: sourceSymbolEl.__oldX,\n y: sourceSymbolEl.__oldY,\n rawX: sourceSymbolEl.__radialOldRawX,\n rawY: sourceSymbolEl.__radialOldRawY\n } : sourceLayout;\n var targetLayout = node.getLayout();\n\n if (isInit) {\n symbolEl = new SymbolClz(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n symbolEl.x = sourceOldLayout.x;\n symbolEl.y = sourceOldLayout.y;\n } else {\n symbolEl.updateData(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n }\n\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n symbolEl.__radialRawX = targetLayout.rawX;\n symbolEl.__radialRawY = targetLayout.rawY;\n group.add(symbolEl);\n data.setItemGraphicEl(dataIndex, symbolEl);\n symbolEl.__oldX = symbolEl.x;\n symbolEl.__oldY = symbolEl.y;\n graphic.updateProps(symbolEl, {\n x: targetLayout.x,\n y: targetLayout.y\n }, seriesModel);\n var symbolPath = symbolEl.getSymbolPath();\n\n if (seriesModel.get('layout') === 'radial') {\n var realRoot = virtualRoot.children[0];\n var rootLayout = realRoot.getLayout();\n var length_1 = realRoot.children.length;\n var rad = void 0;\n var isLeft = void 0;\n\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\n var center = {\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\n };\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n isLeft = center.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n isLeft = targetLayout.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n isLeft = targetLayout.x > rootLayout.x;\n\n if (!isLeft) {\n rad = rad - Math.PI;\n }\n }\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n var normalLabelModel = itemModel.getModel('label');\n var rotate = normalLabelModel.get('rotate');\n var labelRotateRadian = rotate * (Math.PI / 180);\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n symbolPath.setTextConfig({\n position: normalLabelModel.get('position') || textPosition,\n rotation: rotate == null ? -rad : labelRotateRadian,\n origin: 'center'\n });\n textContent.setStyle('verticalAlign', 'middle');\n }\n } // Handle status\n\n\n var focus = itemModel.get(['emphasis', 'focus']);\n var focusDataIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null;\n\n if (focusDataIndices) {\n // Modify the focus to data indices.\n getECData(symbolEl).focus = focusDataIndices;\n }\n\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\n\n if (symbolEl.__edge) {\n symbolEl.onHoverStateChange = function (toState) {\n if (toState !== 'blur') {\n // NOTE: Ensure the parent elements will been blurred firstly.\n // According to the return of getAncestorsIndices and getDescendantIndices\n // TODO: A bit tricky.\n var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);\n\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\n setStatesFlag(symbolEl.__edge, toState);\n }\n }\n };\n }\n}\n\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\n var itemModel = node.getModel();\n var edgeShape = seriesModel.get('edgeShape');\n var layout = seriesModel.get('layout');\n var orient = seriesModel.getOrient();\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n var edge = symbolEl.__edge;\n\n if (edgeShape === 'curve') {\n if (node.parentNode && node.parentNode !== virtualRoot) {\n if (!edge) {\n edge = symbolEl.__edge = new graphic.BezierCurve({\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\n });\n }\n\n graphic.updateProps(edge, {\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\n }, seriesModel);\n }\n } else if (edgeShape === 'polyline') {\n if (layout === 'orthogonal') {\n if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {\n var children = node.children;\n var childPoints = [];\n\n for (var i = 0; i < children.length; i++) {\n var childLayout = children[i].getLayout();\n childPoints.push([childLayout.x, childLayout.y]);\n }\n\n if (!edge) {\n edge = symbolEl.__edge = new TreePath({\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: [[targetLayout.x, targetLayout.y]],\n orient: orient,\n forkPosition: edgeForkPosition\n }\n });\n }\n\n graphic.updateProps(edge, {\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: childPoints\n }\n }, seriesModel);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\n }\n }\n }\n\n if (edge) {\n edge.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: null\n }, lineStyle));\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\n setDefaultStateProxy(edge);\n group.add(edge);\n }\n}\n\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node; // let edgeShape = seriesScope.edgeShape;\n\n var sourceLayout;\n\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n } // Use same duration and easing with update to have more consistent animation.\n\n\n var removeAnimationOpt = {\n duration: seriesModel.get('animationDurationUpdate'),\n easing: seriesModel.get('animationEasingUpdate')\n };\n graphic.removeElement(symbolEl, {\n x: sourceLayout.x + 1,\n y: sourceLayout.y + 1\n }, seriesModel, {\n cb: function () {\n group.remove(symbolEl);\n data.setItemGraphicEl(dataIndex, null);\n },\n removeOpt: removeAnimationOpt\n });\n symbolEl.fadeOut(null, {\n fadeLabel: true,\n animation: removeAnimationOpt\n });\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceEdge = sourceSymbolEl.__edge; // 1. when expand the sub tree, delete the children node should delete the edge of\n // the source at the same time. because the polyline edge shape is only owned by the source.\n // 2.when the node is the only children of the source, delete the node should delete the edge of\n // the source at the same time. the same reason as above.\n\n var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);\n var edgeShape = seriesModel.get('edgeShape');\n var layoutOpt = seriesModel.get('layout');\n var orient = seriesModel.get('orient');\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n\n if (edge) {\n if (edgeShape === 'curve') {\n graphic.removeElement(edge, {\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\n graphic.removeElement(edge, {\n shape: {\n parentPoint: [sourceLayout.x, sourceLayout.y],\n childPoints: [[sourceLayout.x, sourceLayout.y]]\n },\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n }\n }\n}\n\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n var x1;\n var x2;\n var y1;\n var y2;\n\n if (layoutOpt === 'radial') {\n x1 = sourceLayout.rawX;\n y1 = sourceLayout.rawY;\n x2 = targetLayout.rawX;\n y2 = targetLayout.rawY;\n var radialCoor1 = radialCoordinate(x1, y1);\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\n var radialCoor4 = radialCoordinate(x2, y2);\n return {\n x1: radialCoor1.x || 0,\n y1: radialCoor1.y || 0,\n x2: radialCoor4.x || 0,\n y2: radialCoor4.y || 0,\n cpx1: radialCoor2.x || 0,\n cpy1: radialCoor2.y || 0,\n cpx2: radialCoor3.x || 0,\n cpy2: radialCoor3.y || 0\n };\n } else {\n x1 = sourceLayout.x;\n y1 = sourceLayout.y;\n x2 = targetLayout.x;\n y2 = targetLayout.y;\n\n if (orient === 'LR' || orient === 'RL') {\n cpx1 = x1 + (x2 - x1) * curvature;\n cpy1 = y1;\n cpx2 = x2 + (x1 - x2) * curvature;\n cpy2 = y2;\n }\n\n if (orient === 'TB' || orient === 'BT') {\n cpx1 = x1;\n cpy1 = y1 + (y2 - y1) * curvature;\n cpx2 = x2;\n cpy2 = y2 + (y1 - y2) * curvature;\n }\n }\n\n return {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n };\n}\n\nexport default TreeView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Link lists and struct (graph or tree)\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\n\nfunction linkList(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = extend({}, inner(this).datas);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, inner(this).mainData, opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update();\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(inner(res).datas, function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param [dataType] If not specified, return mainData.\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = inner(this).mainData;\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\n * Get list of all linked data\n */\n\n\nfunction getLinkedDataAll() {\n var mainData = inner(this).mainData;\n return mainData == null ? [{\n data: mainData\n }] : map(keys(inner(mainData).datas), function (type) {\n return {\n type: type,\n data: inner(mainData).datas[type]\n };\n });\n}\n\nfunction isMainData(data) {\n return inner(data).mainData === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n inner(mainData).datas = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n inner(mainData).datas[dataType] = data;\n inner(data).mainData = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n data.getLinkedDataAll = getLinkedDataAll;\n}\n\nexport default linkList;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Tree data structure\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport linkList from './helper/linkList';\nimport List from './List';\nimport createDimensions from './helper/createDimensions';\nimport { convertOptionIdName } from '../util/model';\n\nvar TreeNode =\n/** @class */\nfunction () {\n function TreeNode(name, hostTree) {\n this.depth = 0;\n this.height = 0;\n /**\n * Reference to list item.\n * Do not persistent dataIndex outside,\n * besause it may be changed by list.\n * If dataIndex -1,\n * this node is logical deleted (filtered) in list.\n */\n\n this.dataIndex = -1;\n this.children = [];\n this.viewChildren = [];\n this.isExpand = false;\n this.name = name || '';\n this.hostTree = hostTree;\n }\n /**\n * The node is removed.\n */\n\n\n TreeNode.prototype.isRemoved = function () {\n return this.dataIndex < 0;\n };\n\n TreeNode.prototype.eachNode = function (options, cb, context) {\n if (typeof options === 'function') {\n context = cb;\n cb = options;\n options = null;\n }\n\n options = options || {};\n\n if (zrUtil.isString(options)) {\n options = {\n order: options\n };\n }\n\n var order = options.order || 'preorder';\n var children = this[options.attr || 'children'];\n var suppressVisitSub;\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n children[i].eachNode(options, cb, context);\n }\n\n order === 'postorder' && cb.call(context, this);\n };\n /**\n * Update depth and height of this subtree.\n */\n\n\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\n var height = 0;\n this.depth = depth;\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.updateDepthAndHeight(depth + 1);\n\n if (child.height > height) {\n height = child.height;\n }\n }\n\n this.height = height + 1;\n };\n\n TreeNode.prototype.getNodeById = function (id) {\n if (this.getId() === id) {\n return this;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].getNodeById(id);\n\n if (res) {\n return res;\n }\n }\n };\n\n TreeNode.prototype.contains = function (node) {\n if (node === this) {\n return true;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].contains(node);\n\n if (res) {\n return res;\n }\n }\n };\n /**\n * @param includeSelf Default false.\n * @return order: [root, child, grandchild, ...]\n */\n\n\n TreeNode.prototype.getAncestors = function (includeSelf) {\n var ancestors = [];\n var node = includeSelf ? this : this.parentNode;\n\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n\n ancestors.reverse();\n return ancestors;\n };\n\n TreeNode.prototype.getAncestorsIndices = function () {\n var indices = [];\n var currNode = this;\n\n while (currNode) {\n indices.push(currNode.dataIndex);\n currNode = currNode.parentNode;\n }\n\n indices.reverse();\n return indices;\n };\n\n TreeNode.prototype.getDescendantIndices = function () {\n var indices = [];\n this.eachNode(function (childNode) {\n indices.push(childNode.dataIndex);\n });\n return indices;\n };\n\n TreeNode.prototype.getValue = function (dimension) {\n var data = this.hostTree.data;\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\n };\n\n TreeNode.prototype.setLayout = function (layout, merge) {\n this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n };\n /**\n * @return {Object} layout\n */\n\n\n TreeNode.prototype.getLayout = function () {\n return this.hostTree.data.getItemLayout(this.dataIndex);\n }; // @depcrecated\n // getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>\n\n\n TreeNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var hostTree = this.hostTree;\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n }; // TODO: TYPE More specific model\n\n\n TreeNode.prototype.getLevelModel = function () {\n return (this.hostTree.levelModels || [])[this.depth];\n };\n\n TreeNode.prototype.setVisual = function (key, value) {\n this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n };\n /**\n * Get item visual\n * FIXME: make return type better\n */\n\n\n TreeNode.prototype.getVisual = function (key) {\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\n };\n\n TreeNode.prototype.getRawIndex = function () {\n return this.hostTree.data.getRawIndex(this.dataIndex);\n };\n\n TreeNode.prototype.getId = function () {\n return this.hostTree.data.getId(this.dataIndex);\n };\n /**\n * if this is an ancestor of another node\n *\n * @param node another node\n * @return if is ancestor\n */\n\n\n TreeNode.prototype.isAncestorOf = function (node) {\n var parent = node.parentNode;\n\n while (parent) {\n if (parent === this) {\n return true;\n }\n\n parent = parent.parentNode;\n }\n\n return false;\n };\n /**\n * if this is an descendant of another node\n *\n * @param node another node\n * @return if is descendant\n */\n\n\n TreeNode.prototype.isDescendantOf = function (node) {\n return node !== this && node.isAncestorOf(this);\n };\n\n return TreeNode;\n}();\n\nexport { TreeNode };\n;\n\nvar Tree =\n/** @class */\nfunction () {\n function Tree(hostModel) {\n this.type = 'tree';\n this._nodes = [];\n this.hostModel = hostModel;\n }\n\n Tree.prototype.eachNode = function (options, cb, context) {\n this.root.eachNode(options, cb, context);\n };\n\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n var rawIndex = this.data.getRawIndex(dataIndex);\n return this._nodes[rawIndex];\n };\n\n Tree.prototype.getNodeById = function (name) {\n return this.root.getNodeById(name);\n };\n /**\n * Update item available by list,\n * when list has been performed options like 'filterSelf' or 'map'.\n */\n\n\n Tree.prototype.update = function () {\n var data = this.data;\n var nodes = this._nodes;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n };\n /**\n * Clear all layouts\n */\n\n\n Tree.prototype.clearLayouts = function () {\n this.data.clearItemLayouts();\n };\n /**\n * data node format:\n * {\n * name: ...\n * value: ...\n * children: [\n * {\n * name: ...\n * value: ...\n * children: ...\n * },\n * ...\n * ]\n * }\n */\n\n\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n var tree = new Tree(hostModel);\n var listData = [];\n var dimMax = 1;\n buildHierarchy(dataRoot);\n\n function buildHierarchy(dataNode, parentNode) {\n var value = dataNode.value;\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n listData.push(dataNode);\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n parentNode ? addChild(node, parentNode) : tree.root = node;\n\n tree._nodes.push(node);\n\n var children = dataNode.children;\n\n if (children) {\n for (var i = 0; i < children.length; i++) {\n buildHierarchy(children[i], node);\n }\n }\n }\n\n tree.root.updateDepthAndHeight(0);\n var dimensionsInfo = createDimensions(listData, {\n coordDimensions: ['value'],\n dimensionsCount: dimMax\n });\n var list = new List(dimensionsInfo, hostModel);\n list.initData(listData);\n beforeLink && beforeLink(list);\n linkList({\n mainData: list,\n struct: tree,\n structAttr: 'tree'\n });\n tree.update();\n return tree;\n };\n\n return Tree;\n}();\n/**\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\n * so this function is not ready and not necessary to be public.\n */\n\n\nfunction addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}\n\nexport default Tree;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport Tree from '../../data/Tree';\nimport Model from '../../model/Model';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\n\nvar TreeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreeSeriesModel, _super);\n\n function TreeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.hasSymbolVisual = true; // Do it self.\n\n _this.ignoreStyleOnData = true;\n return _this;\n }\n /**\n * Init a tree data structure from data in option series\n * @param option the object used to config echarts view\n * @return storage initial data\n */\n\n\n TreeSeriesModel.prototype.getInitialData = function (option) {\n //create an virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var leavesModel = new Model(leaves, this, this.ecModel);\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n\n if (!node.children.length || !node.isExpand) {\n model.parentModel = leavesModel;\n }\n\n return model;\n });\n }\n\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\n\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n };\n /**\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\n * @returns {string} orient\n */\n\n\n TreeSeriesModel.prototype.getOrient = function () {\n var orient = this.get('orient');\n\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n\n return orient;\n };\n\n TreeSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n TreeSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value,\n noValue: isNaN(value) || value == null\n });\n };\n\n TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n\n TreeSeriesModel.layoutMode = 'box';\n TreeSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n // value can be 'polyline'\n edgeShape: 'curve',\n edgeForkPosition: '50%',\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n roam: false,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n // borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 500\n };\n return TreeSeriesModel;\n}(SeriesModel);\n\nexport default TreeSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Traverse the tree from bottom to top and do something\n */\nfunction eachAfter(root, callback, separation) {\n var nodes = [root];\n var next = [];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n next.push(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = 0; i < children.length; i++) {\n nodes.push(children[i]);\n }\n }\n }\n }\n\n while (node = next.pop()) {\n // jshint ignore:line\n callback(node, separation);\n }\n}\n/**\n * Traverse the tree from top to bottom and do something\n */\n\n\nfunction eachBefore(root, callback) {\n var nodes = [root];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n callback(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = children.length - 1; i >= 0; i--) {\n nodes.push(children[i]);\n }\n }\n }\n }\n}\n\nexport { eachAfter, eachBefore };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { eachAfter, eachBefore } from './traversalHelper';\nimport { init, firstWalk, secondWalk, separation as sep, radialCoordinate, getViewRect } from './layoutHelper';\nexport default function treeLayout(ecModel, api) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n commonLayout(seriesModel, api);\n });\n}\n\nfunction commonLayout(seriesModel, api) {\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var layout = seriesModel.get('layout');\n var width = 0;\n var height = 0;\n var separation = null;\n\n if (layout === 'radial') {\n width = 2 * Math.PI;\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n separation = sep(function (node1, node2) {\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n });\n } else {\n width = layoutInfo.width;\n height = layoutInfo.height;\n separation = sep();\n }\n\n var virtualRoot = seriesModel.getData().tree.root;\n var realRoot = virtualRoot.children[0];\n\n if (realRoot) {\n init(virtualRoot);\n eachAfter(realRoot, firstWalk, separation);\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n eachBefore(realRoot, secondWalk);\n var left_1 = realRoot;\n var right_1 = realRoot;\n var bottom_1 = realRoot;\n eachBefore(realRoot, function (node) {\n var x = node.getLayout().x;\n\n if (x < left_1.getLayout().x) {\n left_1 = node;\n }\n\n if (x > right_1.getLayout().x) {\n right_1 = node;\n }\n\n if (node.depth > bottom_1.depth) {\n bottom_1 = node;\n }\n });\n var delta = left_1 === right_1 ? 1 : separation(left_1, right_1) / 2;\n var tx_1 = delta - left_1.getLayout().x;\n var kx_1 = 0;\n var ky_1 = 0;\n var coorX_1 = 0;\n var coorY_1 = 0;\n\n if (layout === 'radial') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1); // here we use (node.depth - 1), bucause the real root's depth is 1\n\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = (node.depth - 1) * ky_1;\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\n node.setLayout({\n x: finalCoor.x,\n y: finalCoor.y,\n rawX: coorX_1,\n rawY: coorY_1\n }, true);\n });\n } else {\n var orient_1 = seriesModel.getOrient();\n\n if (orient_1 === 'RL' || orient_1 === 'LR') {\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\n kx_1 = width / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\n coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n } else if (orient_1 === 'TB' || orient_1 === 'BT') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n }\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util';\nexport default function treeVisual(ecModel) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel(); // TODO Optimize\n\n var style = model.getModel('itemStyle').getItemStyle();\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { updateCenterAndZoom } from '../../action/roamHelper';\nexport function installTreeAction(registers) {\n registers.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n });\n registers.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport TreeView from './TreeView';\nimport TreeSeriesModel from './TreeSeries';\nimport treeLayout from './treeLayout';\nimport treeVisual from './treeVisual';\nimport { installTreeAction } from './treeAction';\nexport function install(registers) {\n registers.registerChartView(TreeView);\n registers.registerSeriesModel(TreeSeriesModel);\n registers.registerLayout(treeLayout);\n registers.registerVisual(treeVisual);\n installTreeAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\n if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\n var root = seriesModel.getData().tree.root;\n var targetNode = payload.targetNode;\n\n if (typeof targetNode === 'string') {\n targetNode = root.getNodeById(targetNode);\n }\n\n if (targetNode && root.contains(targetNode)) {\n return {\n node: targetNode\n };\n }\n\n var targetNodeId = payload.targetNodeId;\n\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\n return {\n node: targetNode\n };\n }\n }\n} // Not includes the given node at the last item.\n\nexport function getPathToRoot(node) {\n var path = [];\n\n while (node) {\n node = node.parentNode;\n node && path.push(node);\n }\n\n return path.reverse();\n}\nexport function aboveViewRoot(viewRoot, node) {\n var viewPath = getPathToRoot(viewRoot);\n return zrUtil.indexOf(viewPath, node) >= 0;\n} // From root to the input node (the input node will be included).\n\nexport function wrapTreePathInfo(node, seriesModel) {\n var treePathInfo = [];\n\n while (node) {\n var nodeDataIndex = node.dataIndex;\n treePathInfo.push({\n name: node.name,\n dataIndex: nodeDataIndex,\n value: seriesModel.getRawValue(nodeDataIndex)\n });\n node = node.parentNode;\n }\n\n treePathInfo.reverse();\n return treePathInfo;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as helper from '../helper/treeHelper';\n\nvar noop = function () {};\n\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\nexport function installTreemapAction(registers) {\n for (var i = 0; i < actionTypes.length; i++) {\n registers.registerAction({\n type: actionTypes[i],\n update: 'updateView'\n }, noop);\n }\n\n registers.registerAction({\n type: 'treemapRootToNode',\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getDecalFromPalette } from '../../model/mixin/palette';\nexport default function enableAriaDecalForTree(seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n var decalPaletteScope = {};\n tree.eachNode(function (node) {\n // Use decal of level 1 node\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\n node.setVisual('decal', decal);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport SeriesModel from '../../model/Series';\nimport Tree from '../../data/Tree';\nimport Model from '../../model/Model';\nimport { wrapTreePathInfo } from '../helper/treeHelper';\nimport { normalizeToArray } from '../../util/model';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree';\n\nvar TreemapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreemapSeriesModel, _super);\n\n function TreemapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapSeriesModel.type;\n _this.preventUsingHoverLayer = true;\n return _this;\n }\n /**\n * @override\n */\n\n\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || []; // Used in \"visual priority\" in `treemapVisual.js`.\n // This way is a little tricky, must satisfy the precondition:\n // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.\n // 2. The `Model.prototype.getModel()` will not use any clone-like way.\n\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\n var designatedVisualModel = new Model({\n itemStyle: designatedVisualItemStyle\n }, this, ecModel);\n levels = option.levels = setDefault(levels, ecModel);\n var levelModels = zrUtil.map(levels || [], function (levelDefine) {\n return new Model(levelDefine, designatedVisualModel, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = levelModels[node.depth]; // If no levelModel, we also need `designatedVisualModel`.\n\n model.parentModel = levelModel || designatedVisualModel;\n return model;\n });\n }\n\n return tree.data;\n };\n\n TreemapSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /**\n * @override\n * @param {number} dataIndex\n * @param {boolean} [mutipleSeries=false]\n */\n\n\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n /**\n * Add tree path to tooltip param\n *\n * @override\n * @param {number} dataIndex\n * @return {Object}\n */\n\n\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n };\n /**\n * @public\n * @param {Object} layoutInfo {\n * x: containerGroup x\n * y: containerGroup y\n * width: containerGroup width\n * height: containerGroup height\n * }\n */\n\n\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\n /**\n * @readOnly\n * @type {Object}\n */\n this.layoutInfo = this.layoutInfo || {};\n zrUtil.extend(this.layoutInfo, layoutInfo);\n };\n /**\n * @param {string} id\n * @return {number} index\n */\n\n\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\n // A feature is implemented:\n // index is monotone increasing with the sequence of\n // input id at the first time.\n // This feature can make sure that each data item and its\n // mapped color have the same index between data list and\n // color list at the beginning, which is useful for user\n // to adjust data-color mapping.\n\n /**\n * @private\n * @type {Object}\n */\n var idIndexMap = this._idIndexMap;\n\n if (!idIndexMap) {\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n /**\n * @private\n * @type {number}\n */\n\n this._idIndexMapCount = 0;\n }\n\n var index = idIndexMap.get(id);\n\n if (index == null) {\n idIndexMap.set(id, index = this._idIndexMapCount++);\n }\n\n return index;\n };\n\n TreemapSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n TreemapSeriesModel.type = 'series.treemap';\n TreemapSeriesModel.layoutMode = 'box';\n TreemapSeriesModel.defaultOption = {\n // Disable progressive rendering\n progressive: 0,\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\n left: 'center',\n top: 'middle',\n width: '80%',\n height: '80%',\n sort: true,\n clipWindow: 'origin',\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\n leafDepth: null,\n drillDownIcon: '▶',\n // to align specialized icon. ▷▶❒❐▼✚\n zoomToNodeRatio: 0.32 * 0.32,\n roam: true,\n nodeClick: 'zoomToNode',\n animation: true,\n animationDurationUpdate: 900,\n animationEasing: 'quinticInOut',\n breadcrumb: {\n show: true,\n height: 22,\n left: 'center',\n top: 'bottom',\n // right\n // bottom\n emptyItemWidth: 25,\n itemStyle: {\n color: 'rgba(0,0,0,0.7)',\n textStyle: {\n color: '#fff'\n }\n }\n },\n label: {\n show: true,\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n distance: 0,\n padding: 5,\n position: 'inside',\n // formatter: null,\n color: '#fff',\n overflow: 'truncate' // align\n // verticalAlign\n\n },\n upperLabel: {\n show: false,\n position: [0, '50%'],\n height: 20,\n // formatter: null,\n // color: '#fff',\n overflow: 'truncate',\n // align: null,\n verticalAlign: 'middle'\n },\n itemStyle: {\n color: null,\n colorAlpha: null,\n colorSaturation: null,\n borderWidth: 0,\n gapWidth: 0,\n borderColor: '#fff',\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n // border color is evaluated by color of current node and\n // borderColorSaturation.\n\n },\n emphasis: {\n upperLabel: {\n show: true,\n position: [0, '50%'],\n ellipsis: true,\n verticalAlign: 'middle'\n }\n },\n visualDimension: 0,\n visualMin: null,\n visualMax: null,\n color: [],\n // level[n].color (if necessary).\n // + Specify color list of each level. level[0].color would be global\n // color list if not specified. (see method `setDefault`).\n // + But set as a empty array to forbid fetch color from global palette\n // when using nodeModel.get('color'), otherwise nodes on deep level\n // will always has color palette set and are not able to inherit color\n // from parent node.\n // + TreemapSeries.color can not be set as 'none', otherwise effect\n // legend color fetching (see seriesColor.js).\n colorAlpha: null,\n colorSaturation: null,\n colorMappingBy: 'index',\n visibleMin: 10,\n // be rendered. Only works when sort is 'asc' or 'desc'.\n childrenVisibleMin: null,\n // grandchildren will not show.\n // Why grandchildren? If not grandchildren but children,\n // some siblings show children and some not,\n // the appearance may be mess and not consistent,\n levels: [] // Each item: {\n // visibleMin, itemStyle, visualDimension, label\n // }\n // data: {\n // value: [],\n // children: [],\n // link: 'http://xxx.xxx.xxx',\n // target: 'blank' or 'self'\n // }\n\n };\n return TreemapSeriesModel;\n}(SeriesModel);\n/**\n * @param {Object} dataNode\n */\n\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\n * set default to level configuration\n */\n\n\nfunction setDefault(levels, ecModel) {\n var globalColorList = normalizeToArray(ecModel.get('color'));\n var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n\n if (!globalColorList) {\n return;\n }\n\n levels = levels || [];\n var hasColorDefine;\n var hasDecalDefine;\n zrUtil.each(levels, function (levelDefine) {\n var model = new Model(levelDefine);\n var modelColor = model.get('color');\n var modelDecal = model.get('decal');\n\n if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') {\n hasColorDefine = true;\n }\n\n if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') {\n hasDecalDefine = true;\n }\n });\n var level0 = levels[0] || (levels[0] = {});\n\n if (!hasColorDefine) {\n level0.color = globalColorList.slice();\n }\n\n if (!hasDecalDefine && globalDecalList) {\n level0.decal = globalDecalList.slice();\n }\n\n return levels;\n}\n\nexport default TreemapSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport * as layout from '../../util/layout';\nimport { wrapTreePathInfo } from '../helper/treeHelper';\nimport { curry, defaults } from 'zrender/lib/core/util';\nimport { convertOptionIdName } from '../../util/model';\nimport { Z2_EMPHASIS_LIFT } from '../../util/states';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\n\nvar Breadcrumb =\n/** @class */\nfunction () {\n function Breadcrumb(containerGroup) {\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n }\n\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n\n if (!model.get('show') || !targetNode) {\n return;\n }\n\n var normalStyleModel = model.getModel('itemStyle'); // let emphasisStyleModel = model.getModel('emphasis.itemStyle');\n\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n\n this._prepare(targetNode, layoutParam, textStyleModel);\n\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\n\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n };\n /**\n * Prepare render list and total width\n * @private\n */\n\n\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = convertOptionIdName(node.getModel().get('name'), '');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n };\n /**\n * @private\n */\n\n\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get(['breadcrumb', 'height']);\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text; // Hdie text and shorten width if necessary.\n\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel'\n }),\n textContent: new graphic.Text({\n style: {\n text: text,\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }\n }),\n textConfig: {\n position: 'inside'\n },\n z2: Z2_EMPHASIS_LIFT * 1e4,\n onclick: curry(onSelect, itemNode)\n });\n el.disableLabelAnimation = true;\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n };\n\n Breadcrumb.prototype.remove = function () {\n this.group.removeAll();\n };\n\n return Breadcrumb;\n}();\n\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n} // Package custom mouse event.\n\n\nfunction packEventData(el, seriesModel, itemNode) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.componentIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\n\nexport default Breadcrumb;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Animate multiple elements with a single done-callback.\n *\n * @example\n * animation\n * .createWrap()\n * .add(el1, {x: 10, y: 10})\n * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\n * .done(function () { // done })\n * .start('cubicOut');\n */\nvar AnimationWrap =\n/** @class */\nfunction () {\n function AnimationWrap() {\n this._storage = [];\n this._elExistsMap = {};\n }\n /**\n * Caution: a el can only be added once, otherwise 'done'\n * might not be called. This method checks this (by el.id),\n * suppresses adding and returns false when existing el found.\n *\n * @return Whether adding succeeded.\n */\n\n\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\n if (this._elExistsMap[el.id]) {\n return false;\n }\n\n this._elExistsMap[el.id] = true;\n\n this._storage.push({\n el: el,\n target: target,\n duration: duration,\n delay: delay,\n easing: easing\n });\n\n return true;\n };\n /**\n * Only execute when animation done/aborted.\n */\n\n\n AnimationWrap.prototype.finished = function (callback) {\n this._finishedCallback = callback;\n return this;\n };\n /**\n * Will stop exist animation firstly.\n */\n\n\n AnimationWrap.prototype.start = function () {\n var _this = this;\n\n var count = this._storage.length;\n\n var checkTerminate = function () {\n count--;\n\n if (count <= 0) {\n // Guard.\n _this._storage.length = 0;\n _this._elExistsMap = {};\n _this._finishedCallback && _this._finishedCallback();\n }\n };\n\n for (var i = 0, len = this._storage.length; i < len; i++) {\n var item = this._storage[i];\n item.el.animateTo(item.target, {\n duration: item.duration,\n delay: item.delay,\n easing: item.easing,\n setToFinal: true,\n done: checkTerminate,\n aborted: checkTerminate\n });\n }\n\n return this;\n };\n\n return AnimationWrap;\n}();\n\nexport function createWrap() {\n return new AnimationWrap();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, indexOf, curry, extend, normalizeCssArray, isFunction } from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport { isHighDownDispatcher, setAsHighDownDispatcher, setDefaultStateProxy, enableHoverFocus, Z2_EMPHASIS_LIFT } from '../../util/states';\nimport DataDiffer from '../../data/DataDiffer';\nimport * as helper from '../helper/treeHelper';\nimport Breadcrumb from './Breadcrumb';\nimport RoamController from '../../component/helper/RoamController';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as animationUtil from '../../util/animation';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper';\nimport ChartView from '../../view/Chart';\nimport Displayable from 'zrender/lib/graphic/Displayable';\nimport { makeInner, convertOptionIdName } from '../../util/model';\nimport { windowOpen } from '../../util/format';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = 'label';\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel'; // Should larger than emphasis states lift z\n\nvar Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\n\nvar Z2_BG = Z2_EMPHASIS_LIFT * 2;\nvar Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\nvar getStateItemStyle = makeStyleMapper([['fill', 'color'], // `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n]);\n\nvar getItemStyleNormal = function (model) {\n // Normal style props should include emphasis style props.\n var itemStyle = getStateItemStyle(model); // Clear styles set by emphasis.\n\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n return itemStyle;\n};\n\nvar inner = makeInner();\n\nvar TreemapView =\n/** @class */\nfunction (_super) {\n __extends(TreemapView, _super);\n\n function TreemapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapView.type;\n _this._state = 'ready';\n _this._storage = createStorage();\n return _this;\n }\n /**\n * @override\n */\n\n\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var models = ecModel.findComponents({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n });\n\n if (indexOf(models, seriesModel) < 0) {\n return;\n }\n\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var payloadType = payload && payload.type;\n var layoutInfo = seriesModel.layoutInfo;\n var isInit = !this._oldTree;\n var thisStorage = this._storage; // Mark new root when action is treemapRootToNode.\n\n var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n direction: payload.direction\n } : null;\n\n var containerGroup = this._giveContainerGroup(layoutInfo);\n\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n\n !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n\n this._resetController(api);\n\n this._renderBreadcrumb(seriesModel, api, targetInfo);\n };\n\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\n var containerGroup = this._containerGroup;\n\n if (!containerGroup) {\n // FIXME\n // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。\n containerGroup = this._containerGroup = new Group();\n\n this._initEvents(containerGroup);\n\n this.group.add(containerGroup);\n }\n\n containerGroup.x = layoutInfo.x;\n containerGroup.y = layoutInfo.y;\n return containerGroup;\n };\n\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\n var thisTree = seriesModel.getData().tree;\n var oldTree = this._oldTree; // Clear last shape records.\n\n var lastsForAnimation = createStorage();\n var thisStorage = createStorage();\n var oldStorage = this._storage;\n var willInvisibleEls = [];\n\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\n } // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow),\n // the oldTree is actually losted, so we can not find all of the old graphic\n // elements from tree. So we use this stragegy: make element storage, move\n // from old storage to new storage, clear old storage.\n\n\n dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing.\n\n var willDeleteEls = clearStorage(oldStorage);\n this._oldTree = thisTree;\n this._storage = thisStorage;\n return {\n lastsForAnimation: lastsForAnimation,\n willDeleteEls: willDeleteEls,\n renderFinally: renderFinally\n };\n\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n // When 'render' is triggered by action,\n // 'this' and 'old' may be the same tree,\n // we use rawIndex in that case.\n if (sameTree) {\n oldViewChildren = thisViewChildren;\n each(thisViewChildren, function (child, index) {\n !child.isRemoved() && processNode(index, index);\n });\n } // Diff hierarchically (diff only in each subtree, but not whole).\n // because, consistency of view is important.\n else {\n new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute();\n }\n\n function getKey(node) {\n // Identify by name or raw index.\n return node.getId();\n }\n\n function processNode(newIndex, oldIndex) {\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n }\n }\n\n function clearStorage(storage) {\n var willDeleteEls = createStorage();\n storage && each(storage, function (store, storageName) {\n var delEls = willDeleteEls[storageName];\n each(store, function (el) {\n el && (delEls.push(el), inner(el).willDelete = true);\n });\n });\n return willDeleteEls;\n }\n\n function renderFinally() {\n each(willDeleteEls, function (els) {\n each(els, function (el) {\n el.parent && el.parent.remove(el);\n });\n });\n each(willInvisibleEls, function (el) {\n el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty,\n // just mark as invisible.\n\n el.dirty();\n });\n }\n };\n\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\n if (!seriesModel.get('animation')) {\n return;\n }\n\n var durationOption = seriesModel.get('animationDurationUpdate');\n var easingOption = seriesModel.get('animationEasing'); // TODO: do not support function until necessary.\n\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\n var animationWrap = animationUtil.createWrap(); // Make delete animations.\n\n each(renderResult.willDeleteEls, function (store, storageName) {\n each(store, function (el, rawIndex) {\n if (el.invisible) {\n return;\n }\n\n var parent = el.parent; // Always has parent, and parent is nodeGroup.\n\n var target;\n var innerStore = inner(parent);\n\n if (reRoot && reRoot.direction === 'drillDown') {\n target = parent === reRoot.rootNodeGroup // This is the content element of view root.\n // Only `content` will enter this branch, because\n // `background` and `nodeGroup` will not be deleted.\n ? {\n shape: {\n x: 0,\n y: 0,\n width: innerStore.nodeWidth,\n height: innerStore.nodeHeight\n },\n style: {\n opacity: 0\n }\n } // Others.\n : {\n style: {\n opacity: 0\n }\n };\n } else {\n var targetX = 0;\n var targetY = 0;\n\n if (!innerStore.willDelete) {\n // Let node animate to right-bottom corner, cooperating with fadeout,\n // which is appropriate for user understanding.\n // Divided by 2 for reRoot rolling up effect.\n targetX = innerStore.nodeWidth / 2;\n targetY = innerStore.nodeHeight / 2;\n }\n\n target = storageName === 'nodeGroup' ? {\n x: targetX,\n y: targetY,\n style: {\n opacity: 0\n }\n } : {\n shape: {\n x: targetX,\n y: targetY,\n width: 0,\n height: 0\n },\n style: {\n opacity: 0\n }\n };\n } // TODO: do not support delay until necessary.\n\n\n target && animationWrap.add(el, target, duration, 0, easing);\n });\n }); // Make other animations\n\n each(this._storage, function (store, storageName) {\n each(store, function (el, rawIndex) {\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\n var target = {};\n\n if (!last) {\n return;\n }\n\n if (el instanceof graphic.Group) {\n if (last.oldX != null) {\n target.x = el.x;\n target.y = el.y;\n el.x = last.oldX;\n el.y = last.oldY;\n }\n } else {\n if (last.oldShape) {\n target.shape = extend({}, el.shape);\n el.setShape(last.oldShape);\n }\n\n if (last.fadein) {\n el.setStyle('opacity', 0);\n target.style = {\n opacity: 1\n };\n } // When animation is stopped for succedent animation starting,\n // el.style.opacity might not be 1\n else if (el.style.opacity !== 1) {\n target.style = {\n opacity: 1\n };\n }\n }\n\n animationWrap.add(el, target, duration, 0, easing);\n });\n }, this);\n this._state = 'animating';\n animationWrap.finished(bind(function () {\n this._state = 'ready';\n renderResult.renderFinally();\n }, this)).start();\n };\n\n TreemapView.prototype._resetController = function (api) {\n var controller = this._controller; // Init controller.\n\n if (!controller) {\n controller = this._controller = new RoamController(api.getZr());\n controller.enable(this.seriesModel.get('roam'));\n controller.on('pan', bind(this._onPan, this));\n controller.on('zoom', bind(this._onZoom, this));\n }\n\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\n controller.setPointerChecker(function (e, x, y) {\n return rect.contain(x, y);\n });\n };\n\n TreemapView.prototype._clearController = function () {\n var controller = this._controller;\n\n if (controller) {\n controller.dispose();\n controller = null;\n }\n };\n\n TreemapView.prototype._onPan = function (e) {\n if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n this.api.dispatchAction({\n type: 'treemapMove',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rootLayout.x + e.dx,\n y: rootLayout.y + e.dy,\n width: rootLayout.width,\n height: rootLayout.height\n }\n });\n }\n };\n\n TreemapView.prototype._onZoom = function (e) {\n var mouseX = e.originX;\n var mouseY = e.originY;\n\n if (this._state !== 'animating') {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup.\n\n mouseX -= layoutInfo.x;\n mouseY -= layoutInfo.y; // Scale root bounding rect.\n\n var m = matrix.create();\n matrix.translate(m, m, [-mouseX, -mouseY]);\n matrix.scale(m, m, [e.scale, e.scale]);\n matrix.translate(m, m, [mouseX, mouseY]);\n rect.applyTransform(m);\n this.api.dispatchAction({\n type: 'treemapRender',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n }\n };\n\n TreemapView.prototype._initEvents = function (containerGroup) {\n var _this = this;\n\n containerGroup.on('click', function (e) {\n if (_this._state !== 'ready') {\n return;\n }\n\n var nodeClick = _this.seriesModel.get('nodeClick', true);\n\n if (!nodeClick) {\n return;\n }\n\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\n\n if (!targetInfo) {\n return;\n }\n\n var node = targetInfo.node;\n\n if (node.getLayout().isLeafRoot) {\n _this._rootToNode(targetInfo);\n } else {\n if (nodeClick === 'zoomToNode') {\n _this._zoomToNode(targetInfo);\n } else if (nodeClick === 'link') {\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n var link = itemModel.get('link', true);\n var linkTarget = itemModel.get('target', true) || 'blank';\n link && windowOpen(link, linkTarget);\n }\n }\n }, this);\n };\n\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\n var _this = this;\n\n if (!targetInfo) {\n targetInfo = seriesModel.get('leafDepth', true) != null ? {\n node: seriesModel.getViewRoot()\n } // FIXME\n // better way?\n // Find breadcrumb tail on center of containerGroup.\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n\n if (!targetInfo) {\n targetInfo = {\n node: seriesModel.getData().tree.root\n };\n }\n }\n\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) {\n if (_this._state !== 'animating') {\n helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({\n node: node\n }) : _this._zoomToNode({\n node: node\n });\n }\n });\n };\n /**\n * @override\n */\n\n\n TreemapView.prototype.remove = function () {\n this._clearController();\n\n this._containerGroup && this._containerGroup.removeAll();\n this._storage = createStorage();\n this._state = 'ready';\n this._breadcrumb && this._breadcrumb.remove();\n };\n\n TreemapView.prototype.dispose = function () {\n this._clearController();\n };\n\n TreemapView.prototype._zoomToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapZoomToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n\n TreemapView.prototype._rootToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapRootToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n /**\n * @public\n * @param {number} x Global coord x.\n * @param {number} y Global coord y.\n * @return {Object} info If not found, return undefined;\n * @return {number} info.node Target node.\n * @return {number} info.offsetX x refer to target node.\n * @return {number} info.offsetY y refer to target node.\n */\n\n\n TreemapView.prototype.findTarget = function (x, y) {\n var targetInfo;\n var viewRoot = this.seriesModel.getViewRoot();\n viewRoot.eachNode({\n attr: 'viewChildren',\n order: 'preorder'\n }, function (node) {\n var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element.\n\n\n if (bgEl) {\n var point = bgEl.transformCoordToLocal(x, y);\n var shape = bgEl.shape; // For performance consideration, dont use 'getBoundingRect'.\n\n if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n targetInfo = {\n node: node,\n offsetX: point[0],\n offsetY: point[1]\n };\n } else {\n return false; // Suppress visit subtree.\n }\n }\n }, this);\n return targetInfo;\n };\n\n TreemapView.type = 'treemap';\n return TreemapView;\n}(ChartView);\n/**\n * @inner\n */\n\n\nfunction createStorage() {\n return {\n nodeGroup: [],\n background: [],\n content: []\n };\n}\n/**\n * @inner\n * @return Return undefined means do not travel further.\n */\n\n\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n // Whether under viewRoot.\n if (!thisNode) {\n // Deleting nodes will be performed finally. This method just find\n // element from old storage, or create new element, set them to new\n // storage, and set styles.\n return;\n } // -------------------------------------------------------------------\n // Start of closure variables available in \"Procedures in renderNode\".\n\n\n var thisLayout = thisNode.getLayout();\n var data = seriesModel.getData();\n var nodeModel = thisNode.getModel(); // Only for enabling highlight/downplay. Clear firstly.\n // Because some node will not be rendered.\n\n data.setItemGraphicEl(thisNode.dataIndex, null);\n\n if (!thisLayout || !thisLayout.isInView) {\n return;\n }\n\n var thisWidth = thisLayout.width;\n var thisHeight = thisLayout.height;\n var borderWidth = thisLayout.borderWidth;\n var thisInvisible = thisLayout.invisible;\n var thisRawIndex = thisNode.getRawIndex();\n var oldRawIndex = oldNode && oldNode.getRawIndex();\n var thisViewChildren = thisNode.viewChildren;\n var upperHeight = thisLayout.upperHeight;\n var isParent = thisViewChildren && thisViewChildren.length;\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; // End of closure ariables available in \"Procedures in renderNode\".\n // -----------------------------------------------------------------\n // Node group\n\n var group = giveGraphic('nodeGroup', Group);\n\n if (!group) {\n return;\n }\n\n parentGroup.add(group); // x,y are not set when el is above view root.\n\n group.x = thisLayout.x || 0;\n group.y = thisLayout.y || 0;\n group.markRedraw();\n inner(group).nodeWidth = thisWidth;\n inner(group).nodeHeight = thisHeight;\n\n if (thisLayout.isAboveViewRoot) {\n return group;\n } // Background\n\n\n var bg = giveGraphic('background', Rect, depth, Z2_BG);\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\n var focus = nodeModel.get(['emphasis', 'focus']);\n var blurScope = nodeModel.get(['emphasis', 'blurScope']);\n var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; // No children, render content.\n\n if (isParent) {\n // Because of the implementation about \"traverse\" in graphic hover style, we\n // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\n // hover event from the descendents will be listenered.\n if (isHighDownDispatcher(group)) {\n setAsHighDownDispatcher(group, false);\n }\n\n if (bg) {\n setAsHighDownDispatcher(bg, true); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, bg);\n enableHoverFocus(bg, focusOrIndices, blurScope);\n }\n } else {\n var content = giveGraphic('content', Rect, depth, Z2_CONTENT);\n content && renderContent(group, content);\n\n if (bg && isHighDownDispatcher(bg)) {\n setAsHighDownDispatcher(bg, false);\n }\n\n setAsHighDownDispatcher(group, true); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, group);\n enableHoverFocus(group, focusOrIndices, blurScope);\n }\n\n return group; // ----------------------------\n // | Procedures in renderNode |\n // ----------------------------\n\n function renderBackground(group, bg, useUpperLabel) {\n var ecData = getECData(bg); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var style = thisNode.getVisual('style');\n var visualBorderColor = style.stroke;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText( // PENDING: convert ZRColor to ColorString for text.\n bg, visualBorderColor, style.opacity, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n bg.removeTextContent();\n }\n\n bg.setStyle(normalStyle);\n bg.ensureState('emphasis').style = emphasisStyle;\n bg.ensureState('blur').style = blurStyle;\n bg.ensureState('select').style = selectStyle;\n setDefaultStateProxy(bg);\n }\n\n group.add(bg);\n }\n\n function renderContent(group, content) {\n var ecData = getECData(content); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n content.culling = true;\n content.setShape({\n x: borderWidth,\n y: borderWidth,\n width: contentWidth,\n height: contentHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(content);\n } else {\n content.invisible = false;\n var nodeStyle = thisNode.getVisual('style');\n var visualColor = nodeStyle.fill;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualColor;\n normalStyle.decal = nodeStyle.decal;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n var selectStyle = getStateItemStyle(itemStyleSelectModel); // PENDING: convert ZRColor to ColorString for text.\n\n prepareText(content, visualColor, nodeStyle.opacity, null);\n content.setStyle(normalStyle);\n content.ensureState('emphasis').style = emphasisStyle;\n content.ensureState('blur').style = blurStyle;\n content.ensureState('select').style = selectStyle;\n setDefaultStateProxy(content);\n }\n\n group.add(content);\n }\n\n function processInvisible(element) {\n // Delay invisible setting utill animation finished,\n // avoid element vanish suddenly before animation.\n !element.invisible && willInvisibleEls.push(element);\n }\n\n function prepareText(rectEl, visualColor, visualOpacity, // Can be null/undefined\n upperLabelRect) {\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n var defaultText = convertOptionIdName(nodeModel.get('name'), null);\n var isShow = normalLabelModel.getShallow('show');\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\n defaultText: isShow ? defaultText : null,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n labelFetcher: seriesModel,\n labelDataIndex: thisNode.dataIndex\n });\n var textEl = rectEl.getTextContent();\n var textStyle = textEl.style;\n var textPadding = normalizeCssArray(textStyle.padding || 0);\n\n if (upperLabelRect) {\n rectEl.setTextConfig({\n layoutRect: upperLabelRect\n });\n textEl.disableLabelLayout = true;\n }\n\n textEl.beforeUpdate = function () {\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\n\n if (textStyle.width !== width || textStyle.height !== height) {\n textEl.setStyle({\n width: width,\n height: height\n });\n }\n };\n\n textStyle.truncateMinChar = 2;\n textStyle.lineOverflow = 'truncate';\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\n var textEmphasisState = textEl.getState('emphasis');\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\n }\n\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\n var text = style ? style.text : null;\n\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\n var iconChar = seriesModel.get('drillDownIcon', true);\n style.text = iconChar ? iconChar + ' ' + text : text;\n }\n }\n\n function giveGraphic(storageName, Ctor, depth, z) {\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n var lasts = lastsForAnimation[storageName];\n\n if (element) {\n // Remove from oldStorage\n oldStorage[storageName][oldRawIndex] = null;\n prepareAnimationWhenHasOld(lasts, element);\n } // If invisible and no old element, do not create new element (for optimizing).\n else if (!thisInvisible) {\n element = new Ctor();\n\n if (element instanceof Displayable) {\n element.z2 = calculateZ2(depth, z);\n }\n\n prepareAnimationWhenNoOld(lasts, element);\n } // Set to thisStorage\n\n\n return thisStorage[storageName][thisRawIndex] = element;\n }\n\n function prepareAnimationWhenHasOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n\n if (element instanceof Group) {\n lastCfg.oldX = element.x;\n lastCfg.oldY = element.y;\n } else {\n lastCfg.oldShape = extend({}, element.shape);\n }\n } // If a element is new, we need to find the animation start point carefully,\n // otherwise it will looks strange when 'zoomToNode'.\n\n\n function prepareAnimationWhenNoOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n var parentNode = thisNode.parentNode;\n var isGroup = element instanceof graphic.Group;\n\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n var parentOldX = 0;\n var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n // For convenience, get old bounding rect from background.\n\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\n parentOldX = parentOldBg.oldShape.width;\n parentOldY = parentOldBg.oldShape.height;\n } // When no parent old shape found, its parent is new too,\n // so we can just use {x:0, y:0}.\n\n\n if (isGroup) {\n lastCfg.oldX = 0;\n lastCfg.oldY = parentOldY;\n } else {\n lastCfg.oldShape = {\n x: parentOldX,\n y: parentOldY,\n width: 0,\n height: 0\n };\n }\n } // Fade in, user can be aware that these nodes are new.\n\n\n lastCfg.fadein = !isGroup;\n }\n} // We can not set all backgroud with the same z, Because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause that lowser background element overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\n\n\nfunction calculateZ2(depth, z2InLevel) {\n return depth * Z2_BASE + z2InLevel;\n}\n\nexport default TreemapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as zrColor from 'zrender/lib/tool/color';\nimport { linearMap } from '../util/number';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\n\nvar VisualMapping =\n/** @class */\nfunction () {\n function VisualMapping(option) {\n var mappingMethod = option.mappingMethod;\n var visualType = option.type;\n var thisOption = this.option = zrUtil.clone(option);\n this.type = visualType;\n this.mappingMethod = mappingMethod;\n this._normalizeData = normalizers[mappingMethod];\n var visualHandler = VisualMapping.visualHandlers[visualType];\n this.applyVisual = visualHandler.applyVisual;\n this.getColorMapper = visualHandler.getColorMapper;\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\n\n if (mappingMethod === 'piecewise') {\n normalizeVisualRange(thisOption);\n preprocessForPiecewise(thisOption);\n } else if (mappingMethod === 'category') {\n thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified,\n // which need no more preprocess except normalize visual.\n : normalizeVisualRange(thisOption, true);\n } else {\n // mappingMethod === 'linear' or 'fixed'\n zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\n normalizeVisualRange(thisOption);\n }\n }\n\n VisualMapping.prototype.mapValueToVisual = function (value) {\n var normalized = this._normalizeData(value);\n\n return this._normalizedToVisual(normalized, value);\n };\n\n VisualMapping.prototype.getNormalizer = function () {\n return zrUtil.bind(this._normalizeData, this);\n };\n /**\n * List available visual types.\n *\n * @public\n * @return {Array.<string>}\n */\n\n\n VisualMapping.listVisualTypes = function () {\n return zrUtil.keys(VisualMapping.visualHandlers);\n }; // /**\n // * @public\n // */\n // static addVisualHandler(name, handler) {\n // visualHandlers[name] = handler;\n // }\n\n /**\n * @public\n */\n\n\n VisualMapping.isValidType = function (visualType) {\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\n };\n /**\n * Convinent method.\n * Visual can be Object or Array or primary type.\n */\n\n\n VisualMapping.eachVisual = function (visual, callback, context) {\n if (zrUtil.isObject(visual)) {\n zrUtil.each(visual, callback, context);\n } else {\n callback.call(context, visual);\n }\n };\n\n VisualMapping.mapVisual = function (visual, callback, context) {\n var isPrimary;\n var newVisual = zrUtil.isArray(visual) ? [] : zrUtil.isObject(visual) ? {} : (isPrimary = true, null);\n VisualMapping.eachVisual(visual, function (v, key) {\n var newVal = callback.call(context, v, key);\n isPrimary ? newVisual = newVal : newVisual[key] = newVal;\n });\n return newVisual;\n };\n /**\n * Retrieve visual properties from given object.\n */\n\n\n VisualMapping.retrieveVisuals = function (obj) {\n var ret = {};\n var hasVisual;\n obj && each(VisualMapping.visualHandlers, function (h, visualType) {\n if (obj.hasOwnProperty(visualType)) {\n ret[visualType] = obj[visualType];\n hasVisual = true;\n }\n });\n return hasVisual ? ret : null;\n };\n /**\n * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\n *\n * @public\n * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\n * IF Array, like: ['color', 'symbol', 'colorSaturation']\n * @return {Array.<string>} Sorted visual types.\n */\n\n\n VisualMapping.prepareVisualTypes = function (visualTypes) {\n if (zrUtil.isArray(visualTypes)) {\n visualTypes = visualTypes.slice();\n } else if (isObject(visualTypes)) {\n var types_1 = [];\n each(visualTypes, function (item, type) {\n types_1.push(type);\n });\n visualTypes = types_1;\n } else {\n return [];\n }\n\n visualTypes.sort(function (type1, type2) {\n // color should be front of colorSaturation, colorAlpha, ...\n // symbol and symbolSize do not matter.\n return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1;\n });\n return visualTypes;\n };\n /**\n * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\n * Other visuals are only depends on themself.\n */\n\n\n VisualMapping.dependsOn = function (visualType1, visualType2) {\n return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;\n };\n /**\n * @param value\n * @param pieceList [{value: ..., interval: [min, max]}, ...]\n * Always from small to big.\n * @param findClosestWhenOutside Default to be false\n * @return index\n */\n\n\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\n var possibleI;\n var abs = Infinity; // value has the higher priority.\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var pieceValue = pieceList[i].value;\n\n if (pieceValue != null) {\n if (pieceValue === value // FIXME\n // It is supposed to compare value according to value type of dimension,\n // but currently value type can exactly be string or number.\n // Compromise for numeric-like string (like '12'), especially\n // in the case that visualMap.categories is ['22', '33'].\n || typeof pieceValue === 'string' && pieceValue === value + '') {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(pieceValue, i);\n }\n }\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var piece = pieceList[i];\n var interval = piece.interval;\n var close_1 = piece.close;\n\n if (interval) {\n if (interval[0] === -Infinity) {\n if (littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n } else if (interval[1] === Infinity) {\n if (littleThan(close_1[0], interval[0], value)) {\n return i;\n }\n } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(interval[0], i);\n findClosestWhenOutside && updatePossible(interval[1], i);\n }\n }\n\n if (findClosestWhenOutside) {\n return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;\n }\n\n function updatePossible(val, index) {\n var newAbs = Math.abs(val - value);\n\n if (newAbs < abs) {\n abs = newAbs;\n possibleI = index;\n }\n }\n };\n\n VisualMapping.visualHandlers = {\n color: {\n applyVisual: makeApplyVisual('color'),\n getColorMapper: function () {\n var thisOption = this.option;\n return zrUtil.bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) {\n !isNormalized && (value = this._normalizeData(value));\n return doMapCategory.call(this, value);\n } : function (value, isNormalized, out) {\n // If output rgb array\n // which will be much faster and useful in pixel manipulation\n var returnRGBArray = !!out;\n !isNormalized && (value = this._normalizeData(value));\n out = zrColor.fastLerp(value, thisOption.parsedVisual, out);\n return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\n }, this);\n },\n _normalizedToVisual: {\n linear: function (normalized) {\n return zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n colorHue: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, value);\n }),\n colorSaturation: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, value);\n }),\n colorLightness: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, null, value);\n }),\n colorAlpha: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyAlpha(color, value);\n }),\n decal: {\n applyVisual: makeApplyVisual('decal'),\n _normalizedToVisual: {\n linear: null,\n category: doMapCategory,\n piecewise: null,\n fixed: null\n }\n },\n opacity: {\n applyVisual: makeApplyVisual('opacity'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n },\n liftZ: {\n applyVisual: makeApplyVisual('liftZ'),\n _normalizedToVisual: {\n linear: doMapFixed,\n category: doMapFixed,\n piecewise: doMapFixed,\n fixed: doMapFixed\n }\n },\n symbol: {\n applyVisual: function (value, getter, setter) {\n var symbolCfg = this.mapValueToVisual(value);\n setter('symbol', symbolCfg);\n },\n _normalizedToVisual: {\n linear: doMapToArray,\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = doMapToArray.call(this, normalized);\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n symbolSize: {\n applyVisual: makeApplyVisual('symbolSize'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n }\n };\n return VisualMapping;\n}();\n\nfunction preprocessForPiecewise(thisOption) {\n var pieceList = thisOption.pieceList;\n thisOption.hasSpecialVisual = false;\n zrUtil.each(pieceList, function (piece, index) {\n piece.originIndex = index; // piece.visual is \"result visual value\" but not\n // a visual range, so it does not need to be normalized.\n\n if (piece.visual != null) {\n thisOption.hasSpecialVisual = true;\n }\n });\n}\n\nfunction preprocessForSpecifiedCategory(thisOption) {\n // Hash categories.\n var categories = thisOption.categories;\n var categoryMap = thisOption.categoryMap = {};\n var visual = thisOption.visual;\n each(categories, function (cate, index) {\n categoryMap[cate] = index;\n }); // Process visual map input.\n\n if (!zrUtil.isArray(visual)) {\n var visualArr_1 = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v, cate) {\n var index = categoryMap[cate];\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\n });\n } else {\n // Is primary type, represents default visual.\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\n }\n\n visual = setVisualToOption(thisOption, visualArr_1);\n } // Remove categories that has no visual,\n // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\n\n\n for (var i = categories.length - 1; i >= 0; i--) {\n if (visual[i] == null) {\n delete categoryMap[categories[i]];\n categories.pop();\n }\n }\n}\n\nfunction normalizeVisualRange(thisOption, isCategory) {\n var visual = thisOption.visual;\n var visualArr = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v) {\n visualArr.push(v);\n });\n } else if (visual != null) {\n visualArr.push(visual);\n }\n\n var doNotNeedPair = {\n color: 1,\n symbol: 1\n };\n\n if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\n // Do not care visualArr.length === 0, which is illegal.\n visualArr[1] = visualArr[0];\n }\n\n setVisualToOption(thisOption, visualArr);\n}\n\nfunction makePartialColorVisualHandler(applyValue) {\n return {\n applyVisual: function (value, getter, setter) {\n // Only used in HSL\n var colorChannel = this.mapValueToVisual(value); // Must not be array value\n\n setter('color', applyValue(getter('color'), colorChannel));\n },\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n };\n}\n\nfunction doMapToArray(normalized) {\n var visual = this.option.visual;\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}?\n}\n\nfunction makeApplyVisual(visualType) {\n return function (value, getter, setter) {\n setter(visualType, this.mapValueToVisual(value));\n };\n}\n\nfunction doMapCategory(normalized) {\n var visual = this.option.visual;\n return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];\n}\n\nfunction doMapFixed() {\n // visual will be convert to array.\n return this.option.visual[0];\n}\n/**\n * Create mapped to numeric visual\n */\n\n\nfunction createNormalizedToNumericVisual(sourceExtent) {\n return {\n linear: function (normalized) {\n return linearMap(normalized, sourceExtent, this.option.visual, true);\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\n }\n\n return result;\n },\n fixed: doMapFixed\n };\n}\n\nfunction getSpecifiedVisual(value) {\n var thisOption = this.option;\n var pieceList = thisOption.pieceList;\n\n if (thisOption.hasSpecialVisual) {\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\n var piece = pieceList[pieceIndex];\n\n if (piece && piece.visual) {\n return piece.visual[this.type];\n }\n }\n}\n\nfunction setVisualToOption(thisOption, visualArr) {\n thisOption.visual = visualArr;\n\n if (thisOption.type === 'color') {\n thisOption.parsedVisual = zrUtil.map(visualArr, function (item) {\n return zrColor.parse(item);\n });\n }\n\n return visualArr;\n}\n/**\n * Normalizers by mapping methods.\n */\n\n\nvar normalizers = {\n linear: function (value) {\n return linearMap(value, this.option.dataExtent, [0, 1], true);\n },\n piecewise: function (value) {\n var pieceList = this.option.pieceList;\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\n\n if (pieceIndex != null) {\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\n }\n },\n category: function (value) {\n var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value\n\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\n },\n fixed: zrUtil.noop\n};\n\nfunction littleThan(close, a, b) {\n return close ? a <= b : a < b;\n}\n\nexport default VisualMapping;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport VisualMapping from '../../visual/VisualMapping';\nimport { each, extend, isArray } from 'zrender/lib/core/util';\nimport { modifyHSL, modifyAlpha } from 'zrender/lib/tool/color';\nimport { makeInner } from '../../util/model';\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar inner = makeInner();\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel) {\n var tree = seriesModel.getData().tree;\n var root = tree.root;\n\n if (root.isRemoved()) {\n return;\n }\n\n travelTree(root, // Visual should calculate from tree root but not view root.\n {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\n }\n};\n\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\n var nodeModel = node.getModel();\n var nodeLayout = node.getLayout();\n var data = node.hostTree.data; // Optimize\n\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n return;\n }\n\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); // calculate border color\n\n var borderColor = nodeItemStyleModel.get('borderColor');\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n var thisNodeColor;\n\n if (borderColorSaturation != null) {\n // For performance, do not always execute 'calculateColor'.\n thisNodeColor = calculateColor(visuals);\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n }\n\n existsStyle.stroke = borderColor;\n var viewChildren = node.viewChildren;\n\n if (!viewChildren || !viewChildren.length) {\n thisNodeColor = calculateColor(visuals); // Apply visual to this node.\n\n existsStyle.fill = thisNodeColor;\n } else {\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children.\n\n each(viewChildren, function (child, index) {\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\n }\n });\n }\n}\n\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\n var visuals = extend({}, designatedVisual);\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\n var val = nodeItemStyleModel.get(visualName);\n designatedVisualItemStyle[visualName] = null;\n val != null && (visuals[visualName] = val);\n });\n return visuals;\n}\n\nfunction calculateColor(visuals) {\n var color = getValueVisualDefine(visuals, 'color');\n\n if (color) {\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n\n if (colorSaturation) {\n color = modifyHSL(color, null, null, colorSaturation);\n }\n\n if (colorAlpha) {\n color = modifyAlpha(color, colorAlpha);\n }\n\n return color;\n }\n}\n\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n return thisNodeColor != null // Can only be string\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\n\nfunction getValueVisualDefine(visuals, name) {\n var value = visuals[name];\n\n if (value != null && value !== 'none') {\n return value;\n }\n}\n\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n if (!viewChildren || !viewChildren.length) {\n return;\n }\n\n var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n\n if (!rangeVisual) {\n return;\n }\n\n var visualMin = nodeModel.get('visualMin');\n var visualMax = nodeModel.get('visualMax');\n var dataExtent = nodeLayout.dataExtent.slice();\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n var colorMappingBy = nodeModel.get('colorMappingBy');\n var opt = {\n type: rangeVisual.name,\n dataExtent: dataExtent,\n visual: rangeVisual.range\n };\n\n if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n opt.mappingMethod = 'category';\n opt.loop = true; // categories is ordinal, so do not set opt.categories.\n } else {\n opt.mappingMethod = 'linear';\n }\n\n var mapping = new VisualMapping(opt);\n inner(mapping).drColorMappingBy = colorMappingBy;\n return mapping;\n} // Notice: If we dont have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node dont have children, and its siblings has children,\n// and colorRange is set on level-1, then the node can not be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\n\n\nfunction getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}\n\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n var childVisuals = extend({}, visuals);\n\n if (mapping) {\n // Only support color, colorAlpha, colorSaturation.\n var mappingType = mapping.type;\n var colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\n var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\n }\n\n return childVisuals;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The treemap layout implementation was originally copied from\n* \"d3.js\" with some modifications made for this project.\n* (See more details in the comment of the method \"squarify\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { parsePercent, MAX_SAFE_INTEGER } from '../../util/number';\nimport * as layout from '../../util/layout';\nimport * as helper from '../helper/treeHelper';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n;\n/**\n * @public\n */\n\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n // Layout result in each node:\n // {x, y, width, height, area, borderWidth}\n var ecWidth = api.getWidth();\n var ecHeight = api.getHeight();\n var seriesOption = seriesModel.option;\n var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n var size = seriesOption.size || []; // Compatible with ec2.\n\n var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);\n var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info.\n\n var payloadType = payload && payload.type;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n var viewRoot = seriesModel.getViewRoot();\n var viewAbovePath = helper.getPathToRoot(viewRoot);\n\n if (payloadType !== 'treemapMove') {\n var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n var sort_1 = seriesOption.sort;\n\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\n // Default to be desc order.\n sort_1 = 'desc';\n }\n\n var options = {\n squareRatio: seriesOption.squareRatio,\n sort: sort_1,\n leafDepth: seriesOption.leafDepth\n }; // layout should be cleared because using updateView but not update.\n\n viewRoot.hostTree.clearLayouts(); // TODO\n // optimize: if out of view clip, do not layout.\n // But take care that if do not render node out of view clip,\n // how to calculate start po\n\n var viewRootLayout_1 = {\n x: 0,\n y: 0,\n width: rootSize[0],\n height: rootSize[1],\n area: rootSize[0] * rootSize[1]\n };\n viewRoot.setLayout(viewRootLayout_1);\n squarify(viewRoot, options, false, 0); // Supplement layout.\n\n viewRootLayout_1 = viewRoot.getLayout();\n each(viewAbovePath, function (node, index) {\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n node.setLayout(zrUtil.extend({\n dataExtent: [childValue, childValue],\n borderWidth: 0,\n upperHeight: 0\n }, viewRootLayout_1));\n });\n }\n\n var treeRoot = seriesModel.getData().tree.root;\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n seriesModel.setLayoutInfo(layoutInfo); // FIXME\n // 现在没有clip功能,暂时取ec高宽。\n\n prunning(treeRoot, // Transform to base element coordinate system.\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\n }\n};\n/**\n * Layout treemap with squarify algorithm.\n * The original presentation of this algorithm\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\n * <https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.\n * The implementation of this algorithm was originally copied from \"d3.js\"\n * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/layout/treemap.js>\n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * @protected\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Object} options\n * @param {string} options.sort 'asc' or 'desc'\n * @param {number} options.squareRatio\n * @param {boolean} hideChildren\n * @param {number} depth\n */\n\nfunction squarify(node, options, hideChildren, depth) {\n var width;\n var height;\n\n if (node.isRemoved()) {\n return;\n }\n\n var thisLayout = node.getLayout();\n width = thisLayout.width;\n height = thisLayout.height; // Considering border and gap\n\n var nodeModel = node.getModel();\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\n var layoutOffset = borderWidth - halfGapWidth;\n var layoutOffsetUpper = upperHeight - halfGapWidth;\n node.setLayout({\n borderWidth: borderWidth,\n upperHeight: upperHeight,\n upperLabelHeight: upperLabelHeight\n }, true);\n width = mathMax(width - 2 * layoutOffset, 0);\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n var totalArea = width * height;\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n\n if (!viewChildren.length) {\n return;\n }\n\n var rect = {\n x: layoutOffset,\n y: layoutOffsetUpper,\n width: width,\n height: height\n };\n var rowFixedLength = mathMin(width, height);\n var best = Infinity; // the best row score so far\n\n var row = [];\n row.area = 0;\n\n for (var i = 0, len = viewChildren.length; i < len;) {\n var child = viewChildren[i];\n row.push(child);\n row.area += child.getLayout().area;\n var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation\n\n if (score <= best) {\n i++;\n best = score;\n } // abort, and try a different orientation\n else {\n row.area -= row.pop().getLayout().area;\n position(row, rowFixedLength, rect, halfGapWidth, false);\n rowFixedLength = mathMin(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n\n if (row.length) {\n position(row, rowFixedLength, rect, halfGapWidth, true);\n }\n\n if (!hideChildren) {\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n hideChildren = true;\n }\n }\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n squarify(viewChildren[i], options, hideChildren, depth + 1);\n }\n}\n/**\n * Set area to each child, and calculate data extent for visual coding.\n */\n\n\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}\n/**\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\n */\n\n\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n // visibleMin is not supported yet when no option.sort.\n if (!orderBy) {\n return sum;\n }\n\n var visibleMin = nodeModel.get('visibleMin');\n var len = orderedChildren.length;\n var deletePoint = len; // Always travel from little value to big value.\n\n for (var i = len - 1; i >= 0; i--) {\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n\n if (value / sum * totalArea < visibleMin) {\n deletePoint = i;\n sum -= value;\n }\n }\n\n orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n return sum;\n}\n/**\n * Sort\n */\n\n\nfunction sort(viewChildren, orderBy) {\n if (orderBy) {\n viewChildren.sort(function (a, b) {\n var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n });\n }\n\n return viewChildren;\n}\n/**\n * Statistic\n */\n\n\nfunction statistic(nodeModel, children, orderBy) {\n // Calculate sum.\n var sum = 0;\n\n for (var i = 0, len = children.length; i < len; i++) {\n sum += children[i].getValue();\n } // Statistic data extent for latter visual coding.\n // Notice: data extent should be calculate based on raw children\n // but not filtered view children, otherwise visual mapping will not\n // be stable when zoom (where children is filtered by visibleMin).\n\n\n var dimension = nodeModel.get('visualDimension');\n var dataExtent; // The same as area dimension.\n\n if (!children || !children.length) {\n dataExtent = [NaN, NaN];\n } else if (dimension === 'value' && orderBy) {\n dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n orderBy === 'asc' && dataExtent.reverse();\n } // Other dimension.\n else {\n dataExtent = [Infinity, -Infinity];\n each(children, function (child) {\n var value = child.getValue(dimension);\n value < dataExtent[0] && (dataExtent[0] = value);\n value > dataExtent[1] && (dataExtent[1] = value);\n });\n }\n\n return {\n sum: sum,\n dataExtent: dataExtent\n };\n}\n/**\n * Computes the score for the specified row,\n * as the worst aspect ratio.\n */\n\n\nfunction worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\n * Positions the specified row of nodes. Modifies `rect`.\n */\n\n\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as default.\n\n\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n // If targetInfo.node exists, we zoom to the node,\n // so estimate whold width and heigth by target node.\n var currNode = (targetInfo || {}).node;\n var defaultSize = [containerWidth, containerHeight];\n\n if (!currNode || currNode === viewRoot) {\n return defaultSize;\n }\n\n var parent;\n var viewArea = containerWidth * containerHeight;\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\n\n while (parent = currNode.parentNode) {\n // jshint ignore:line\n var sum = 0;\n var siblings = parent.children;\n\n for (var i = 0, len = siblings.length; i < len; i++) {\n sum += siblings[i].getValue();\n }\n\n var currNodeValue = currNode.getValue();\n\n if (currNodeValue === 0) {\n return defaultSize;\n }\n\n area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1.\n\n var parentModel = parent.getModel();\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\n area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n currNode = parent;\n }\n\n area < viewArea && (area = viewArea);\n var scale = Math.pow(area / viewArea, 0.5);\n return [containerWidth * scale, containerHeight * scale];\n} // Root postion base on coord of containerGroup\n\n\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n if (rootRect) {\n return {\n x: rootRect.x,\n y: rootRect.y\n };\n }\n\n var defaultPosition = {\n x: 0,\n y: 0\n };\n\n if (!targetInfo) {\n return defaultPosition;\n } // If targetInfo is fetched by 'retrieveTargetInfo',\n // old tree and new tree are the same tree,\n // so the node still exists and we can visit it.\n\n\n var targetNode = targetInfo.node;\n var layout = targetNode.getLayout();\n\n if (!layout) {\n return defaultPosition;\n } // Transform coord from local to container.\n\n\n var targetCenter = [layout.width / 2, layout.height / 2];\n var node = targetNode;\n\n while (node) {\n var nodeLayout = node.getLayout();\n targetCenter[0] += nodeLayout.x;\n targetCenter[1] += nodeLayout.y;\n node = node.parentNode;\n }\n\n return {\n x: layoutInfo.width / 2 - targetCenter[0],\n y: layoutInfo.height / 2 - targetCenter[1]\n };\n} // Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\n\n\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n var nodeLayout = node.getLayout();\n var nodeInViewAbovePath = viewAbovePath[depth];\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n\n if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n return;\n }\n\n node.setLayout({\n // isInView means: viewRoot sub tree + viewAbovePath\n isInView: true,\n // invisible only means: outside view clip so that the node can not\n // see but still layout for animation preparation but not render.\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n isAboveViewRoot: isAboveViewRoot\n }, true); // Transform to child coordinate.\n\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n each(node.viewChildren || [], function (child) {\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n });\n}\n\nfunction getUpperLabelHeight(model) {\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { installTreemapAction } from './treemapAction';\nimport TreemapSeriesModel from './TreemapSeries';\nimport TreemapView from './TreemapView';\nimport treemapVisual from './treemapVisual';\nimport treemapLayout from './treemapLayout';\nexport function install(registers) {\n registers.registerSeriesModel(TreemapSeriesModel);\n registers.registerChartView(TreemapView);\n registers.registerVisual(treemapVisual);\n registers.registerLayout(treemapLayout);\n installTreemapAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'number') {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util';\nexport default function categoryVisual(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n // Get color from palette.\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\n }\n\n categoriesData.setItemVisual(idx, 'style', style);\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < symbolVisualList.length; i++) {\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\n\n if (symbolVisual != null) {\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\n }\n }\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var categoryIdx = model.getShallow('category');\n\n if (categoryIdx != null) {\n if (typeof categoryIdx === 'string') {\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\n }\n\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\n var style = data.ensureUniqueItemVisual(idx, 'style');\n extend(style, categoryStyle);\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < visualList.length; i++) {\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\n }\n }\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util';\n\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nexport default function graphEdgeVisual(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const;\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\n\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\n\n var style = itemModel.getModel('lineStyle').getLineStyle();\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n switch (existsStyle.stroke) {\n case 'source':\n {\n var nodeStyle = edge.node1.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n\n case 'target':\n {\n var nodeStyle = edge.node2.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n }\n\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util';\nvar KEY_DELIMITER = '-->';\n/**\n * params handler\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {*}\n */\n\nvar getAutoCurvenessParams = function (seriesModel) {\n return seriesModel.get('autoCurveness') || null;\n};\n/**\n * Generate a list of edge curvatures, 20 is the default\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} appendLength\n * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\n */\n\n\nvar createCurveness = function (seriesModel, appendLength) {\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\n var length = 20;\n var curvenessList = []; // handler the function set\n\n if (typeof autoCurvenessParmas === 'number') {\n length = autoCurvenessParmas;\n } else if (zrUtil.isArray(autoCurvenessParmas)) {\n seriesModel.__curvenessList = autoCurvenessParmas;\n return;\n } // append length\n\n\n if (appendLength > length) {\n length = appendLength;\n } // make sure the length is even\n\n\n var len = length % 2 ? length + 2 : length + 3;\n curvenessList = [];\n\n for (var i = 0; i < len; i++) {\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\n }\n\n seriesModel.__curvenessList = curvenessList;\n};\n/**\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {string} key\n */\n\n\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\n var source = [n1.id, n1.dataIndex].join('.');\n var target = [n2.id, n2.dataIndex].join('.');\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\n};\n/**\n * get opposite key\n * @param {string} key\n * @returns {string}\n */\n\n\nvar getOppositeKey = function (key) {\n var keys = key.split(KEY_DELIMITER);\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\n};\n/**\n * get edgeMap with key\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\n\n\nvar getEdgeFromMap = function (edge, seriesModel) {\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n return seriesModel.__edgeMap[key];\n};\n/**\n * calculate all cases total length\n * @param edge\n * @param seriesModel\n * @returns {number}\n */\n\n\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\n return len + lenV;\n};\n/**\n *\n * @param key\n */\n\n\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\n var edgeMap = seriesModel.__edgeMap;\n return edgeMap[key] ? edgeMap[key].length : 0;\n};\n/**\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\n * @see /graph/GraphSeries.js@getInitialData\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\n\n\nexport function initCurvenessList(seriesModel) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n seriesModel.__curvenessList = [];\n seriesModel.__edgeMap = {}; // calc the array of curveness List\n\n createCurveness(seriesModel);\n}\n/**\n * set edgeMap with key\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} index\n */\n\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n var key = getKeyOfEdges(n1, n2, seriesModel);\n var edgeMap = seriesModel.__edgeMap;\n var oppositeEdges = edgeMap[getOppositeKey(key)]; // set direction\n\n if (edgeMap[key] && !oppositeEdges) {\n edgeMap[key].isForward = true;\n } else if (oppositeEdges && edgeMap[key]) {\n oppositeEdges.isForward = true;\n edgeMap[key].isForward = false;\n }\n\n edgeMap[key] = edgeMap[key] || [];\n edgeMap[key].push(index);\n}\n/**\n * get curvature for edge\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param index\n */\n\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\n var isArrayParam = zrUtil.isArray(autoCurvenessParams);\n\n if (!autoCurvenessParams) {\n return null;\n }\n\n var edgeArray = getEdgeFromMap(edge, seriesModel);\n\n if (!edgeArray) {\n return null;\n }\n\n var edgeIndex = -1;\n\n for (var i = 0; i < edgeArray.length; i++) {\n if (edgeArray[i] === index) {\n edgeIndex = i;\n break;\n }\n } // if totalLen is Longer createCurveness\n\n\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\n createCurveness(seriesModel, totalLen);\n edge.lineStyle = edge.lineStyle || {}; // if is opposite edge, must set curvenss to opposite number\n\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n var curvenessList = seriesModel.__curvenessList; // if pass array no need parity\n\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\n\n if (!edgeArray.isForward) {\n // the opposite edge show outside\n var oppositeKey = getOppositeKey(curKey);\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\n var resValue = curvenessList[edgeIndex + len + parityCorrection]; // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\n\n if (needReverse) {\n // set as array may make the parity handle with the len of opposite\n if (isArrayParam) {\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n } else {\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return curvenessList[edgeIndex + len + parityCorrection];\n }\n } else {\n return curvenessList[parityCorrection + edgeIndex];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util';\nimport { simpleLayout, simpleLayoutEdge } from './simpleLayoutHelper';\nexport default function graphSimpleLayout(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data_1 = seriesModel.getData();\n var dimensions_1 = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\n });\n\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions_1.length; i++) {\n var val = data_1.get(dimensions_1[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.<number>}, not undefined to avoid if...else... statement\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data_1.graph, seriesModel);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getNodeGlobalScale(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\n var groupZoom = coordSys.scaleX; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n}\nexport function getSymbolSize(node) {\n var symbolSize = node.getVisual('symbolSize');\n\n if (symbolSize instanceof Array) {\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n }\n\n return +symbolSize;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\n * `basedOn` can be:\n * 'value':\n * This layout is not accurate and have same bad case. For example,\n * if the min value is very smaller than the max value, the nodes\n * with the min value probably overlap even though there is enough\n * space to layout them. So we only use this approach in the as the\n * init layout of the force layout.\n * FIXME\n * Probably we do not need this method any more but use\n * `basedOn: 'symbolSize'` in force layout if\n * delay its init operations to GraphView.\n * 'symbolSize':\n * This approach work only if all of the symbol size calculated.\n * That is, the progressive rendering is not applied to graph.\n * FIXME\n * If progressive rendering is applied to graph some day,\n * probably we have to use `basedOn: 'value'`.\n */\n\nexport function circularLayout(seriesModel, basedOn) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n var count = nodeData.count();\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n\n if (!count) {\n return;\n }\n\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\nvar _layoutNodesBasedOn = {\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || count);\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n },\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var sumRadian = 0;\n _symbolRadiansHalf.length = count;\n var nodeScale = getNodeGlobalScale(seriesModel);\n graph.eachNode(function (node) {\n var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add\n // some the defensive code (2px is an arbitrary value).\n\n isNaN(symbolSize) && (symbolSize = 2);\n symbolSize < 0 && (symbolSize = 0);\n symbolSize *= nodeScale;\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.\n\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n sumRadian += symbolRadianHalf * 2;\n });\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n var angle = 0;\n graph.eachNode(function (node) {\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { circularLayout } from './circularLayoutHelper';\nexport default function graphCircularLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n if (seriesModel.get('layout') === 'circular') {\n circularLayout(seriesModel, 'symbolSize');\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* Some formulas were originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment of the method \"step\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* </licenses/LICENSE-d3>).\n*/\nimport * as vec2 from 'zrender/lib/core/vector';\nvar scaleAndAdd = vec2.scaleAndAdd; // function adjacentNode(n, e) {\n// return e.n1 === n ? e.n2 : e.n1;\n// }\n\nexport function forceLayout(inNodes, inEdges, opts) {\n var nodes = inNodes;\n var edges = inEdges;\n var rect = opts.rect;\n var width = rect.width;\n var height = rect.height;\n var center = [rect.x + width / 2, rect.y + height / 2]; // let scale = opts.scale || 1;\n\n var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (let i = 0; i < edges.length; i++) {\n // let e = edges[i];\n // let n1 = e.n1;\n // let n2 = e.n2;\n // n1.edges = n1.edges || [];\n // n2.edges = n2.edges || [];\n // n1.edges.push(e);\n // n2.edges.push(e);\n // }\n // Init position\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n\n if (!n.p) {\n n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n }\n\n n.pp = vec2.clone(n.p);\n n.edges = null;\n } // Formula in 'Graph Drawing by Force-directed Placement'\n // let k = scale * Math.sqrt(width * height / nodes.length);\n // let k2 = k * k;\n\n\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\n var friction = initialFriction;\n var beforeStepCallback;\n var afterStepCallback;\n return {\n warmUp: function () {\n friction = initialFriction * 0.8;\n },\n setFixed: function (idx) {\n nodes[idx].fixed = true;\n },\n setUnfixed: function (idx) {\n nodes[idx].fixed = false;\n },\n\n /**\n * Before step hook\n */\n beforeStep: function (cb) {\n beforeStepCallback = cb;\n },\n\n /**\n * After step hook\n */\n afterStep: function (cb) {\n afterStepCallback = cb;\n },\n\n /**\n * Some formulas were originally copied from \"d3.js\"\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\n * with some modifications made for this project.\n * See the license statement at the head of this file.\n */\n step: function (cb) {\n beforeStepCallback && beforeStepCallback(nodes, edges);\n var v12 = [];\n var nLen = nodes.length;\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n\n if (e.ignoreForceLayout) {\n continue;\n }\n\n var n1 = e.n1;\n var n2 = e.n2;\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12) - e.d;\n var w = n2.w / (n1.w + n2.w);\n\n if (isNaN(w)) {\n w = 0;\n }\n\n vec2.normalize(v12, v12);\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n } // Gravity\n\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v12, center, n.p); // let d = vec2.len(v12);\n // vec2.scale(v12, v12, 1 / d);\n // let gravityFactor = gravity;\n\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\n }\n } // Repulsive\n // PENDING\n\n\n for (var i = 0; i < nLen; i++) {\n var n1 = nodes[i];\n\n for (var j = i + 1; j < nLen; j++) {\n var n2 = nodes[j];\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12);\n\n if (d === 0) {\n // Random repulse\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n d = 1;\n }\n\n var repFact = (n1.rep + n2.rep) / d / d;\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n }\n }\n\n var v = [];\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v, n.p, n.pp);\n scaleAndAdd(n.p, n.p, v, friction);\n vec2.copy(n.pp, n.p);\n }\n }\n\n friction = friction * 0.992;\n var finished = friction < 0.01;\n afterStepCallback && afterStepCallback(nodes, edges, finished);\n cb && cb(finished);\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { forceLayout } from './forceHelper';\nimport { simpleLayout } from './simpleLayoutHelper';\nimport { circularLayout } from './circularLayoutHelper';\nimport { linearMap } from '../../util/number';\nimport * as vec2 from 'zrender/lib/core/vector';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper';\nexport default function graphForceLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var coordSys = graphSeries.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n if (graphSeries.get('layout') === 'force') {\n var preservedPoints_1 = graphSeries.preservedPoints || {};\n var graph_1 = graphSeries.getGraph();\n var nodeData_1 = graph_1.data;\n var edgeData = graph_1.edgeData;\n var forceModel = graphSeries.getModel('force');\n var initLayout = forceModel.get('initLayout');\n\n if (graphSeries.preservedPoints) {\n nodeData_1.each(function (idx) {\n var id = nodeData_1.getId(idx);\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\n });\n } else if (!initLayout || initLayout === 'none') {\n simpleLayout(graphSeries);\n } else if (initLayout === 'circular') {\n circularLayout(graphSeries, 'value');\n }\n\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\n var edgeDataExtent_1 = edgeData.getDataExtent('value'); // let edgeDataExtent = edgeData.getDataExtent('value');\n\n var repulsion = forceModel.get('repulsion');\n var edgeLength = forceModel.get('edgeLength');\n var repulsionArr_1 = zrUtil.isArray(repulsion) ? repulsion : [repulsion, repulsion];\n var edgeLengthArr_1 = zrUtil.isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; // Larger value has smaller length\n\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\n var point = nodeData_1.getItemLayout(idx);\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\n\n if (isNaN(rep)) {\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\n }\n\n return {\n w: rep,\n rep: rep,\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\n p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n };\n });\n var edges = edgeData.mapArray('value', function (value, idx) {\n var edge = graph_1.getEdgeByIndex(idx);\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\n\n if (isNaN(d)) {\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\n }\n\n var edgeModel = edge.getModel();\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\n return {\n n1: nodes_1[edge.node1.dataIndex],\n n2: nodes_1[edge.node2.dataIndex],\n d: d,\n curveness: curveness,\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\n };\n }); // let coordSys = graphSeries.coordinateSystem;\n\n var rect = coordSys.getBoundingRect();\n var forceInstance = forceLayout(nodes_1, edges, {\n rect: rect,\n gravity: forceModel.get('gravity'),\n friction: forceModel.get('friction')\n });\n forceInstance.beforeStep(function (nodes, edges) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i].fixed) {\n // Write back to layout instance\n vec2.copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\n }\n }\n });\n forceInstance.afterStep(function (nodes, edges, stopped) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (!nodes[i].fixed) {\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\n }\n\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\n }\n\n for (var i = 0, l = edges.length; i < l; i++) {\n var e = edges[i];\n var edge = graph_1.getEdgeByIndex(i);\n var p1 = e.n1.p;\n var p2 = e.n2.p;\n var points = edge.getLayout();\n points = points ? points.slice() : [];\n points[0] = points[0] || [];\n points[1] = points[1] || [];\n vec2.copy(points[0], p1);\n vec2.copy(points[1], p2);\n\n if (+e.curveness) {\n points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n }\n\n edge.setLayout(points);\n }\n });\n graphSeries.forceLayout = forceInstance;\n graphSeries.preservedPoints = preservedPoints_1; // Step to get the layout\n\n forceInstance.step();\n } else {\n // Remove prev injected forceLayout instance\n graphSeries.forceLayout = null;\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View';\nimport { getLayoutRect } from '../../util/layout';\nimport * as bbox from 'zrender/lib/core/bbox';\nimport { extend } from 'zrender/lib/core/util';\n\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max); // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n\n var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed?\n\n var viewRect = getViewRect(seriesModel, api, aspect); // Position may be NaN, use view rect instead\n\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info\n\n viewCoordSys.setCenter(seriesModel.get('center'));\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Line path for bezier and straight line draw\n */\n\nimport * as graphic from '../../util/graphic';\nimport * as vec2 from 'zrender/lib/core/vector';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\n\nvar StraightLineShape =\n/** @class */\nfunction () {\n function StraightLineShape() {\n // Start point\n this.x1 = 0;\n this.y1 = 0; // End point\n\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n\n return StraightLineShape;\n}();\n\nvar CurveShape =\n/** @class */\nfunction (_super) {\n __extends(CurveShape, _super);\n\n function CurveShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return CurveShape;\n}(StraightLineShape);\n\nfunction isStraightLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\n\nvar ECLinePath =\n/** @class */\nfunction (_super) {\n __extends(ECLinePath, _super);\n\n function ECLinePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-line';\n return _this;\n }\n\n ECLinePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECLinePath.prototype.getDefaultShape = function () {\n return new StraightLineShape();\n };\n\n ECLinePath.prototype.buildPath = function (ctx, shape) {\n if (isStraightLine(shape)) {\n straightLineProto.buildPath.call(this, ctx, shape);\n } else {\n bezierCurveProto.buildPath.call(this, ctx, shape);\n }\n };\n\n ECLinePath.prototype.pointAt = function (t) {\n if (isStraightLine(this.shape)) {\n return straightLineProto.pointAt.call(this, t);\n } else {\n return bezierCurveProto.pointAt.call(this, t);\n }\n };\n\n ECLinePath.prototype.tangentAt = function (t) {\n var shape = this.shape;\n var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n };\n\n return ECLinePath;\n}(graphic.Path);\n\nexport default ECLinePath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each, retrieve2 } from 'zrender/lib/core/util';\nimport * as vector from 'zrender/lib/core/vector';\nimport * as symbolUtil from '../../util/symbol';\nimport ECLinePath from './LinePath';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle';\nimport { round, parsePercent } from '../../util/number';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\n\nfunction makeSymbolTypeKey(symbolCategory) {\n return '_' + symbolCategory + 'Type';\n}\n/**\n * @inner\n */\n\n\nfunction createSymbol(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n\n if (!symbolType || symbolType === 'none') {\n return;\n }\n\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset') || 0;\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = isArray(symbolSize) ? symbolSize : [symbolSize, symbolSize];\n var symbolOffsetArr = isArray(symbolOffset) ? symbolOffset : [symbolOffset, symbolOffset];\n symbolOffsetArr[0] = parsePercent(symbolOffsetArr[0], symbolSizeArr[0]);\n symbolOffsetArr[1] = parsePercent(retrieve2(symbolOffsetArr[1], symbolOffsetArr[0]), symbolSizeArr[1]);\n var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n symbolPath.name = name;\n return symbolPath;\n}\n\nfunction createLine(points) {\n var line = new ECLinePath({\n name: 'line',\n subPixelOptimize: true\n });\n setLinePoints(line.shape, points);\n return line;\n}\n\nfunction setLinePoints(targetShape, points) {\n targetShape.x1 = points[0][0];\n targetShape.y1 = points[0][1];\n targetShape.x2 = points[1][0];\n targetShape.y2 = points[1][1];\n targetShape.percent = 1;\n var cp1 = points[2];\n\n if (cp1) {\n targetShape.cpx1 = cp1[0];\n targetShape.cpy1 = cp1[1];\n } else {\n targetShape.cpx1 = NaN;\n targetShape.cpy1 = NaN;\n }\n}\n\nvar Line =\n/** @class */\nfunction (_super) {\n __extends(Line, _super);\n\n function Line(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createLine(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var linePoints = lineData.getItemLayout(idx);\n var line = createLine(linePoints);\n line.shape.percent = 0;\n graphic.initProps(line, {\n shape: {\n percent: 1\n }\n }, seriesModel, idx);\n this.add(line);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = createSymbol(symbolCategory, lineData, idx); // symbols must added after line to make sure\n // it will be updated after line#update.\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n\n this.add(symbol);\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n }; // TODO More strict on the List type in parameters?\n\n\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var linePoints = lineData.getItemLayout(idx);\n var target = {\n shape: {}\n };\n setLinePoints(target.shape, linePoints);\n graphic.updateProps(line, target, seriesModel, idx);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\n var key = makeSymbolTypeKey(symbolCategory); // Symbol changed\n\n if (this[key] !== symbolType) {\n this.remove(this.childOfName(symbolCategory));\n var symbol = createSymbol(symbolCategory, lineData, idx);\n this.add(symbol);\n }\n\n this[key] = symbolType;\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Line.prototype.getLinePath = function () {\n return this.childAt(0);\n };\n\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels; // Optimization for large dataset\n\n if (!seriesScope || lineData.hasItemOption) {\n var itemModel = lineData.getItemModel(idx);\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var visualColor = lineStyle.stroke;\n line.useStyle(lineStyle);\n line.style.fill = null;\n line.style.strokeNoScale = true;\n line.ensureState('emphasis').style = emphasisLineStyle;\n line.ensureState('blur').style = blurLineStyle;\n line.ensureState('select').style = selectLineStyle; // Update symbol\n\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = this.childOfName(symbolCategory);\n\n if (symbol) {\n // Share opacity and color with line.\n symbol.setColor(visualColor);\n symbol.style.opacity = lineStyle.opacity;\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var lineState = line.getState(stateName);\n\n if (lineState) {\n var lineStateStyle = lineState.style || {};\n var state = symbol.ensureState(stateName);\n var stateStyle = state.style || (state.style = {});\n\n if (lineStateStyle.stroke != null) {\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n }\n\n if (lineStateStyle.opacity != null) {\n stateStyle.opacity = lineStateStyle.opacity;\n }\n }\n }\n\n symbol.markRedraw();\n }\n }, this);\n var rawVal = seriesModel.getRawValue(idx);\n setLabelStyle(this, labelStatesModels, {\n labelDataIndex: idx,\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n }\n },\n inheritColor: visualColor || '#000',\n defaultOpacity: lineStyle.opacity,\n defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n });\n var label = this.getTextContent(); // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n\n if (label) {\n var labelNormalModel = labelStatesModels.normal;\n label.__align = label.style.align;\n label.__verticalAlign = label.style.verticalAlign; // 'start', 'middle', 'end'\n\n label.__position = labelNormalModel.get('position') || 'middle';\n var distance = labelNormalModel.get('distance');\n\n if (!isArray(distance)) {\n distance = [distance, distance];\n }\n\n label.__labelDistance = distance;\n }\n\n this.setTextConfig({\n position: null,\n local: true,\n inside: false // Can't be inside for stroke element.\n\n });\n enableHoverEmphasis(this);\n };\n\n Line.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n Line.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n Line.prototype.updateLayout = function (lineData, idx) {\n this.setLinePoints(lineData.getItemLayout(idx));\n };\n\n Line.prototype.setLinePoints = function (points) {\n var linePath = this.childOfName('line');\n setLinePoints(linePath.shape, points);\n linePath.dirty();\n };\n\n Line.prototype.beforeUpdate = function () {\n var lineGroup = this;\n var symbolFrom = lineGroup.childOfName('fromSymbol');\n var symbolTo = lineGroup.childOfName('toSymbol');\n var label = lineGroup.getTextContent(); // Quick reject\n\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n return;\n }\n\n var invScale = 1;\n var parentNode = this.parent;\n\n while (parentNode) {\n if (parentNode.scaleX) {\n invScale /= parentNode.scaleX;\n }\n\n parentNode = parentNode.parent;\n }\n\n var line = lineGroup.childOfName('line'); // If line not changed\n // FIXME Parent scale changed\n\n if (!this.__dirty && !line.__dirty) {\n return;\n }\n\n var percent = line.shape.percent;\n var fromPos = line.pointAt(0);\n var toPos = line.pointAt(percent);\n var d = vector.sub([], toPos, fromPos);\n vector.normalize(d, d);\n\n function setSymbolRotation(symbol, percent) {\n // Fix #12388\n // when symbol is set to be 'arrow' in markLine,\n // symbolRotate value will be ignored, and compulsively use tangent angle.\n // rotate by default if symbol rotation is not specified\n var specifiedRotation = symbol.__specifiedRotation;\n\n if (specifiedRotation == null) {\n var tangent = line.tangentAt(percent);\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n } else {\n symbol.attr('rotation', specifiedRotation);\n }\n }\n\n if (symbolFrom) {\n symbolFrom.setPosition(fromPos);\n setSymbolRotation(symbolFrom, 0);\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n symbolFrom.markRedraw();\n }\n\n if (symbolTo) {\n symbolTo.setPosition(toPos);\n setSymbolRotation(symbolTo, 1);\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n symbolTo.markRedraw();\n }\n\n if (label && !label.ignore) {\n label.x = label.y = 0;\n label.originX = label.originY = 0;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var distance = label.__labelDistance;\n var distanceX = distance[0] * invScale;\n var distanceY = distance[1] * invScale;\n var halfPercent = percent / 2;\n var tangent = line.tangentAt(halfPercent);\n var n = [tangent[1], -tangent[0]];\n var cp = line.pointAt(halfPercent);\n\n if (n[1] > 0) {\n n[0] = -n[0];\n n[1] = -n[1];\n }\n\n var dir = tangent[0] < 0 ? -1 : 1;\n\n if (label.__position !== 'start' && label.__position !== 'end') {\n var rotation = -Math.atan2(tangent[1], tangent[0]);\n\n if (toPos[0] < fromPos[0]) {\n rotation = Math.PI + rotation;\n }\n\n label.rotation = rotation;\n }\n\n var dy = void 0;\n\n switch (label.__position) {\n case 'insideStartTop':\n case 'insideMiddleTop':\n case 'insideEndTop':\n case 'middle':\n dy = -distanceY;\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideStartBottom':\n case 'insideMiddleBottom':\n case 'insideEndBottom':\n dy = distanceY;\n textVerticalAlign = 'top';\n break;\n\n default:\n dy = 0;\n textVerticalAlign = 'middle';\n }\n\n switch (label.__position) {\n case 'end':\n label.x = d[0] * distanceX + toPos[0];\n label.y = d[1] * distanceY + toPos[1];\n textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n break;\n\n case 'start':\n label.x = -d[0] * distanceX + fromPos[0];\n label.y = -d[1] * distanceY + fromPos[1];\n textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n break;\n\n case 'insideStartTop':\n case 'insideStart':\n case 'insideStartBottom':\n label.x = distanceX * dir + fromPos[0];\n label.y = fromPos[1] + dy;\n textAlign = tangent[0] < 0 ? 'right' : 'left';\n label.originX = -distanceX * dir;\n label.originY = -dy;\n break;\n\n case 'insideMiddleTop':\n case 'insideMiddle':\n case 'insideMiddleBottom':\n case 'middle':\n label.x = cp[0];\n label.y = cp[1] + dy;\n textAlign = 'center';\n label.originY = -dy;\n break;\n\n case 'insideEndTop':\n case 'insideEnd':\n case 'insideEndBottom':\n label.x = -distanceX * dir + toPos[0];\n label.y = toPos[1] + dy;\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\n label.originX = distanceX * dir;\n label.originY = -dy;\n break;\n }\n\n label.scaleX = label.scaleY = invScale;\n label.setStyle({\n // Use the user specified text align and baseline first\n verticalAlign: label.__verticalAlign || textVerticalAlign,\n align: label.__align || textAlign\n });\n }\n };\n\n return Line;\n}(graphic.Group);\n\nexport default Line;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic';\nimport LineGroup from './Line';\nimport { getLabelStatesModels } from '../../label/labelStyle';\n\nvar LineDraw =\n/** @class */\nfunction () {\n function LineDraw(LineCtor) {\n this.group = new graphic.Group();\n this._LineCtor = LineCtor || LineGroup;\n }\n\n LineDraw.prototype.isPersistent = function () {\n return true;\n };\n\n ;\n\n LineDraw.prototype.updateData = function (lineData) {\n var _this = this;\n\n var lineDraw = this;\n var group = lineDraw.group;\n var oldLineData = lineDraw._lineData;\n lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!oldLineData) {\n group.removeAll();\n }\n\n var seriesScope = makeSeriesScope(lineData);\n lineData.diff(oldLineData).add(function (idx) {\n _this._doAdd(lineData, idx, seriesScope);\n }).update(function (newIdx, oldIdx) {\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n }).remove(function (idx) {\n group.remove(oldLineData.getItemGraphicEl(idx));\n }).execute();\n };\n\n ;\n\n LineDraw.prototype.updateLayout = function () {\n var lineData = this._lineData; // Do not support update layout in incremental mode.\n\n if (!lineData) {\n return;\n }\n\n lineData.eachItemGraphicEl(function (el, idx) {\n el.updateLayout(lineData, idx);\n }, this);\n };\n\n ;\n\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n this._seriesScope = makeSeriesScope(lineData);\n this._lineData = null;\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n function updateIncrementalAndHover(el) {\n if (!el.isGroup && !isEffectObject(el)) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (lineNeedsDraw(itemLayout)) {\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n this.group.add(el);\n lineData.setItemGraphicEl(idx, el);\n }\n }\n };\n\n ;\n\n LineDraw.prototype.remove = function () {\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (!lineNeedsDraw(itemLayout)) {\n return;\n }\n\n var el = new this._LineCtor(lineData, idx, seriesScope);\n lineData.setItemGraphicEl(idx, el);\n this.group.add(el);\n };\n\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n this.group.remove(itemEl);\n return;\n }\n\n if (!itemEl) {\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n } else {\n itemEl.updateData(newLineData, newIdx, seriesScope);\n }\n\n newLineData.setItemGraphicEl(newIdx, itemEl);\n this.group.add(itemEl);\n };\n\n return LineDraw;\n}();\n\nfunction isEffectObject(el) {\n return el.animators && el.animators.length > 0;\n}\n\nfunction makeSeriesScope(lineData) {\n var hostModel = lineData.hostModel;\n return {\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n labelStatesModels: getLabelStatesModels(hostModel)\n };\n}\n\nfunction isPointNaN(pt) {\n return isNaN(pt[0]) || isNaN(pt[1]);\n}\n\nfunction lineNeedsDraw(pts) {\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\n\nexport default LineDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as curveTool from 'zrender/lib/core/curve';\nimport * as vec2 from 'zrender/lib/core/vector';\nimport { getSymbolSize } from './graphHelper';\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\n\nfunction intersectCurveCircle(curvePoints, center, radius) {\n var p0 = curvePoints[0];\n var p1 = curvePoints[1];\n var p2 = curvePoints[2];\n var d = Infinity;\n var t;\n var radiusSquare = radius * radius;\n var interval = 0.1;\n\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n\n if (diff < d) {\n d = diff;\n t = _t;\n }\n } // Assume the segment is monotone,Find root through Bisection method\n // At most 32 iteration\n\n\n for (var i = 0; i < 32; i++) {\n // let prev = t - interval;\n var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n var diff = v2DistSquare(v2, center) - radiusSquare;\n\n if (mathAbs(diff) < 1e-2) {\n break;\n } // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\n\n\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n interval /= 2;\n\n if (diff < 0) {\n if (nextDiff >= 0) {\n t = t + interval;\n } else {\n t = t - interval;\n }\n } else {\n if (nextDiff >= 0) {\n t = t - interval;\n } else {\n t = t + interval;\n }\n }\n }\n\n return t;\n} // Adjust edge to avoid\n\n\nexport default function adjustEdge(graph, scale) {\n var tmp0 = [];\n var quadraticSubdivide = curveTool.quadraticSubdivide;\n var pts = [[], [], []];\n var pts2 = [[], []];\n var v = [];\n scale /= 2;\n graph.eachEdge(function (edge, idx) {\n var linePoints = edge.getLayout();\n var fromSymbol = edge.getVisual('fromSymbol');\n var toSymbol = edge.getVisual('toSymbol');\n\n if (!linePoints.__original) {\n linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n\n if (linePoints[2]) {\n linePoints.__original.push(vec2.clone(linePoints[2]));\n }\n }\n\n var originalPoints = linePoints.__original; // Quadratic curve\n\n if (linePoints[2] != null) {\n vec2.copy(pts[0], originalPoints[0]);\n vec2.copy(pts[1], originalPoints[2]);\n vec2.copy(pts[2], originalPoints[1]);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[0][0] = tmp0[3];\n pts[1][0] = tmp0[4];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[0][1] = tmp0[3];\n pts[1][1] = tmp0[4];\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[1][0] = tmp0[1];\n pts[2][0] = tmp0[2];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[1][1] = tmp0[1];\n pts[2][1] = tmp0[2];\n } // Copy back to layout\n\n\n vec2.copy(linePoints[0], pts[0]);\n vec2.copy(linePoints[1], pts[2]);\n vec2.copy(linePoints[2], pts[1]);\n } // Line\n else {\n vec2.copy(pts2[0], originalPoints[0]);\n vec2.copy(pts2[1], originalPoints[1]);\n vec2.sub(v, pts2[1], pts2[0]);\n vec2.normalize(v, v);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n }\n\n vec2.copy(linePoints[0], pts2[0]);\n vec2.copy(linePoints[1], pts2[1]);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport SymbolDraw from '../helper/SymbolDraw';\nimport LineDraw from '../helper/LineDraw';\nimport RoamController from '../../component/helper/RoamController';\nimport * as roamHelper from '../../component/helper/roamHelper';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper';\nimport * as graphic from '../../util/graphic';\nimport adjustEdge from './adjustEdge';\nimport { getNodeGlobalScale } from './graphHelper';\nimport ChartView from '../../view/Chart';\nimport { getECData } from '../../util/innerStore';\n\nfunction isViewCoordSys(coordSys) {\n return coordSys.type === 'view';\n}\n\nvar GraphView =\n/** @class */\nfunction (_super) {\n __extends(GraphView, _super);\n\n function GraphView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphView.type;\n return _this;\n }\n\n GraphView.prototype.init = function (ecModel, api) {\n var symbolDraw = new SymbolDraw();\n var lineDraw = new LineDraw();\n var group = this.group;\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n group.add(symbolDraw.group);\n group.add(lineDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineDraw = lineDraw;\n this._firstRender = true;\n };\n\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n this._model = seriesModel;\n var symbolDraw = this._symbolDraw;\n var lineDraw = this._lineDraw;\n var group = this.group;\n\n if (isViewCoordSys(coordSys)) {\n var groupNewProp = {\n x: coordSys.x,\n y: coordSys.y,\n scaleX: coordSys.scaleX,\n scaleY: coordSys.scaleY\n };\n\n if (this._firstRender) {\n group.attr(groupNewProp);\n } else {\n graphic.updateProps(group, groupNewProp, seriesModel);\n }\n } // Fix edge contact point with node\n\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n var data = seriesModel.getData();\n symbolDraw.updateData(data);\n var edgeData = seriesModel.getEdgeData(); // TODO: TYPE\n\n lineDraw.updateData(edgeData);\n\n this._updateNodeAndLinkScale();\n\n this._updateController(seriesModel, ecModel, api);\n\n clearTimeout(this._layoutTimeout);\n var forceLayout = seriesModel.forceLayout;\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\n\n if (forceLayout) {\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\n }\n\n data.graph.eachNode(function (node) {\n var idx = node.dataIndex;\n var el = node.getGraphicEl();\n var itemModel = node.getModel(); // Update draggable\n\n el.off('drag').off('dragend');\n var draggable = itemModel.get('draggable');\n\n if (draggable) {\n el.on('drag', function () {\n if (forceLayout) {\n forceLayout.warmUp();\n !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\n forceLayout.setFixed(idx); // Write position back to layout\n\n data.setItemLayout(idx, [el.x, el.y]);\n }\n }).on('dragend', function () {\n if (forceLayout) {\n forceLayout.setUnfixed(idx);\n }\n });\n }\n\n el.setDraggable(draggable && !!forceLayout);\n var focus = itemModel.get(['emphasis', 'focus']);\n\n if (focus === 'adjacency') {\n getECData(el).focus = node.getAdjacentDataIndices();\n }\n });\n data.graph.eachEdge(function (edge) {\n var el = edge.getGraphicEl();\n var focus = edge.getModel().get(['emphasis', 'focus']);\n\n if (focus === 'adjacency') {\n getECData(el).focus = {\n edge: [edge.dataIndex],\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\n };\n }\n });\n var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']);\n var cx = data.getLayout('cx');\n var cy = data.getLayout('cy');\n data.eachItemGraphicEl(function (el, idx) {\n var itemModel = data.getItemModel(idx);\n var labelRotate = itemModel.get(['label', 'rotate']) || 0;\n var symbolPath = el.getSymbolPath();\n\n if (circularRotateLabel) {\n var pos = data.getItemLayout(idx);\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n var isLeft = pos[0] < cx;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setTextConfig({\n rotation: -rad,\n position: textPosition,\n origin: 'center'\n });\n var emphasisState = symbolPath.ensureState('emphasis');\n zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\n position: textPosition\n });\n } else {\n symbolPath.setTextConfig({\n rotation: labelRotate *= Math.PI / 180\n });\n }\n });\n this._firstRender = false;\n };\n\n GraphView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\n var self = this;\n\n (function step() {\n forceLayout.step(function (stopped) {\n self.updateLayout(self._model);\n (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n });\n })();\n };\n\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\n controller.disable();\n return;\n }\n\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale();\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n _this._lineDraw.updateLayout(); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n GraphView.prototype._updateNodeAndLinkScale = function () {\n var seriesModel = this._model;\n var data = seriesModel.getData();\n var nodeScale = getNodeGlobalScale(seriesModel);\n data.eachItemGraphicEl(function (el, idx) {\n el.setSymbolScale(nodeScale);\n });\n };\n\n GraphView.prototype.updateLayout = function (seriesModel) {\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n this._symbolDraw.updateLayout();\n\n this._lineDraw.updateLayout();\n };\n\n GraphView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove();\n this._lineDraw && this._lineDraw.remove();\n };\n\n GraphView.type = 'graph';\n return GraphView;\n}(ChartView);\n\nexport default GraphView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // id may be function name of Object, add a prefix to avoid this problem.\n\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\n * @type {Object.<string, module:echarts/data/Graph.Edge>}\n * @private\n */\n\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\n * If is directed graph\n */\n\n\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n\n ;\n /**\n * Add a new node\n */\n\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n\n return;\n }\n\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n\n ;\n /**\n * Get node by data index\n */\n\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n\n ;\n /**\n * Get node by id\n */\n\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n\n ;\n /**\n * Add a new edge\n */\n\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap; // PNEDING\n\n if (typeof n1 === 'number') {\n n1 = this.nodes[n1];\n }\n\n if (typeof n2 === 'number') {\n n2 = this.nodes[n2];\n }\n\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n\n if (!n1 || !n2) {\n return;\n }\n\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n\n n1.edges.push(edge);\n\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n\n ;\n /**\n * Get edge by data index\n */\n\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n\n ;\n /**\n * Get edge by two linked nodes\n */\n\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n\n var edgesMap = this._edgesMap;\n\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n\n ;\n /**\n * Iterate all nodes\n */\n\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n\n ;\n /**\n * Iterate all edges\n */\n\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n\n ;\n /**\n * Breadth first traverse\n * Return true to stop traversing\n */\n\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n\n if (!startNode) {\n return;\n }\n\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n\n if (cb.call(context, startNode, null)) {\n return;\n }\n\n var queue = [startNode];\n\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n\n ; // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n }); // Update edge\n\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n\n ;\n /**\n * @return {module:echarts/data/Graph}\n */\n\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n\n return graph;\n };\n\n ;\n return Graph;\n}();\n\nvar GraphNode =\n/** @class */\nfunction () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n\n return dataIndices;\n };\n\n return GraphNode;\n}();\n\nvar GraphEdge =\n/** @class */\nfunction () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n\n return GraphEdge;\n}();\n\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport List from '../../data/List';\nimport Graph from '../../data/Graph';\nimport linkList from '../../data/helper/linkList';\nimport createDimensions from '../../data/helper/createDimensions';\nimport CoordinateSystem from '../../core/CoordinateSystem';\nimport createListFromArray from './createListFromArray';\nimport { convertOptionIdName } from '../../util/model';\nexport default function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport List from '../../data/List';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { defaultEmphasis } from '../../util/model';\nimport Model from '../../model/Model';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\nimport SeriesModel from '../../model/Series';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip';\nimport { initCurvenessList, createEdgeMapForCurveness } from '../helper/multipleGraphEdgeHelper';\n\nvar GraphSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GraphSeriesModel, _super);\n\n function GraphSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n GraphSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n\n var self = this;\n\n function getCategoriesData() {\n return self._categoriesData;\n } // Provide data for legend select\n\n\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n\n defaultEmphasis(option, 'edgeLabel', ['show']);\n };\n\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var edges = option.edges || option.links || [];\n var nodes = option.data || option.nodes || [];\n var self = this;\n\n if (nodes && edges) {\n // auto curveness\n initCurvenessList(this);\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n zrUtil.each(graph.edges, function (edge) {\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\n }, this);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n // Overwrite nodeData.getItemModel to\n nodeData.wrapMethod('getItemModel', function (model) {\n var categoriesModels = self._categoriesModels;\n var categoryIdx = model.getShallow('category');\n var categoryModel = categoriesModels[categoryIdx];\n\n if (categoryModel) {\n categoryModel.parentModel = model.parentModel;\n model.parentModel = categoryModel;\n }\n\n return model;\n }); // TODO Inherit resolveParentPath by default in Model#getModel?\n\n var oldGetModel = Model.prototype.getModel;\n\n function newGetModel(path, parentModel) {\n var model = oldGetModel.call(this, path, parentModel);\n model.resolveParentPath = resolveParentPath;\n return model;\n }\n\n edgeData.wrapMethod('getItemModel', function (model) {\n model.resolveParentPath = resolveParentPath;\n model.getModel = newGetModel;\n return model;\n });\n\n function resolveParentPath(pathArr) {\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n var newPathArr = pathArr.slice();\n\n if (pathArr[0] === 'label') {\n newPathArr[0] = 'edgeLabel';\n } else if (pathArr[1] === 'label') {\n newPathArr[1] = 'edgeLabel';\n }\n\n return newPathArr;\n }\n\n return pathArr;\n }\n }\n };\n\n GraphSeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n\n GraphSeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n GraphSeriesModel.prototype.getCategoriesData = function () {\n return this._categoriesData;\n };\n\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n if (dataType === 'edge') {\n var nodeData = this.getData();\n var params = this.getDataParams(dataIndex, dataType);\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n var sourceName = nodeData.getName(edge.node1.dataIndex);\n var targetName = nodeData.getName(edge.node2.dataIndex);\n var nameArr = [];\n sourceName != null && nameArr.push(sourceName);\n targetName != null && nameArr.push(targetName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > '),\n value: params.value,\n noValue: params.value == null\n });\n } // dataType === 'node' or empty\n\n\n var nodeMarkup = defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n return nodeMarkup;\n };\n\n GraphSeriesModel.prototype._updateCategoriesData = function () {\n var categories = zrUtil.map(this.option.categories || [], function (category) {\n // Data must has value\n return category.value != null ? category : zrUtil.extend({\n value: 0\n }, category);\n });\n var categoriesData = new List(['value'], this);\n categoriesData.initData(categories);\n this._categoriesData = categoriesData;\n this._categoriesModels = categoriesData.mapArray(function (idx) {\n return categoriesData.getItemModel(idx);\n });\n };\n\n GraphSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GraphSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\n return _super.prototype.isAnimationEnabled.call(this) // Not enable animation when do force layout\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\n };\n\n GraphSeriesModel.type = 'series.graph';\n GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n GraphSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // Default option for all coordinate systems\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // geoIndex: 0,\n legendHoverLink: true,\n layout: null,\n // Configuration of circular layout\n circular: {\n rotateLabel: false\n },\n // Configuration of force directed layout\n force: {\n initLayout: null,\n // Node repulsion. Can be an array to represent range.\n repulsion: [0, 50],\n gravity: 0.1,\n // Initial friction\n friction: 0.6,\n // Edge length. Can be an array to represent range.\n edgeLength: 30,\n layoutAnimation: true\n },\n left: 'center',\n top: 'center',\n // right: null,\n // bottom: null,\n // width: '80%',\n // height: '80%',\n symbol: 'circle',\n symbolSize: 10,\n edgeSymbol: ['none', 'none'],\n edgeSymbolSize: 10,\n edgeLabel: {\n position: 'middle',\n distance: 5\n },\n draggable: false,\n roam: false,\n // Default on center of graph\n center: null,\n zoom: 1,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.6,\n // cursor: null,\n // categories: [],\n // data: []\n // Or\n // nodes: []\n //\n // links: []\n // Or\n // edges: []\n label: {\n show: false,\n formatter: '{b}'\n },\n itemStyle: {},\n lineStyle: {\n color: '#aaa',\n width: 1,\n opacity: 0.5\n },\n emphasis: {\n scale: true,\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return GraphSeriesModel;\n}(SeriesModel);\n\nexport default GraphSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport categoryFilter from './categoryFilter';\nimport categoryVisual from './categoryVisual';\nimport edgeVisual from './edgeVisual';\nimport simpleLayout from './simpleLayout';\nimport circularLayout from './circularLayout';\nimport forceLayout from './forceLayout';\nimport createView from './createView';\nimport View from '../../coord/View';\nimport GraphView from './GraphView';\nimport GraphSeriesModel from './GraphSeries';\nimport { updateCenterAndZoom } from '../../action/roamHelper';\nvar actionInfo = {\n type: 'graphRoam',\n event: 'graphRoam',\n update: 'none'\n};\nexport function install(registers) {\n registers.registerChartView(GraphView);\n registers.registerSeriesModel(GraphSeriesModel);\n registers.registerProcessor(categoryFilter);\n registers.registerVisual(categoryVisual);\n registers.registerVisual(edgeVisual);\n registers.registerLayout(simpleLayout);\n registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\n registers.registerLayout(forceLayout);\n registers.registerCoordinateSystem('graphView', {\n dimensions: View.dimensions,\n create: createView\n }); // Register legacy focus actions\n\n registers.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n }, function () {});\n registers.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n }, function () {}); // Register roam action.\n\n registers.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path';\n\nvar PointerShape =\n/** @class */\nfunction () {\n function PointerShape() {\n this.angle = 0;\n this.width = 10;\n this.r = 10;\n this.x = 0;\n this.y = 0;\n }\n\n return PointerShape;\n}();\n\nvar PointerPath =\n/** @class */\nfunction (_super) {\n __extends(PointerPath, _super);\n\n function PointerPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'pointer';\n return _this;\n }\n\n PointerPath.prototype.getDefaultShape = function () {\n return new PointerShape();\n };\n\n PointerPath.prototype.buildPath = function (ctx, shape) {\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n var r = shape.r;\n var width = shape.width;\n var angle = shape.angle;\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n angle = shape.angle - Math.PI / 2;\n ctx.moveTo(x, y);\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n ctx.lineTo(x, y);\n };\n\n return PointerPath;\n}(Path);\n\nexport default PointerPath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport PointerPath from './PointerPath';\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport { createTextStyle, setLabelValueAnimation, animateLabelValue } from '../../label/labelStyle';\nimport ChartView from '../../view/Chart';\nimport { parsePercent, round, linearMap } from '../../util/number';\nimport Sausage from '../../util/shape/sausage';\nimport { createSymbol } from '../../util/symbol';\nimport ZRImage from 'zrender/lib/graphic/Image';\nimport { extend } from 'zrender/lib/core/util';\n\nfunction parsePosition(seriesModel, api) {\n var center = seriesModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], api.getWidth());\n var cy = parsePercent(center[1], api.getHeight());\n var r = parsePercent(seriesModel.get('radius'), size / 2);\n return {\n cx: cx,\n cy: cy,\n r: r\n };\n}\n\nfunction formatLabel(value, labelFormatter) {\n var label = value == null ? '' : value + '';\n\n if (labelFormatter) {\n if (typeof labelFormatter === 'string') {\n label = labelFormatter.replace('{value}', label);\n } else if (typeof labelFormatter === 'function') {\n label = labelFormatter(value);\n }\n }\n\n return label;\n}\n\nvar PI2 = Math.PI * 2;\n\nvar GaugeView =\n/** @class */\nfunction (_super) {\n __extends(GaugeView, _super);\n\n function GaugeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeView.type;\n return _this;\n }\n\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\n var posInfo = parsePosition(seriesModel, api);\n\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n\n this._data = seriesModel.getData();\n };\n\n GaugeView.prototype.dispose = function () {};\n\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\n var group = this.group;\n var clockwise = seriesModel.get('clockwise');\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n var axisLineModel = seriesModel.getModel('axisLine');\n var roundCap = axisLineModel.get('roundCap');\n var MainPath = roundCap ? Sausage : graphic.Sector;\n var showAxis = axisLineModel.get('show');\n var lineStyleModel = axisLineModel.getModel('lineStyle');\n var axisLineWidth = lineStyleModel.get('width');\n var angleRangeSpan = !((endAngle - startAngle) % PI2) && endAngle !== startAngle ? PI2 : (endAngle - startAngle) % PI2;\n var prevEndAngle = startAngle;\n\n for (var i = 0; showAxis && i < colorList.length; i++) {\n // Clamp\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n endAngle = startAngle + angleRangeSpan * percent;\n var sector = new MainPath({\n shape: {\n startAngle: prevEndAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: posInfo.r - axisLineWidth,\n r: posInfo.r\n },\n silent: true\n });\n sector.setStyle({\n fill: colorList[i][1]\n });\n sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc\n // so the properties for stroking are useless\n ['color', 'width']));\n group.add(sector);\n prevEndAngle = endAngle;\n }\n\n var getColor = function (percent) {\n // Less than 0\n if (percent <= 0) {\n return colorList[0][1];\n }\n\n var i;\n\n for (i = 0; i < colorList.length; i++) {\n if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n return colorList[i][1];\n }\n } // More than 1\n\n\n return colorList[i - 1][1];\n };\n\n if (!clockwise) {\n var tmp = startAngle;\n startAngle = endAngle;\n endAngle = tmp;\n }\n\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\n\n this._renderAnchor(seriesModel, posInfo);\n\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n };\n\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var cx = posInfo.cx;\n var cy = posInfo.cy;\n var r = posInfo.r;\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var splitLineModel = seriesModel.getModel('splitLine');\n var tickModel = seriesModel.getModel('axisTick');\n var labelModel = seriesModel.getModel('axisLabel');\n var splitNumber = seriesModel.get('splitNumber');\n var subSplitNumber = tickModel.get('splitNumber');\n var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n var tickLen = parsePercent(tickModel.get('length'), r);\n var angle = startAngle;\n var step = (endAngle - startAngle) / splitNumber;\n var subStep = step / subSplitNumber;\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n var splitLineDistance = splitLineModel.get('distance');\n var unitX;\n var unitY;\n\n for (var i = 0; i <= splitNumber; i++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle); // Split line\n\n if (splitLineModel.get('show')) {\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\n var splitLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - splitLineLen - distance) + cx,\n y2: unitY * (r - splitLineLen - distance) + cy\n },\n style: splitLineStyle,\n silent: true\n });\n\n if (splitLineStyle.stroke === 'auto') {\n splitLine.setStyle({\n stroke: getColor(i / splitNumber)\n });\n }\n\n group.add(splitLine);\n } // Label\n\n\n if (labelModel.get('show')) {\n var distance = labelModel.get('distance') + splitLineDistance;\n var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n var autoColor = getColor(i / splitNumber);\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: unitX * (r - splitLineLen - distance) + cx,\n y: unitY * (r - splitLineLen - distance) + cy,\n verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle',\n align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true\n }));\n } // Axis tick\n\n\n if (tickModel.get('show') && i !== splitNumber) {\n var distance = tickModel.get('distance');\n distance = distance ? distance + axisLineWidth : axisLineWidth;\n\n for (var j = 0; j <= subSplitNumber; j++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle);\n var tickLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - tickLen - distance) + cx,\n y2: unitY * (r - tickLen - distance) + cy\n },\n silent: true,\n style: tickLineStyle\n });\n\n if (tickLineStyle.stroke === 'auto') {\n tickLine.setStyle({\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\n });\n }\n\n group.add(tickLine);\n angle += subStep;\n }\n\n angle -= subStep;\n } else {\n angle += step;\n }\n }\n };\n\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var oldData = this._data;\n var oldProgressData = this._progressEls;\n var progressList = [];\n var showPointer = seriesModel.get(['pointer', 'show']);\n var progressModel = seriesModel.getModel('progress');\n var showProgress = progressModel.get('show');\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var valueExtent = [minVal, maxVal];\n var angleExtent = [startAngle, endAngle];\n\n function createPointer(idx, angle) {\n var itemModel = data.getItemModel(idx);\n var pointerModel = itemModel.getModel('pointer');\n var pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\n var pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\n var pointerStr = seriesModel.get(['pointer', 'icon']);\n var pointerOffset = pointerModel.get('offsetCenter');\n var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\n var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\n var pointerKeepAspect = pointerModel.get('keepAspect');\n var pointer; // not exist icon type will be set 'rect'\n\n if (pointerStr) {\n pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\n } else {\n pointer = new PointerPath({\n shape: {\n angle: -Math.PI / 2,\n width: pointerWidth,\n r: pointerLength,\n x: pointerOffsetX,\n y: pointerOffsetY\n }\n });\n }\n\n pointer.rotation = -(angle + Math.PI / 2);\n pointer.x = posInfo.cx;\n pointer.y = posInfo.cy;\n return pointer;\n }\n\n function createProgress(idx, endAngle) {\n var roundCap = progressModel.get('roundCap');\n var ProgressPath = roundCap ? Sausage : graphic.Sector;\n var isOverlap = progressModel.get('overlap');\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\n var progress = new ProgressPath({\n shape: {\n startAngle: startAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: r0,\n r: r\n }\n });\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\n return progress;\n }\n\n if (showProgress || showPointer) {\n data.diff(oldData).add(function (idx) {\n if (showPointer) {\n var pointer = createPointer(idx, startAngle);\n graphic.initProps(pointer, {\n rotation: -(linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(idx, pointer);\n }\n\n if (showProgress) {\n var progress = createProgress(idx, startAngle);\n var isClip = progressModel.get('clip');\n graphic.initProps(progress, {\n shape: {\n endAngle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress);\n progressList[idx] = progress;\n }\n }).update(function (newIdx, oldIdx) {\n if (showPointer) {\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\n var pointer = createPointer(newIdx, previousRotate);\n pointer.rotation = previousRotate;\n graphic.updateProps(pointer, {\n rotation: -(linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(newIdx, pointer);\n }\n\n if (showProgress) {\n var previousProgress = oldProgressData[oldIdx];\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\n var progress = createProgress(newIdx, previousEndAngle);\n var isClip = progressModel.get('clip');\n graphic.updateProps(progress, {\n shape: {\n endAngle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress);\n progressList[newIdx] = progress;\n }\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n\n if (showPointer) {\n var pointer = data.getItemGraphicEl(idx);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (pointer instanceof ZRImage) {\n var pathStyle = pointer.style;\n pointer.useStyle(extend({\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n pointer.useStyle(symbolStyle);\n pointer.type !== 'pointer' && pointer.setColor(visualColor);\n }\n\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\n\n if (pointer.style.fill === 'auto') {\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n }\n\n pointer.z2EmphasisLift = 0;\n setStatesStylesFromModel(pointer, itemModel);\n enableHoverEmphasis(pointer, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n }\n\n if (showProgress) {\n var progress = progressList[idx];\n progress.useStyle(data.getItemVisual(idx, 'style'));\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\n progress.z2EmphasisLift = 0;\n setStatesStylesFromModel(progress, itemModel);\n enableHoverEmphasis(progress, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n }\n });\n this._progressEls = progressList;\n }\n };\n\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\n var anchorModel = seriesModel.getModel('anchor');\n var showAnchor = anchorModel.get('show');\n\n if (showAnchor) {\n var anchorSize = anchorModel.get('size');\n var anchorType = anchorModel.get('icon');\n var offsetCenter = anchorModel.get('offsetCenter');\n var anchorKeepAspect = anchorModel.get('keepAspect');\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\n this.group.add(anchor);\n }\n };\n\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\n var _this = this;\n\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var contentGroup = new graphic.Group();\n var newTitleEls = [];\n var newDetailEls = [];\n var hasAnimation = seriesModel.isAnimationEnabled();\n data.diff(this._data).add(function (idx) {\n newTitleEls[idx] = new graphic.Text({\n silent: true\n });\n newDetailEls[idx] = new graphic.Text({\n silent: true\n });\n }).update(function (idx, oldIdx) {\n newTitleEls[idx] = _this._titleEls[oldIdx];\n newDetailEls[idx] = _this._detailEls[oldIdx];\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var value = data.get(valueDim, idx);\n var itemGroup = new graphic.Group();\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n var itemTitleModel = itemModel.getModel('title');\n\n if (itemTitleModel.get('show')) {\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\n var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\n var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\n var labelEl = newTitleEls[idx];\n labelEl.attr({\n style: createTextStyle(itemTitleModel, {\n x: titleX,\n y: titleY,\n text: data.getName(idx),\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: autoColor\n })\n });\n itemGroup.add(labelEl);\n }\n\n var itemDetailModel = itemModel.getModel('detail');\n\n if (itemDetailModel.get('show')) {\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\n var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\n var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\n var width = parsePercent(itemDetailModel.get('width'), posInfo.r);\n var height = parsePercent(itemDetailModel.get('height'), posInfo.r);\n var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor;\n var labelEl = newDetailEls[idx];\n var formatter_1 = itemDetailModel.get('formatter');\n labelEl.attr({\n style: createTextStyle(itemDetailModel, {\n x: detailX,\n y: detailY,\n text: formatLabel(value, formatter_1),\n width: isNaN(width) ? null : width,\n height: isNaN(height) ? null : height,\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: detailColor\n })\n });\n setLabelValueAnimation(labelEl, {\n normal: itemDetailModel\n }, value, function (value) {\n return formatLabel(value, formatter_1);\n });\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\n getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) {\n return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);\n }\n });\n itemGroup.add(labelEl);\n }\n\n contentGroup.add(itemGroup);\n });\n this.group.add(contentGroup);\n this._titleEls = newTitleEls;\n this._detailEls = newDetailEls;\n };\n\n GaugeView.type = 'gauge';\n return GaugeView;\n}(ChartView);\n\nexport default GaugeView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createListSimply from '../helper/createListSimply';\nimport SeriesModel from '../../model/Series';\n\nvar GaugeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GaugeSeriesModel, _super);\n\n function GaugeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeSeriesModel.type;\n _this.visualStyleAccessPath = 'itemStyle';\n _this.useColorPaletteOnData = true;\n return _this;\n }\n\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListSimply(this, ['value']);\n };\n\n GaugeSeriesModel.type = 'series.gauge';\n GaugeSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n legendHoverLink: true,\n radius: '75%',\n startAngle: 225,\n endAngle: -45,\n clockwise: true,\n // 最小值\n min: 0,\n // 最大值\n max: 100,\n // 分割段数,默认为10\n splitNumber: 10,\n // 坐标轴线\n axisLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n roundCap: false,\n lineStyle: {\n color: [[1, '#E6EBF8']],\n width: 10\n }\n },\n // 坐标轴线\n progress: {\n // 默认显示,属性show控制显示与否\n show: false,\n overlap: true,\n width: 10,\n roundCap: false,\n clip: true\n },\n // 分隔线\n splitLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n // 属性length控制线长\n length: 10,\n distance: 10,\n // 属性lineStyle(详见lineStyle)控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 3,\n type: 'solid'\n }\n },\n // 坐标轴小标记\n axisTick: {\n // 属性show控制显示与否,默认不显示\n show: true,\n // 每份split细分多少段\n splitNumber: 5,\n // 属性length控制线长\n length: 6,\n distance: 10,\n // 属性lineStyle控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 1,\n type: 'solid'\n }\n },\n axisLabel: {\n show: true,\n distance: 15,\n // formatter: null,\n color: '#464646',\n fontSize: 12\n },\n pointer: {\n icon: null,\n offsetCenter: [0, 0],\n show: true,\n length: '60%',\n width: 6,\n keepAspect: false\n },\n anchor: {\n show: false,\n showAbove: false,\n size: 6,\n icon: 'circle',\n offsetCenter: [0, 0],\n keepAspect: false,\n itemStyle: {\n color: '#fff',\n borderWidth: 0,\n borderColor: '#5470c6'\n }\n },\n title: {\n show: true,\n // x, y,单位px\n offsetCenter: [0, '20%'],\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 16,\n valueAnimation: false\n },\n detail: {\n show: true,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n borderColor: '#ccc',\n width: 100,\n height: null,\n padding: [5, 10],\n // x, y,单位px\n offsetCenter: [0, '40%'],\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 30,\n fontWeight: 'bold',\n lineHeight: 30,\n valueAnimation: false\n }\n };\n return GaugeSeriesModel;\n}(SeriesModel);\n\nexport default GaugeSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GaugeView from './GaugeView';\nimport GaugeSeriesModel from './GaugeSeries';\nexport function install(registers) {\n registers.registerChartView(GaugeView);\n registers.registerSeriesModel(GaugeSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport ChartView from '../../view/Chart';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\n\nvar FunnelPiece =\n/** @class */\nfunction (_super) {\n __extends(FunnelPiece, _super);\n\n function FunnelPiece(data, idx) {\n var _this = _super.call(this) || this;\n\n var polygon = _this;\n var labelLine = new graphic.Polyline();\n var text = new graphic.Text();\n polygon.setTextContent(text);\n\n _this.setTextGuideLine(labelLine);\n\n _this.updateData(data, idx, true);\n\n return _this;\n }\n\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\n var polygon = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var opacity = itemModel.get(opacityAccessPath);\n opacity = opacity == null ? 1 : opacity; // Update common style\n\n polygon.useStyle(data.getItemVisual(idx, 'style'));\n polygon.style.lineJoin = 'round';\n\n if (firstCreate) {\n polygon.setShape({\n points: layout.points\n });\n polygon.style.opacity = 0;\n graphic.initProps(polygon, {\n style: {\n opacity: opacity\n }\n }, seriesModel, idx);\n } else {\n graphic.updateProps(polygon, {\n style: {\n opacity: opacity\n },\n shape: {\n points: layout.points\n }\n }, seriesModel, idx);\n }\n\n setStatesStylesFromModel(polygon, itemModel);\n\n this._updateLabel(data, idx);\n\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n };\n\n FunnelPiece.prototype._updateLabel = function (data, idx) {\n var polygon = this;\n var labelLine = this.getTextGuideLine();\n var labelText = polygon.getTextContent();\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style.fill;\n setLabelStyle( // position will not be used in setLabelStyle\n labelText, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: data.getName(idx)\n }, {\n normal: {\n align: labelLayout.textAlign,\n verticalAlign: labelLayout.verticalAlign\n }\n });\n polygon.setTextConfig({\n local: true,\n inside: !!labelLayout.inside,\n insideStroke: visualColor,\n // insideFill: 'auto',\n outsideFill: visualColor\n });\n var linePoints = labelLayout.linePoints;\n labelLine.setShape({\n points: linePoints\n });\n polygon.textGuideLineConfig = {\n anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\n }; // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n originX: labelLayout.x,\n originY: labelLayout.y,\n z2: 10\n });\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\n // Default use item visual color\n stroke: visualColor\n });\n };\n\n return FunnelPiece;\n}(graphic.Polygon);\n\nvar FunnelView =\n/** @class */\nfunction (_super) {\n __extends(FunnelView, _super);\n\n function FunnelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelView.type;\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n data.diff(oldData).add(function (idx) {\n var funnelPiece = new FunnelPiece(data, idx);\n data.setItemGraphicEl(idx, funnelPiece);\n group.add(funnelPiece);\n }).update(function (newIdx, oldIdx) {\n var piece = oldData.getItemGraphicEl(oldIdx);\n piece.updateData(data, newIdx);\n group.add(piece);\n data.setItemGraphicEl(newIdx, piece);\n }).remove(function (idx) {\n var piece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piece, seriesModel, idx);\n }).execute();\n this._data = data;\n };\n\n FunnelView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n FunnelView.prototype.dispose = function () {};\n\n FunnelView.type = 'funnel';\n return FunnelView;\n}(ChartView);\n\nexport default FunnelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport createListSimply from '../helper/createListSimply';\nimport { defaultEmphasis } from '../../util/model';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\nimport SeriesModel from '../../model/Series';\n\nvar FunnelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(FunnelSeriesModel, _super);\n\n function FunnelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelSeriesModel.type;\n _this.useColorPaletteOnData = true;\n return _this;\n }\n\n FunnelSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)); // Extend labelLine emphasis\n\n this._defaultLabelLine(option);\n };\n\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n }; // Overwrite\n\n\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n\n var params = _super.prototype.getDataParams.call(this, dataIndex);\n\n var valueDim = data.mapDimension('value');\n var sum = data.getSum(valueDim); // Percent is 0 if sum is 0\n\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n params.$vars.push('percent');\n return params;\n };\n\n FunnelSeriesModel.type = 'series.funnel';\n FunnelSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n // 默认取数据最小最大值\n // min: 0,\n // max: 100,\n minSize: '0%',\n maxSize: '100%',\n sort: 'descending',\n orient: 'vertical',\n gap: 0,\n funnelAlign: 'center',\n label: {\n show: true,\n position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n labelLine: {\n show: true,\n length: 20,\n lineStyle: {\n // color: 各异,\n width: 1\n }\n },\n itemStyle: {\n // color: 各异,\n borderColor: '#fff',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return FunnelSeriesModel;\n}(SeriesModel);\n\nexport default FunnelSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as layout from '../../util/layout';\nimport { parsePercent, linearMap } from '../../util/number';\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction getSortedIndices(data, sort) {\n var valueDim = data.mapDimension('value');\n var valueArr = data.mapArray(valueDim, function (val) {\n return val;\n });\n var indices = [];\n var isAscending = sort === 'ascending';\n\n for (var i = 0, len = data.count(); i < len; i++) {\n indices[i] = i;\n } // Add custom sortable function & none sortable opetion by \"options.sort\"\n\n\n if (typeof sort === 'function') {\n indices.sort(sort);\n } else if (sort !== 'none') {\n indices.sort(function (a, b) {\n return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n });\n }\n\n return indices;\n}\n\nfunction labelLayout(data) {\n var seriesModel = data.hostModel;\n var orient = seriesModel.get('orient');\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n var labelPosition = labelModel.get('position');\n var labelLineModel = itemModel.getModel('labelLine');\n var layout = data.getItemLayout(idx);\n var points = layout.points;\n var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\n var textAlign;\n var textX;\n var textY;\n var linePoints;\n\n if (isLabelInside) {\n if (labelPosition === 'insideLeft') {\n textX = (points[0][0] + points[3][0]) / 2 + 5;\n textY = (points[0][1] + points[3][1]) / 2;\n textAlign = 'left';\n } else if (labelPosition === 'insideRight') {\n textX = (points[1][0] + points[2][0]) / 2 - 5;\n textY = (points[1][1] + points[2][1]) / 2;\n textAlign = 'right';\n } else {\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n textAlign = 'center';\n }\n\n linePoints = [[textX, textY], [textX, textY]];\n } else {\n var x1 = void 0;\n var y1 = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var labelLineLen = labelLineModel.get('length');\n\n if (process.env.NODE_ENV !== 'production') {\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\n labelPosition = 'left';\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\n }\n\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\n labelPosition = 'bottom';\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\n }\n }\n\n if (labelPosition === 'left') {\n // Left side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n } else if (labelPosition === 'right') {\n // Right side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n } else if (labelPosition === 'top') {\n // Top side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else if (labelPosition === 'bottom') {\n // Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else if (labelPosition === 'rightTop') {\n // RightTop side\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'top';\n }\n } else if (labelPosition === 'rightBottom') {\n // RightBottom side\n x1 = points[2][0];\n y1 = points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'bottom';\n }\n } else if (labelPosition === 'leftTop') {\n // LeftTop side\n x1 = points[0][0];\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else if (labelPosition === 'leftBottom') {\n // LeftBottom side\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else {\n // Right side or Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n }\n }\n\n if (orient === 'horizontal') {\n x2 = x1;\n textX = x2;\n } else {\n y2 = y1;\n textY = y2;\n }\n\n linePoints = [[x1, y1], [x2, y2]];\n }\n\n layout.label = {\n linePoints: linePoints,\n x: textX,\n y: textY,\n verticalAlign: 'middle',\n textAlign: textAlign,\n inside: isLabelInside\n };\n });\n}\n\nexport default function funnelLayout(ecModel, api) {\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var sort = seriesModel.get('sort');\n var viewRect = getViewRect(seriesModel, api);\n var orient = seriesModel.get('orient');\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var indices = getSortedIndices(data, sort);\n var x = viewRect.x;\n var y = viewRect.y;\n var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];\n var dataExtent = data.getDataExtent(valueDim);\n var min = seriesModel.get('min');\n var max = seriesModel.get('max');\n\n if (min == null) {\n min = Math.min(dataExtent[0], 0);\n }\n\n if (max == null) {\n max = dataExtent[1];\n }\n\n var funnelAlign = seriesModel.get('funnelAlign');\n var gap = seriesModel.get('gap');\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\n\n var getLinePoints = function (idx, offset) {\n // End point index is data.count() and we assign it 0\n if (orient === 'horizontal') {\n var val_1 = data.get(valueDim, idx) || 0;\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\n var y0 = void 0;\n\n switch (funnelAlign) {\n case 'top':\n y0 = y;\n break;\n\n case 'center':\n y0 = y + (viewHeight - itemHeight) / 2;\n break;\n\n case 'bottom':\n y0 = y + (viewHeight - itemHeight);\n break;\n }\n\n return [[offset, y0], [offset, y0 + itemHeight]];\n }\n\n var val = data.get(valueDim, idx) || 0;\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n var x0;\n\n switch (funnelAlign) {\n case 'left':\n x0 = x;\n break;\n\n case 'center':\n x0 = x + (viewWidth - itemWidth) / 2;\n break;\n\n case 'right':\n x0 = x + viewWidth - itemWidth;\n break;\n }\n\n return [[x0, offset], [x0 + itemWidth, offset]];\n };\n\n if (sort === 'ascending') {\n // From bottom to top\n itemSize = -itemSize;\n gap = -gap;\n\n if (orient === 'horizontal') {\n x += viewWidth;\n } else {\n y += viewHeight;\n }\n\n indices = indices.reverse();\n }\n\n for (var i = 0; i < indices.length; i++) {\n var idx = indices[i];\n var nextIdx = indices[i + 1];\n var itemModel = data.getItemModel(idx);\n\n if (orient === 'horizontal') {\n var width = itemModel.get(['itemStyle', 'width']);\n\n if (width == null) {\n width = itemSize;\n } else {\n width = parsePercent(width, viewWidth);\n\n if (sort === 'ascending') {\n width = -width;\n }\n }\n\n var start = getLinePoints(idx, x);\n var end = getLinePoints(nextIdx, x + width);\n x += width + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n } else {\n var height = itemModel.get(['itemStyle', 'height']);\n\n if (height == null) {\n height = itemSize;\n } else {\n height = parsePercent(height, viewHeight);\n\n if (sort === 'ascending') {\n height = -height;\n }\n }\n\n var start = getLinePoints(idx, y);\n var end = getLinePoints(nextIdx, y + height);\n y += height + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n }\n }\n\n labelLayout(data);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport FunnelView from './FunnelView';\nimport FunnelSeriesModel from './FunnelSeries';\nimport funnelLayout from './funnelLayout';\nimport dataFilter from '../../processor/dataFilter';\nexport function install(registers) {\n registers.registerChartView(FunnelView);\n registers.registerSeriesModel(FunnelSeriesModel);\n registers.registerLayout(funnelLayout);\n registers.registerProcessor(dataFilter('funnel'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport ChartView from '../../view/Chart';\nimport { numericToNumber } from '../../util/number';\nimport { eqNaN } from 'zrender/lib/core/util';\nvar DEFAULT_SMOOTH = 0.3;\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n _this._dataGroup = new graphic.Group();\n _this._initialized = false;\n return _this;\n }\n\n ParallelView.prototype.init = function () {\n this.group.add(this._dataGroup);\n };\n /**\n * @override\n */\n\n\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var dataGroup = this._dataGroup;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n data.diff(oldData).add(add).update(update).remove(remove).execute();\n\n function add(newDataIndex) {\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function update(newDataIndex, oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n data.setItemGraphicEl(newDataIndex, line);\n graphic.updateProps(line, {\n shape: {\n points: points\n }\n }, seriesModel, newDataIndex);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function remove(oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n dataGroup.remove(line);\n } // First create\n\n\n if (!this._initialized) {\n this._initialized = true;\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n // Callback will be invoked immediately if there is no animation\n setTimeout(function () {\n dataGroup.removeClipPath();\n });\n });\n dataGroup.setClipPath(clipPath);\n }\n\n this._data = data;\n };\n\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._initialized = true;\n this._data = null;\n\n this._dataGroup.removeAll();\n };\n\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n line.incremental = true;\n updateElCommon(line, data, dataIndex, seriesScope);\n }\n };\n\n ParallelView.prototype.remove = function () {\n this._dataGroup && this._dataGroup.removeAll();\n this._data = null;\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ChartView);\n\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n var parallelModel = coordSys.model;\n var rect = coordSys.getRect();\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n rectEl.setShape(dim, 0);\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width,\n height: rect.height\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n var points = [];\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimName = dimensions[i];\n var value = data.get(data.mapDimension(dimName), dataIndex);\n\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n points.push(coordSys.dataToPoint(value, dimName));\n }\n }\n\n return points;\n}\n\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n var line = new graphic.Polyline({\n shape: {\n points: points\n },\n // silent: true,\n z2: 10\n });\n dataGroup.add(line);\n data.setItemGraphicEl(dataIndex, line);\n return line;\n}\n\nfunction makeSeriesScope(seriesModel) {\n var smooth = seriesModel.get('smooth', true);\n smooth === true && (smooth = DEFAULT_SMOOTH);\n smooth = numericToNumber(smooth);\n eqNaN(smooth) && (smooth = 0);\n return {\n smooth: smooth\n };\n}\n\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.fill = null;\n el.setShape('smooth', seriesScope.smooth);\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n} // function simpleDiff(oldData, newData, dimensions) {\n// let oldLen;\n// if (!oldData\n// || !oldData.__plProgressive\n// || (oldLen = oldData.count()) !== newData.count()\n// ) {\n// return true;\n// }\n// let dimLen = dimensions.length;\n// for (let i = 0; i < oldLen; i++) {\n// for (let j = 0; j < dimLen; j++) {\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n// return true;\n// }\n// }\n// }\n// return false;\n// }\n// FIXME put in common util?\n\n\nfunction isEmptyValue(val, axisType) {\n return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\n\nexport default ParallelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, bind } from 'zrender/lib/core/util';\nimport SeriesModel from '../../model/Series';\nimport createListFromArray from '../helper/createListFromArray';\n\nvar ParallelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelSeriesModel, _super);\n\n function ParallelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\n });\n };\n /**\n * User can get data raw indices on 'axisAreaSelected' event received.\n *\n * @return Raw indices\n */\n\n\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\n var coordSys = this.coordinateSystem;\n var data = this.getData();\n var indices = [];\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n if (activeState === theActiveState) {\n indices.push(data.getRawIndex(dataIndex));\n }\n });\n return indices;\n };\n\n ParallelSeriesModel.type = 'series.parallel';\n ParallelSeriesModel.dependencies = ['parallel'];\n ParallelSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'parallel',\n parallelIndex: 0,\n label: {\n show: false\n },\n inactiveOpacity: 0.05,\n activeOpacity: 1,\n lineStyle: {\n width: 1,\n opacity: 0.45,\n type: 'solid'\n },\n emphasis: {\n label: {\n show: false\n }\n },\n progressive: 500,\n smooth: false,\n animationEasing: 'linear'\n };\n return ParallelSeriesModel;\n}(SeriesModel);\n\nfunction makeDefaultEncode(seriesModel) {\n // The mapping of parallelAxis dimension to data dimension can\n // be specified in parallelAxis.option.dim. For example, if\n // parallelAxis.option.dim is 'dim3', it mapping to the third\n // dimension of data. But `data.encode` has higher priority.\n // Moreover, parallelModel.dimension should not be regarded as data\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n\n if (!parallelModel) {\n return;\n }\n\n var encodeDefine = {};\n each(parallelModel.dimensions, function (axisDim) {\n var dataDimIndex = convertDimNameToNumber(axisDim);\n encodeDefine[axisDim] = dataDimIndex;\n });\n return encodeDefine;\n}\n\nfunction convertDimNameToNumber(dimName) {\n return +dimName.replace('dim', '');\n}\n\nexport default ParallelSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar opacityAccessPath = ['lineStyle', 'opacity'];\nvar parallelVisual = {\n seriesType: 'parallel',\n reset: function (seriesModel, ecModel) {\n var coordSys = seriesModel.coordinateSystem;\n var opacityMap = {\n normal: seriesModel.get(['lineStyle', 'opacity']),\n active: seriesModel.get('activeOpacity'),\n inactive: seriesModel.get('inactiveOpacity')\n };\n return {\n progress: function (params, data) {\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\n var opacity = opacityMap[activeState];\n\n if (activeState === 'normal' && data.hasItemOption) {\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n itemOpacity != null && (opacity = itemOpacity);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n existsStyle.opacity = opacity;\n }, params.start, params.end);\n }\n };\n }\n};\nexport default parallelVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nexport default function parallelPreprocessor(option) {\n createParallelIfNeeded(option);\n mergeAxisOptionFromParallel(option);\n}\n/**\n * Create a parallel coordinate if not exists.\n * @inner\n */\n\nfunction createParallelIfNeeded(option) {\n if (option.parallel) {\n return;\n }\n\n var hasParallelSeries = false;\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'parallel') {\n hasParallelSeries = true;\n }\n });\n\n if (hasParallelSeries) {\n option.parallel = [{}];\n }\n}\n/**\n * Merge aixs definition from parallel option (if exists) to axis option.\n * @inner\n */\n\n\nfunction mergeAxisOptionFromParallel(option) {\n var axes = modelUtil.normalizeToArray(option.parallelAxis);\n zrUtil.each(axes, function (axisOption) {\n if (!zrUtil.isObject(axisOption)) {\n return;\n }\n\n var parallelIndex = axisOption.parallelIndex || 0;\n var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n\n if (parallelOption && parallelOption.parallelAxisDefault) {\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component';\nimport { each, bind, extend } from 'zrender/lib/core/util';\nimport { createOrUpdate } from '../../util/throttle';\nvar CLICK_THRESHOLD = 5; // > 4\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n return _this;\n }\n\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n\n ParallelView.prototype.dispose = function (ecModel, api) {\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\n * @internal\n * @param {Object} [opt] If null, cancle the last action triggering for debounce.\n */\n\n\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\n * @internal\n */\n\n\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\n\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\nexport default ParallelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\n\nvar ParallelModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelModel, _super);\n\n function ParallelModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelModel.type;\n return _this;\n }\n\n ParallelModel.prototype.init = function () {\n _super.prototype.init.apply(this, arguments);\n\n this.mergeOption({});\n };\n\n ParallelModel.prototype.mergeOption = function (newOption) {\n var thisOption = this.option;\n newOption && zrUtil.merge(thisOption, newOption, true);\n\n this._initDimensions();\n };\n /**\n * Whether series or axis is in this coordinate system.\n */\n\n\n ParallelModel.prototype.contains = function (model, ecModel) {\n var parallelIndex = model.get('parallelIndex');\n return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n };\n\n ParallelModel.prototype.setAxisExpand = function (opt) {\n zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n if (opt.hasOwnProperty(name)) {\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n this.option[name] = opt[name];\n }\n }, this);\n };\n\n ParallelModel.prototype._initDimensions = function () {\n var dimensions = this.dimensions = [];\n var parallelAxisIndex = this.parallelAxisIndex = [];\n var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n mainType: 'parallelAxis'\n }), function (axisModel) {\n // Can not use this.contains here, because\n // initialization has not been completed yet.\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n }, this);\n zrUtil.each(axisModels, function (axisModel) {\n dimensions.push('dim' + axisModel.get('dim'));\n parallelAxisIndex.push(axisModel.componentIndex);\n });\n };\n\n ParallelModel.type = 'parallel';\n ParallelModel.dependencies = ['parallelAxis'];\n ParallelModel.layoutMode = 'box';\n ParallelModel.defaultOption = {\n zlevel: 0,\n z: 0,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n layout: 'horizontal',\n // FIXME\n // naming?\n axisExpandable: false,\n axisExpandCenter: null,\n axisExpandCount: 0,\n axisExpandWidth: 50,\n axisExpandRate: 17,\n axisExpandDebounce: 50,\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n // Do not doc to user until necessary.\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n axisExpandTriggerOn: 'click',\n parallelAxisDefault: null\n };\n return ParallelModel;\n}(ComponentModel);\n\nexport default ParallelModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar ParallelAxis =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxis, _super);\n\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.axisIndex = axisIndex;\n return _this;\n }\n\n ParallelAxis.prototype.isHorizontal = function () {\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n };\n\n return ParallelAxis;\n}(Axis);\n\nexport default ParallelAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Calculate slider move result.\n * Usage:\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\n *\n * @param delta Move length.\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\n * handleEnds will be modified in this method.\n * @param extent handleEnds is restricted by extent.\n * extent[0] should less or equals than extent[1].\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\n * @param minSpan The range of dataZoom can not be smaller than that.\n * If not set, handle0 and cross handle1. If set as a non-negative\n * number (including `0`), handles will push each other when reaching\n * the minSpan.\n * @param maxSpan The range of dataZoom can not be larger than that.\n * @return The input handleEnds.\n */\nexport default function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\n delta = delta || 0;\n var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined.\n\n if (minSpan != null) {\n minSpan = restrict(minSpan, [0, extentSpan]);\n }\n\n if (maxSpan != null) {\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\n }\n\n if (handleIndex === 'all') {\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\n handleSpan = restrict(handleSpan, [0, extentSpan]);\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\n handleIndex = 0;\n }\n\n handleEnds[0] = restrict(handleEnds[0], extent);\n handleEnds[1] = restrict(handleEnds[1], extent);\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\n handleEnds[handleIndex] += delta; // Restrict in extent.\n\n var extentMinSpan = minSpan || 0;\n var realExtent = extent.slice();\n originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span.\n\n var currDistSign;\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\n // If minSpan exists, 'cross' is forbidden.\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\n } // Shrink span.\n\n\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (maxSpan != null && currDistSign.span > maxSpan) {\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\n }\n\n return handleEnds;\n}\n\nfunction getSpanSign(handleEnds, handleIndex) {\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n // is at left of handleEnds[1] for non-cross case.\n\n return {\n span: Math.abs(dist),\n sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1\n };\n}\n\nfunction restrict(value, extend) {\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel Coordinates\n * <https://en.wikipedia.org/wiki/Parallel_coordinates>\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as layoutUtil from '../../util/layout';\nimport * as axisHelper from '../../coord/axisHelper';\nimport ParallelAxis from './ParallelAxis';\nimport * as graphic from '../../util/graphic';\nimport * as numberUtil from '../../util/number';\nimport sliderMove from '../../component/helper/sliderMove';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\n\nvar Parallel =\n/** @class */\nfunction () {\n function Parallel(parallelModel, ecModel, api) {\n this.type = 'parallel';\n /**\n * key: dimension\n */\n\n this._axesMap = zrUtil.createHashMap();\n /**\n * key: dimension\n * value: {position: [], rotation, }\n */\n\n this._axesLayout = {};\n this.dimensions = parallelModel.dimensions;\n this._model = parallelModel;\n\n this._init(parallelModel, ecModel, api);\n }\n\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\n var dimensions = parallelModel.dimensions;\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\n each(dimensions, function (dim, idx) {\n var axisIndex = parallelAxisIndex[idx];\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Injection\n\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = axisModel.coordinateSystem = this;\n }, this);\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Parallel.prototype.update = function (ecModel, api) {\n this._updateAxesFromSeries(this._model, ecModel);\n };\n\n Parallel.prototype.containPoint = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var axisBase = layoutInfo.axisBase;\n var layoutBase = layoutInfo.layoutBase;\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var pAxis = point[1 - pixelDimIndex];\n var pLayout = point[pixelDimIndex];\n return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n };\n\n Parallel.prototype.getModel = function () {\n return this._model;\n };\n /**\n * Update properties from series\n */\n\n\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n ecModel.eachSeries(function (seriesModel) {\n if (!parallelModel.contains(seriesModel, ecModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n each(this.dimensions, function (dim) {\n var axis = this._axesMap.get(dim);\n\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n axisHelper.niceScaleExtent(axis.scale, axis.model);\n }, this);\n }, this);\n };\n /**\n * Resize the parallel coordinate system.\n */\n\n\n Parallel.prototype.resize = function (parallelModel, api) {\n this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._layoutAxes();\n };\n\n Parallel.prototype.getRect = function () {\n return this._rect;\n };\n\n Parallel.prototype._makeLayoutInfo = function () {\n var parallelModel = this._model;\n var rect = this._rect;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var layout = parallelModel.get('layout');\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n var layoutLength = rect[wh[pixelDimIndex]];\n var layoutExtent = [0, layoutLength];\n var axisCount = this.dimensions.length;\n var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n // where collapsed axes should be overlapped.\n\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\n var winSize;\n\n if (!axisExpandWindow) {\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n } else {\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n }\n\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small.\n\n axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1].\n\n var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates.\n\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n return {\n layout: layout,\n pixelDimIndex: pixelDimIndex,\n layoutBase: rect[xy[pixelDimIndex]],\n layoutLength: layoutLength,\n axisBase: rect[xy[1 - pixelDimIndex]],\n axisLength: rect[wh[1 - pixelDimIndex]],\n axisExpandable: axisExpandable,\n axisExpandWidth: axisExpandWidth,\n axisCollapseWidth: axisCollapseWidth,\n axisExpandWindow: axisExpandWindow,\n axisCount: axisCount,\n winInnerIndices: winInnerIndices,\n axisExpandWindow0Pos: axisExpandWindow0Pos\n };\n };\n\n Parallel.prototype._layoutAxes = function () {\n var rect = this._rect;\n var axes = this._axesMap;\n var dimensions = this.dimensions;\n\n var layoutInfo = this._makeLayoutInfo();\n\n var layout = layoutInfo.layout;\n axes.each(function (axis) {\n var axisExtent = [0, layoutInfo.axisLength];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n });\n each(dimensions, function (dim, idx) {\n var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n var positionTable = {\n horizontal: {\n x: posInfo.position,\n y: layoutInfo.axisLength\n },\n vertical: {\n x: 0,\n y: posInfo.position\n }\n };\n var rotationTable = {\n horizontal: PI / 2,\n vertical: 0\n };\n var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n var rotation = rotationTable[layout];\n var transform = matrix.create();\n matrix.rotate(transform, transform, rotation);\n matrix.translate(transform, transform, position); // TODO\n // tick layout info\n // TODO\n // update dimensions info based on axis order.\n\n this._axesLayout[dim] = {\n position: position,\n rotation: rotation,\n transform: transform,\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n axisLabelShow: posInfo.axisLabelShow,\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n tickDirection: 1,\n labelDirection: 1\n };\n }, this);\n };\n /**\n * Get axis by dim.\n */\n\n\n Parallel.prototype.getAxis = function (dim) {\n return this._axesMap.get(dim);\n };\n /**\n * Convert a dim value of a single item of series data to Point.\n */\n\n\n Parallel.prototype.dataToPoint = function (value, dim) {\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n };\n /**\n * Travel data for one time, get activeState of each data item.\n * @param start the start dataIndex that travel from.\n * @param end the next dataIndex of the last dataIndex will be travel.\n */\n\n\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n start == null && (start = 0);\n end == null && (end = data.count());\n var axesMap = this._axesMap;\n var dimensions = this.dimensions;\n var dataDimensions = [];\n var axisModels = [];\n zrUtil.each(dimensions, function (axisDim) {\n dataDimensions.push(data.mapDimension(axisDim));\n axisModels.push(axesMap.get(axisDim).model);\n });\n var hasActiveSet = this.hasAxisBrushed();\n\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\n var activeState = void 0;\n\n if (!hasActiveSet) {\n activeState = 'normal';\n } else {\n activeState = 'active';\n var values = data.getValues(dataDimensions, dataIndex);\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n var state = axisModels[j].getActiveState(values[j]);\n\n if (state === 'inactive') {\n activeState = 'inactive';\n break;\n }\n }\n }\n\n callback(activeState, dataIndex);\n }\n };\n /**\n * Whether has any activeSet.\n */\n\n\n Parallel.prototype.hasAxisBrushed = function () {\n var dimensions = this.dimensions;\n var axesMap = this._axesMap;\n var hasActiveSet = false;\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n hasActiveSet = true;\n }\n }\n\n return hasActiveSet;\n };\n /**\n * Convert coords of each axis to Point.\n * Return point. For example: [10, 20]\n */\n\n\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n var axisLayout = this._axesLayout[dim];\n return graphic.applyTransform([coord, 0], axisLayout.transform);\n };\n /**\n * Get axis layout.\n */\n\n\n Parallel.prototype.getAxisLayout = function (dim) {\n return zrUtil.clone(this._axesLayout[dim]);\n };\n /**\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\n */\n\n\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system.\n\n if (!this.containPoint(point)) {\n return {\n behavior: 'none',\n axisExpandWindow: axisExpandWindow\n };\n } // Conver the point from global to expand coordinates.\n\n\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be\n // slided when mouse is the center area of the window.\n\n var delta;\n var behavior = 'slide';\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n\n var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary.\n\n\n var useJump = triggerArea[0] != null;\n\n if (axisCollapseWidth) {\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n behavior = 'jump';\n delta = pointCoord - winSize * triggerArea[2];\n } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n behavior = 'jump';\n delta = pointCoord - winSize * (1 - triggerArea[2]);\n } else {\n (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n }\n\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove.\n : behavior = 'none';\n } // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n else {\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n var pos = extent[1] * pointCoord / winSize2;\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n }\n\n return {\n axisExpandWindow: axisExpandWindow,\n behavior: behavior\n };\n };\n\n return Parallel;\n}();\n\nfunction restrict(len, extent) {\n return mathMin(mathMax(len, extent[0]), extent[1]);\n}\n\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n return {\n position: step * axisIndex,\n axisNameAvailableWidth: step,\n axisLabelShow: true\n };\n}\n\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n var layoutLength = layoutInfo.layoutLength;\n var axisExpandWidth = layoutInfo.axisExpandWidth;\n var axisCount = layoutInfo.axisCount;\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var winInnerIndices = layoutInfo.winInnerIndices;\n var position;\n var axisNameAvailableWidth = axisCollapseWidth;\n var axisLabelShow = false;\n var nameTruncateMaxWidth;\n\n if (axisIndex < winInnerIndices[0]) {\n position = axisIndex * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n } else if (axisIndex <= winInnerIndices[1]) {\n position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n axisNameAvailableWidth = axisExpandWidth;\n axisLabelShow = true;\n } else {\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n }\n\n return {\n position: position,\n axisNameAvailableWidth: axisNameAvailableWidth,\n axisLabelShow: axisLabelShow,\n nameTruncateMaxWidth: nameTruncateMaxWidth\n };\n}\n\nexport default Parallel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel coordinate system creater.\n */\nimport Parallel from './Parallel';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nfunction createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nvar parallelCoordSysCreator = {\n create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper';\nimport * as numberUtil from '../../util/number';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\n\nvar ParallelAxisModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisModel, _super);\n\n function ParallelAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisModel.type;\n /**\n * @readOnly\n */\n\n _this.activeIntervals = [];\n return _this;\n }\n\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n // So do not transfer decal directly.\n ])(this.getModel('areaSelectStyle'));\n };\n /**\n * The code of this feature is put on AxisModel but not ParallelAxis,\n * because axisModel can be alive after echarts updating but instance of\n * ParallelAxis having been disposed. this._activeInterval should be kept\n * when action dispatched (i.e. legend click).\n *\n * @param intervals `interval.length === 0` means set all active.\n */\n\n\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n var activeIntervals = this.activeIntervals = zrUtil.clone(intervals); // Normalize\n\n if (activeIntervals) {\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\n numberUtil.asc(activeIntervals[i]);\n }\n }\n };\n /**\n * @param value When only attempting detect whether 'no activeIntervals set',\n * `value` is not needed to be input.\n */\n\n\n ParallelAxisModel.prototype.getActiveState = function (value) {\n var activeIntervals = this.activeIntervals;\n\n if (!activeIntervals.length) {\n return 'normal';\n }\n\n if (value == null || isNaN(+value)) {\n return 'inactive';\n } // Simple optimization\n\n\n if (activeIntervals.length === 1) {\n var interval = activeIntervals[0];\n\n if (interval[0] <= value && value <= interval[1]) {\n return 'active';\n }\n } else {\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n return 'active';\n }\n }\n }\n\n return 'inactive';\n };\n\n return ParallelAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { curry, each, map, bind, merge, clone, defaults, assert } from 'zrender/lib/core/util';\nimport Eventful from 'zrender/lib/core/Eventful';\nimport * as graphic from '../../util/graphic';\nimport * as interactionMutex from './interactionMutex';\nimport DataDiffer from '../../data/DataDiffer';\nvar BRUSH_PANEL_GLOBAL = true;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n w: [0, 0],\n e: [0, 1],\n n: [1, 0],\n s: [1, 1]\n};\nvar CURSOR_MAP = {\n w: 'ew',\n e: 'ew',\n n: 'ns',\n s: 'ns',\n ne: 'nesw',\n sw: 'nesw',\n nw: 'nwse',\n se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n brushStyle: {\n lineWidth: 2,\n stroke: 'rgba(210,219,238,0.3)',\n fill: '#D2DBEE'\n },\n transformable: true,\n brushMode: 'single',\n removeOnClick: false\n};\nvar baseUID = 0;\n/**\n * params:\n * areas: Array.<Array>, coord relates to container group,\n * If no container specified, to global.\n * opt {\n * isEnd: boolean,\n * removeOnClick: boolean\n * }\n */\n\nvar BrushController =\n/** @class */\nfunction (_super) {\n __extends(BrushController, _super);\n\n function BrushController(zr) {\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n\n\n _this._track = [];\n /**\n * @internal\n */\n\n _this._covers = [];\n _this._handlers = {};\n\n if (process.env.NODE_ENV !== 'production') {\n assert(zr);\n }\n\n _this._zr = zr;\n _this.group = new graphic.Group();\n _this._uid = 'brushController_' + baseUID++;\n each(pointerHandlers, function (handler, eventName) {\n this._handlers[eventName] = bind(handler, this);\n }, _this);\n return _this;\n }\n /**\n * If set to `false`, select disabled.\n */\n\n\n BrushController.prototype.enableBrush = function (brushOption) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n this._brushType && this._doDisableBrush();\n brushOption.brushType && this._doEnableBrush(brushOption);\n return this;\n };\n\n BrushController.prototype._doEnableBrush = function (brushOption) {\n var zr = this._zr; // Consider roam, which takes globalPan too.\n\n if (!this._enableGlobalPan) {\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\n }\n\n each(this._handlers, function (handler, eventName) {\n zr.on(eventName, handler);\n });\n this._brushType = brushOption.brushType;\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\n };\n\n BrushController.prototype._doDisableBrush = function () {\n var zr = this._zr;\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\n each(this._handlers, function (handler, eventName) {\n zr.off(eventName, handler);\n });\n this._brushType = this._brushOption = null;\n };\n /**\n * @param panelOpts If not pass, it is global brush.\n */\n\n\n BrushController.prototype.setPanels = function (panelOpts) {\n if (panelOpts && panelOpts.length) {\n var panels_1 = this._panels = {};\n each(panelOpts, function (panelOpts) {\n panels_1[panelOpts.panelId] = clone(panelOpts);\n });\n } else {\n this._panels = null;\n }\n\n return this;\n };\n\n BrushController.prototype.mount = function (opt) {\n opt = opt || {};\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = true; // should be at first.\n }\n\n this._enableGlobalPan = opt.enableGlobalPan;\n var thisGroup = this.group;\n\n this._zr.add(thisGroup);\n\n thisGroup.attr({\n x: opt.x || 0,\n y: opt.y || 0,\n rotation: opt.rotation || 0,\n scaleX: opt.scaleX || 1,\n scaleY: opt.scaleY || 1\n });\n this._transform = thisGroup.getLocalTransform();\n return this;\n }; // eachCover(cb, context): void {\n // each(this._covers, cb, context);\n // }\n\n /**\n * Update covers.\n * @param coverConfigList\n * If coverConfigList is null/undefined, all covers removed.\n */\n\n\n BrushController.prototype.updateCovers = function (coverConfigList) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n coverConfigList = map(coverConfigList, function (coverConfig) {\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\n });\n var tmpIdPrefix = '\\0-brush-index-';\n var oldCovers = this._covers;\n var newCovers = this._covers = [];\n var controller = this;\n var creatingCover = this._creatingCover;\n new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n return this;\n\n function getKey(brushOption, index) {\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n }\n\n function oldGetKey(cover, index) {\n return getKey(cover.__brushOption, index);\n }\n\n function addOrUpdate(newIndex, oldIndex) {\n var newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect,\n // where updating cover when creating should be forbiden.\n\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n newCovers[newIndex] = oldCovers[oldIndex];\n } else {\n var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));\n updateCoverAfterCreation(controller, cover);\n }\n }\n\n function remove(oldIndex) {\n if (oldCovers[oldIndex] !== creatingCover) {\n controller.group.remove(oldCovers[oldIndex]);\n }\n }\n };\n\n BrushController.prototype.unmount = function () {\n if (process.env.NODE_ENV !== 'production') {\n if (!this._mounted) {\n return;\n }\n }\n\n this.enableBrush(false); // container may 'removeAll' outside.\n\n clearCovers(this);\n\n this._zr.remove(this.group);\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = false; // should be at last.\n }\n\n return this;\n };\n\n BrushController.prototype.dispose = function () {\n this.unmount();\n this.off();\n };\n\n return BrushController;\n}(Eventful);\n\nfunction createCover(controller, brushOption) {\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n cover.__brushOption = brushOption;\n updateZ(cover, brushOption);\n controller.group.add(cover);\n return cover;\n}\n\nfunction endCreating(controller, creatingCover) {\n var coverRenderer = getCoverRenderer(creatingCover);\n\n if (coverRenderer.endCreating) {\n coverRenderer.endCreating(controller, creatingCover);\n updateZ(creatingCover, creatingCover.__brushOption);\n }\n\n return creatingCover;\n}\n\nfunction updateCoverShape(controller, cover) {\n var brushOption = cover.__brushOption;\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\n\nfunction updateZ(cover, brushOption) {\n var z = brushOption.z;\n z == null && (z = COVER_Z);\n cover.traverse(function (el) {\n el.z = z;\n el.z2 = z; // Consider in given container.\n });\n}\n\nfunction updateCoverAfterCreation(controller, cover) {\n getCoverRenderer(cover).updateCommon(controller, cover);\n updateCoverShape(controller, cover);\n}\n\nfunction getCoverRenderer(cover) {\n return coverRenderers[cover.__brushOption.brushType];\n} // return target panel or `true` (means global panel)\n\n\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panel;\n var transform = controller._transform;\n each(panels, function (pn) {\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n });\n return panel;\n} // Return a panel or true\n\n\nfunction getPanelByCover(controller, cover) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info,\n // which is then treated as global panel.\n\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\n}\n\nfunction clearCovers(controller) {\n var covers = controller._covers;\n var originalLength = covers.length;\n each(covers, function (cover) {\n controller.group.remove(cover);\n }, controller);\n covers.length = 0;\n return !!originalLength;\n}\n\nfunction trigger(controller, opt) {\n var areas = map(controller._covers, function (cover) {\n var brushOption = cover.__brushOption;\n var range = clone(brushOption.range);\n return {\n brushType: brushOption.brushType,\n panelId: brushOption.panelId,\n range: range\n };\n });\n controller.trigger('brush', {\n areas: areas,\n isEnd: !!opt.isEnd,\n removeOnClick: !!opt.removeOnClick\n });\n}\n\nfunction shouldShowCover(controller) {\n var track = controller._track;\n\n if (!track.length) {\n return false;\n }\n\n var p2 = track[track.length - 1];\n var p1 = track[0];\n var dx = p2[0] - p1[0];\n var dy = p2[1] - p1[1];\n var dist = mathPow(dx * dx + dy * dy, 0.5);\n return dist > UNSELECT_THRESHOLD;\n}\n\nfunction getTrackEnds(track) {\n var tail = track.length - 1;\n tail < 0 && (tail = 0);\n return [track[0], track[tail]];\n}\n\n;\n\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\n var cover = new graphic.Group();\n cover.add(new graphic.Rect({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true,\n draggable: true,\n cursor: 'move',\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n each(edgeNameSequences, function (nameSequence) {\n cover.add(new graphic.Rect({\n name: nameSequence.join(''),\n style: {\n opacity: 0\n },\n draggable: true,\n silent: true,\n invisible: true,\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n });\n return cover;\n}\n\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\n var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n var x = localRange[0][0];\n var y = localRange[1][0];\n var xa = x - lineWidth / 2;\n var ya = y - lineWidth / 2;\n var x2 = localRange[0][1];\n var y2 = localRange[1][1];\n var x2a = x2 - handleSize + lineWidth / 2;\n var y2a = y2 - handleSize + lineWidth / 2;\n var width = x2 - x;\n var height = y2 - y;\n var widtha = width + lineWidth;\n var heighta = height + lineWidth;\n updateRectShape(controller, cover, 'main', x, y, width, height);\n\n if (brushOption.transformable) {\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n }\n}\n\nfunction updateCommon(controller, cover) {\n var brushOption = cover.__brushOption;\n var transformable = brushOption.transformable;\n var mainEl = cover.childAt(0);\n mainEl.useStyle(makeStyle(brushOption));\n mainEl.attr({\n silent: !transformable,\n cursor: transformable ? 'move' : 'default'\n });\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\n var el = cover.childOfName(nameSequence.join(''));\n var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);\n el && el.attr({\n silent: !transformable,\n invisible: !transformable,\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n });\n });\n}\n\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n var el = cover.childOfName(name);\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\n\nfunction makeStyle(brushOption) {\n return defaults({\n strokeNoScale: true\n }, brushOption.brushStyle);\n}\n\nfunction formatRectRange(x, y, x2, y2) {\n var min = [mathMin(x, x2), mathMin(y, y2)];\n var max = [mathMax(x, x2), mathMax(y, y2)];\n return [[min[0], max[0]], [min[1], max[1]] // y range\n ];\n}\n\nfunction getTransform(controller) {\n return graphic.getTransform(controller.group);\n}\n\nfunction getGlobalDirection1(controller, localDirName) {\n var map = {\n w: 'left',\n e: 'right',\n n: 'top',\n s: 'bottom'\n };\n var inverseMap = {\n left: 'w',\n right: 'e',\n top: 'n',\n bottom: 's'\n };\n var dir = graphic.transformDirection(map[localDirName], getTransform(controller));\n return inverseMap[dir];\n}\n\nfunction getGlobalDirection2(controller, localDirNameSeq) {\n var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n return globalDir.join('');\n}\n\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\n var brushOption = cover.__brushOption;\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\n var localDelta = toLocalDelta(controller, dx, dy);\n each(dirNameSequence, function (dirName) {\n var ind = DIRECTION_MAP[dirName];\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n });\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction driftPolygon(controller, cover, dx, dy) {\n var range = cover.__brushOption.range;\n var localDelta = toLocalDelta(controller, dx, dy);\n each(range, function (point) {\n point[0] += localDelta[0];\n point[1] += localDelta[1];\n });\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction toLocalDelta(controller, dx, dy) {\n var thisGroup = controller.group;\n var localD = thisGroup.transformCoordToLocal(dx, dy);\n var localZero = thisGroup.transformCoordToLocal(0, 0);\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\n\nfunction clipByPanel(controller, cover, data) {\n var panel = getPanelByCover(controller, cover);\n return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);\n}\n\nfunction pointsToRect(points) {\n var xmin = mathMin(points[0][0], points[1][0]);\n var ymin = mathMin(points[0][1], points[1][1]);\n var xmax = mathMax(points[0][0], points[1][0]);\n var ymax = mathMax(points[0][1], points[1][1]);\n return {\n x: xmin,\n y: ymin,\n width: xmax - xmin,\n height: ymax - ymin\n };\n}\n\nfunction resetCursor(controller, e, localCursorPoint) {\n if ( // Check active\n !controller._brushType // resetCursor should be always called when mouse is in zr area,\n // but not called when mouse is out of zr area to avoid bad influence\n // if `mousemove`, `mouseup` are triggered from `document` event.\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\n return;\n }\n\n var zr = controller._zr;\n var covers = controller._covers;\n var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers.\n\n if (!controller._dragging) {\n for (var i = 0; i < covers.length; i++) {\n var brushOption = covers[i].__brushOption;\n\n if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n // Use cursor style set on cover.\n return;\n }\n }\n }\n\n currPanel && zr.setCursorStyle('crosshair');\n}\n\nfunction preventDefault(e) {\n var rawE = e.event;\n rawE.preventDefault && rawE.preventDefault();\n}\n\nfunction mainShapeContain(cover, x, y) {\n return cover.childOfName('main').contain(x, y);\n}\n\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n var creatingCover = controller._creatingCover;\n var panel = controller._creatingPanel;\n var thisBrushOption = controller._brushOption;\n var eventParams;\n\n controller._track.push(localCursorPoint.slice());\n\n if (shouldShowCover(controller) || creatingCover) {\n if (panel && !creatingCover) {\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\n var brushOption = clone(thisBrushOption);\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\n\n controller._covers.push(creatingCover);\n }\n\n if (creatingCover) {\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n var coverBrushOption = creatingCover.__brushOption;\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n\n if (isEnd) {\n endCreating(controller, creatingCover);\n coverRenderer.updateCommon(controller, creatingCover);\n }\n\n updateCoverShape(controller, creatingCover);\n eventParams = {\n isEnd: isEnd\n };\n }\n } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n // But a single click do not clear covers, because user may have casual\n // clicks (for example, click on other component and do not expect covers\n // disappear).\n // Only some cover removed, trigger action, but not every click trigger action.\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n eventParams = {\n isEnd: isEnd,\n removeOnClick: true\n };\n }\n }\n\n return eventParams;\n}\n\nfunction determineBrushType(brushType, panel) {\n if (brushType === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\n }\n\n return panel.defaultBrushType;\n }\n\n return brushType;\n}\n\nvar pointerHandlers = {\n mousedown: function (e) {\n if (this._dragging) {\n // In case some browser do not support globalOut,\n // and release mouse out side the browser.\n handleDragEnd(this, e);\n } else if (!e.target || !e.target.draggable) {\n preventDefault(e);\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n this._creatingCover = null;\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n\n if (panel) {\n this._dragging = true;\n this._track = [localCursorPoint.slice()];\n }\n }\n },\n mousemove: function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\n resetCursor(this, e, localCursorPoint);\n\n if (this._dragging) {\n preventDefault(e);\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n eventParams && trigger(this, eventParams);\n }\n },\n mouseup: function (e) {\n handleDragEnd(this, e);\n }\n};\n\nfunction handleDragEnd(controller, e) {\n if (controller._dragging) {\n preventDefault(e);\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n controller._dragging = false;\n controller._track = [];\n controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested.\n\n eventParams && trigger(controller, eventParams);\n }\n}\n\nfunction isOutsideZrArea(controller, x, y) {\n var zr = controller._zr;\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\n * key: brushType\n */\n\n\nvar coverRenderers = {\n lineX: getLineRenderer(0),\n lineY: getLineRenderer(1),\n rect: {\n createCover: function (controller, brushOption) {\n function returnInput(range) {\n return range;\n }\n\n return createBaseRectCover({\n toRectRange: returnInput,\n fromRectRange: returnInput\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n updateBaseRect(controller, cover, localRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n },\n polygon: {\n createCover: function (controller, brushOption) {\n var cover = new graphic.Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the\n // border of the shape when drawing, which is a better experience for user.\n\n cover.add(new graphic.Polyline({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true\n }));\n return cover;\n },\n getCreatingRange: function (localTrack) {\n return localTrack;\n },\n endCreating: function (controller, cover) {\n cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape.\n\n cover.add(new graphic.Polygon({\n name: 'main',\n draggable: true,\n drift: curry(driftPolygon, controller, cover),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n cover.childAt(0).setShape({\n points: clipByPanel(controller, cover, localRange)\n });\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n }\n};\n\nfunction getLineRenderer(xyIndex) {\n return {\n createCover: function (controller, brushOption) {\n return createBaseRectCover({\n toRectRange: function (range) {\n var rectRange = [range, [0, 100]];\n xyIndex && rectRange.reverse();\n return rectRange;\n },\n fromRectRange: function (rectRange) {\n return rectRange[xyIndex];\n }\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n return [min, max];\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n var otherExtent; // If brushWidth not specified, fit the panel.\n\n var panel = getPanelByCover(controller, cover);\n\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\n } else {\n var zr = controller._zr;\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n }\n\n var rectRange = [localRange, otherExtent];\n xyIndex && rectRange.reverse();\n updateBaseRect(controller, cover, rectRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n };\n}\n\nexport default BrushController;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { onIrrelevantElement } from './cursorHelper';\nimport * as graphicUtil from '../../util/graphic';\nexport function makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\nexport function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\nexport function makeRectIsTargetByCursor(rect, api, targetModel) {\n var boundingRect = normalizeRect(rect);\n return function (e, localCursorPoint) {\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport AxisBuilder from './AxisBuilder';\nimport BrushController from '../helper/BrushController';\nimport * as brushHelper from '../helper/brushHelper';\nimport * as graphic from '../../util/graphic';\nimport ComponentView from '../../view/Component';\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar ParallelAxisView =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisView, _super);\n\n function ParallelAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisView.type;\n return _this;\n }\n\n ParallelAxisView.prototype.init = function (ecModel, api) {\n _super.prototype.init.apply(this, arguments);\n\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n };\n\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n return;\n }\n\n this.axisModel = axisModel;\n this.api = api;\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\n var coordSys = coordSysModel.coordinateSystem;\n var areaSelectStyle = axisModel.getAreaSelectStyle();\n var areaWidth = areaSelectStyle.width;\n var dim = axisModel.axis.dim;\n var axisLayout = coordSys.getAxisLayout(dim);\n var builderOpt = zrUtil.extend({\n strokeContainThreshold: areaWidth\n }, axisLayout);\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }; // /**\n // * @override\n // */\n // updateVisual(axisModel, ecModel, api, payload) {\n // this._brushController && this._brushController\n // .updateCovers(getCoverInfoList(axisModel));\n // }\n\n\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n // After filtering, axis may change, select area needs to be update.\n var extent = axisModel.axis.getExtent();\n var extentLen = extent[1] - extent[0];\n var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n // width/height might be negative, which will be\n // normalized in BoundingRect.\n\n var rect = graphic.BoundingRect.create({\n x: extent[0],\n y: -areaWidth / 2,\n width: extentLen,\n height: areaWidth\n });\n rect.x -= extra;\n rect.width += 2 * extra;\n\n this._brushController.mount({\n enableGlobalPan: true,\n rotation: builderOpt.rotation,\n x: builderOpt.position[0],\n y: builderOpt.position[1]\n }).setPanels([{\n panelId: 'pl',\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n }]).enableBrush({\n brushType: 'lineX',\n brushStyle: areaSelectStyle,\n removeOnClick: true\n }).updateCovers(getCoverInfoList(axisModel));\n };\n\n ParallelAxisView.prototype._onBrush = function (eventParam) {\n var coverInfoList = eventParam.areas; // Do not cache these object, because the mey be changed.\n\n var axisModel = this.axisModel;\n var axis = axisModel.axis;\n var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n }); // If realtime is true, action is not dispatched on drag end, because\n // the drag end emits the same params with the last drag move event,\n // and may have some delay when using touch pad.\n\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'axisAreaSelect',\n parallelAxisId: axisModel.id,\n intervals: intervals\n });\n }\n };\n\n ParallelAxisView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n ParallelAxisView.type = 'parallelAxis';\n return ParallelAxisView;\n}(ComponentView);\n\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n mainType: 'parallelAxis',\n query: payload\n })[0] === axisModel;\n}\n\nfunction getCoverInfoList(axisModel) {\n var axis = axisModel.axis;\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\n return {\n brushType: 'lineX',\n panelId: 'pl',\n range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n };\n });\n}\n\nfunction getCoordSysModel(axisModel, ecModel) {\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\n\nexport default ParallelAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar actionInfo = {\n type: 'axisAreaSelect',\n event: 'axisAreaSelected' // update: 'updateVisual'\n\n};\nexport function installParallelActions(registers) {\n registers.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallelAxis',\n query: payload\n }, function (parallelAxisModel) {\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n });\n });\n /**\n * @payload\n */\n\n registers.registerAction('parallelAxisExpand', function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallel',\n query: payload\n }, function (parallelModel) {\n parallelModel.setAxisExpand(payload);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor';\nimport ParallelView from './ParallelView';\nimport ParallelModel from '../../coord/parallel/ParallelModel';\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator';\nimport axisModelCreator from '../../coord/axisModelCreator';\nimport ParallelAxisModel from '../../coord/parallel/AxisModel';\nimport ParallelAxisView from '../axis/ParallelAxisView';\nimport { installParallelActions } from '../axis/parallelAxisAction';\nvar defaultAxisOption = {\n type: 'value',\n areaSelectStyle: {\n width: 20,\n borderWidth: 1,\n borderColor: 'rgba(160,197,232)',\n color: 'rgba(160,197,232)',\n opacity: 0.3\n },\n realtime: true,\n z: 10\n};\nexport function install(registers) {\n registers.registerComponentView(ParallelView);\n registers.registerComponentModel(ParallelModel);\n registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\n registers.registerPreprocessor(parallelPreprocessor);\n registers.registerComponentModel(ParallelAxisModel);\n registers.registerComponentView(ParallelAxisView);\n axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption);\n installParallelActions(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport ParallelView from './ParallelView';\nimport ParallelSeriesModel from './ParallelSeries';\nimport parallelVisual from './parallelVisual';\nimport { install as installParallelComponent } from '../../component/parallel/install';\nexport function install(registers) {\n use(installParallelComponent);\n registers.registerChartView(ParallelView);\n registers.registerSeriesModel(ParallelSeriesModel);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { enterEmphasis, leaveEmphasis, enableHoverEmphasis, setStatesStylesFromModel } from '../../util/states';\nimport ChartView from '../../view/Chart';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport { getECData } from '../../util/innerStore';\n\nvar SankeyPathShape =\n/** @class */\nfunction () {\n function SankeyPathShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.cpx2 = 0;\n this.cpy2 = 0;\n this.extent = 0;\n }\n\n return SankeyPathShape;\n}();\n\nvar SankeyPath =\n/** @class */\nfunction (_super) {\n __extends(SankeyPath, _super);\n\n function SankeyPath(opts) {\n return _super.call(this, opts) || this;\n }\n\n SankeyPath.prototype.getDefaultShape = function () {\n return new SankeyPathShape();\n };\n\n SankeyPath.prototype.buildPath = function (ctx, shape) {\n var extent = shape.extent;\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n\n if (shape.orient === 'vertical') {\n ctx.lineTo(shape.x2 + extent, shape.y2);\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n } else {\n ctx.lineTo(shape.x2, shape.y2 + extent);\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n }\n\n ctx.closePath();\n };\n\n SankeyPath.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n SankeyPath.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n return SankeyPath;\n}(graphic.Path);\n\nvar SankeyView =\n/** @class */\nfunction (_super) {\n __extends(SankeyView, _super);\n\n function SankeyView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeyView.type;\n _this._focusAdjacencyDisabled = false;\n return _this;\n }\n\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\n var sankeyView = this;\n var graph = seriesModel.getGraph();\n var group = this.group;\n var layoutInfo = seriesModel.layoutInfo; // view width\n\n var width = layoutInfo.width; // view height\n\n var height = layoutInfo.height;\n var nodeData = seriesModel.getData();\n var edgeData = seriesModel.getData('edge');\n var orient = seriesModel.get('orient');\n this._model = seriesModel;\n group.removeAll();\n group.x = layoutInfo.x;\n group.y = layoutInfo.y; // generate a bezire Curve for each edge\n\n graph.eachEdge(function (edge) {\n var curve = new SankeyPath();\n var ecData = getECData(curve);\n ecData.dataIndex = edge.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataType = 'edge';\n var edgeModel = edge.getModel();\n var lineStyleModel = edgeModel.getModel('lineStyle');\n var curvature = lineStyleModel.get('curveness');\n var n1Layout = edge.node1.getLayout();\n var node1Model = edge.node1.getModel();\n var dragX1 = node1Model.get('localX');\n var dragY1 = node1Model.get('localY');\n var n2Layout = edge.node2.getLayout();\n var node2Model = edge.node2.getModel();\n var dragX2 = node2Model.get('localX');\n var dragY2 = node2Model.get('localY');\n var edgeLayout = edge.getLayout();\n var x1;\n var y1;\n var x2;\n var y2;\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n curve.shape.extent = Math.max(1, edgeLayout.dy);\n curve.shape.orient = orient;\n\n if (orient === 'vertical') {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n cpx1 = x1;\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\n cpx2 = x2;\n cpy2 = y1 * curvature + y2 * (1 - curvature);\n } else {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\n cpy1 = y1;\n cpx2 = x1 * curvature + x2 * (1 - curvature);\n cpy2 = y2;\n }\n\n curve.setShape({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n });\n curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color\n\n switch (curve.style.fill) {\n case 'source':\n curve.style.fill = edge.node1.getVisual('color');\n curve.style.decal = edge.node1.getVisual('style').decal;\n break;\n\n case 'target':\n curve.style.fill = edge.node2.getVisual('color');\n curve.style.decal = edge.node2.getVisual('style').decal;\n break;\n\n case 'gradient':\n var sourceColor = edge.node1.getVisual('color');\n var targetColor = edge.node2.getVisual('color');\n\n if (typeof sourceColor === 'string' && typeof targetColor === 'string') {\n curve.style.fill = new graphic.LinearGradient(0, 0, 1, 0, [{\n color: sourceColor,\n offset: 0\n }, {\n color: targetColor,\n offset: 1\n }]);\n }\n\n }\n\n var emphasisModel = edgeModel.getModel('emphasis');\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) {\n return model.getItemStyle();\n });\n group.add(curve);\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\n var focus = emphasisModel.get('focus');\n enableHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\n getECData(curve).dataType = 'edge';\n }); // Generate a rect for each node\n\n graph.eachNode(function (node) {\n var layout = node.getLayout();\n var itemModel = node.getModel();\n var dragX = itemModel.get('localX');\n var dragY = itemModel.get('localY');\n var emphasisModel = itemModel.getModel('emphasis');\n var rect = new graphic.Rect({\n shape: {\n x: dragX != null ? dragX * width : layout.x,\n y: dragY != null ? dragY * height : layout.y,\n width: layout.dx,\n height: layout.dy\n },\n style: itemModel.getModel('itemStyle').getItemStyle(),\n z2: 10\n });\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\n labelFetcher: seriesModel,\n labelDataIndex: node.dataIndex,\n defaultText: node.id\n });\n rect.disableLabelAnimation = true;\n rect.setStyle('fill', node.getVisual('color'));\n rect.setStyle('decal', node.getVisual('style').decal);\n setStatesStylesFromModel(rect, itemModel);\n group.add(rect);\n nodeData.setItemGraphicEl(node.dataIndex, rect);\n getECData(rect).dataType = 'node';\n var focus = emphasisModel.get('focus');\n enableHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\n });\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\n var itemModel = nodeData.getItemModel(dataIndex);\n\n if (itemModel.get('draggable')) {\n el.drift = function (dx, dy) {\n sankeyView._focusAdjacencyDisabled = true;\n this.shape.x += dx;\n this.shape.y += dy;\n this.dirty();\n api.dispatchAction({\n type: 'dragNode',\n seriesId: seriesModel.id,\n dataIndex: nodeData.getRawIndex(dataIndex),\n localX: this.shape.x / width,\n localY: this.shape.y / height\n });\n };\n\n el.ondragend = function () {\n sankeyView._focusAdjacencyDisabled = false;\n };\n\n el.draggable = true;\n el.cursor = 'move';\n }\n });\n\n if (!this._data && seriesModel.isAnimationEnabled()) {\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\n group.removeClipPath();\n }));\n }\n\n this._data = seriesModel.getData();\n };\n\n SankeyView.prototype.dispose = function () {};\n\n SankeyView.type = 'sankey';\n return SankeyView;\n}(ChartView); // Add animation to the view\n\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default SankeyView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';\nimport Model from '../../model/Model';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\n\nvar SankeySeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SankeySeriesModel, _super);\n\n function SankeySeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeySeriesModel.type;\n return _this;\n }\n /**\n * Init a graph data structure from data in option series\n *\n * @param {Object} option the object used to config echarts view\n * @return {module:echarts/data/List} storage initial data\n */\n\n\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\n var links = option.edges || option.links;\n var nodes = option.data || option.nodes;\n var levels = option.levels;\n this.levelModels = [];\n var levelModels = this.levelModels;\n\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].depth != null && levels[i].depth >= 0) {\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('levels[i].depth is mandatory and should be natural number');\n }\n }\n }\n\n if (nodes && links) {\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var layout = seriesModel.getData().getItemLayout(idx);\n\n if (layout) {\n var nodeDepth = layout.depth;\n var levelModel = seriesModel.levelModels[nodeDepth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n edgeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\n var layout = edge.node1.getLayout();\n\n if (layout) {\n var depth = layout.depth;\n var levelModel = seriesModel.levelModels[depth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n }\n };\n\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\n var dataItem = this.option.data[dataIndex];\n dataItem.localX = localPosition[0];\n dataItem.localY = localPosition[1];\n };\n /**\n * Return the graphic data structure\n *\n * @return graphic data structure\n */\n\n\n SankeySeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n /**\n * Get edge data of graphic data structure\n *\n * @return data structure of list\n */\n\n\n SankeySeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n function noValue(val) {\n return isNaN(val) || val == null;\n } // dataType === 'node' or empty do not show tooltip by default\n\n\n if (dataType === 'edge') {\n var params = this.getDataParams(dataIndex, dataType);\n var rawDataOpt = params.data;\n var edgeValue = params.value;\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n return createTooltipMarkup('nameValue', {\n name: edgeName,\n value: edgeValue,\n noValue: noValue(edgeValue)\n });\n } // dataType === 'node'\n else {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var value = node.getLayout().value;\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\n return createTooltipMarkup('nameValue', {\n name: name_1 != null ? name_1 + '' : null,\n value: value,\n noValue: noValue(value)\n });\n }\n };\n\n SankeySeriesModel.prototype.optionUpdated = function () {\n var option = this.option;\n }; // Override Series.getDataParams()\n\n\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n if (params.value == null && dataType === 'node') {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var nodeValue = node.getLayout().value;\n params.value = nodeValue;\n }\n\n return params;\n };\n\n SankeySeriesModel.type = 'series.sankey';\n SankeySeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n left: '5%',\n top: '5%',\n right: '20%',\n bottom: '5%',\n orient: 'horizontal',\n nodeWidth: 20,\n nodeGap: 8,\n draggable: true,\n layoutIterations: 32,\n label: {\n show: true,\n position: 'right',\n fontSize: 12\n },\n levels: [],\n nodeAlign: 'justify',\n lineStyle: {\n color: '#314656',\n opacity: 0.2,\n curveness: 0.5\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n opacity: 0.5\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n animationEasing: 'linear',\n animationDuration: 1000\n };\n return SankeySeriesModel;\n}(SeriesModel);\n\nexport default SankeySeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as layout from '../../util/layout';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { groupData } from '../../util/model';\nexport default function sankeyLayout(ecModel, api) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var nodeWidth = seriesModel.get('nodeWidth');\n var nodeGap = seriesModel.get('nodeGap');\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var width = layoutInfo.width;\n var height = layoutInfo.height;\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n computeNodeValues(nodes);\n var filteredNodes = zrUtil.filter(nodes, function (node) {\n return node.getLayout().value === 0;\n });\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n var orient = seriesModel.get('orient');\n var nodeAlign = seriesModel.get('nodeAlign');\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\n });\n}\n/**\n * Get the layout position of the whole view\n */\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n computeEdgeDepths(nodes, orient);\n}\n/**\n * Compute the value of each node by summing the associated edge's value\n */\n\n\nfunction computeNodeValues(nodes) {\n zrUtil.each(nodes, function (node) {\n var value1 = sum(node.outEdges, getEdgeValue);\n var value2 = sum(node.inEdges, getEdgeValue);\n var nodeRawValue = node.getValue() || 0;\n var value = Math.max(value1, value2, nodeRawValue);\n node.setLayout({\n value: value\n }, true);\n });\n}\n/**\n * Compute the x-position for each node.\n *\n * Here we use Kahn algorithm to detect cycle when we traverse\n * the node to computer the initial x position.\n */\n\n\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = []; // Storage each node's indegree.\n\n var indegreeArr = []; //Used to storage the node with indegree is equal to 0.\n\n var zeroIndegrees = [];\n var nextTargetNode = [];\n var x = 0; // let kx = 0;\n\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n\n for (var i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n\n var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n // position of the nodes.\n\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n var isItemDepth = item.depth != null && item.depth >= 0;\n\n if (isItemDepth && item.depth > maxNodeDepth) {\n maxNodeDepth = item.depth;\n }\n\n node.setLayout({\n depth: isItemDepth ? item.depth : x\n }, true);\n orient === 'vertical' ? node.setLayout({\n dy: nodeWidth\n }, true) : node.setLayout({\n dx: nodeWidth\n }, true);\n\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n var edge = node.outEdges[edgeIdx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n nextTargetNode.push(targetNode);\n }\n }\n }\n\n ++x;\n zeroIndegrees = nextTargetNode;\n nextTargetNode = [];\n }\n\n for (var i = 0; i < remainEdges.length; i++) {\n if (remainEdges[i] === 1) {\n throw new Error('Sankey is a DAG, the original data has cycle!');\n }\n }\n\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n\n if (nodeAlign && nodeAlign !== 'left') {\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n }\n\n var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n scaleNodeBreadths(nodes, kx, orient);\n}\n\nfunction isNodeDepth(node) {\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n return item.depth != null && item.depth >= 0;\n}\n\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\n if (nodeAlign === 'right') {\n var nextSourceNode = [];\n var remainNodes = nodes;\n var nodeHeight = 0;\n\n while (remainNodes.length) {\n for (var i = 0; i < remainNodes.length; i++) {\n var node = remainNodes[i];\n node.setLayout({\n skNodeHeight: nodeHeight\n }, true);\n\n for (var j = 0; j < node.inEdges.length; j++) {\n var edge = node.inEdges[j];\n\n if (nextSourceNode.indexOf(edge.node1) < 0) {\n nextSourceNode.push(edge.node1);\n }\n }\n }\n\n remainNodes = nextSourceNode;\n nextSourceNode = [];\n ++nodeHeight;\n }\n\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node)) {\n node.setLayout({\n depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)\n }, true);\n }\n });\n } else if (nodeAlign === 'justify') {\n moveSinksRight(nodes, maxDepth);\n }\n}\n/**\n * All the node without outEgdes are assigned maximum x-position and\n * be aligned in the last column.\n *\n * @param nodes. node of sankey view.\n * @param maxDepth. use to assign to node without outEdges as x-position.\n */\n\n\nfunction moveSinksRight(nodes, maxDepth) {\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node) && !node.outEdges.length) {\n node.setLayout({\n depth: maxDepth\n }, true);\n }\n });\n}\n/**\n * Scale node x-position to the width\n *\n * @param nodes node of sankey view\n * @param kx multiple used to scale nodes\n */\n\n\nfunction scaleNodeBreadths(nodes, kx, orient) {\n zrUtil.each(nodes, function (node) {\n var nodeDepth = node.getLayout().depth * kx;\n orient === 'vertical' ? node.setLayout({\n y: nodeDepth\n }, true) : node.setLayout({\n x: nodeDepth\n }, true);\n });\n}\n/**\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\n *\n * @param nodes node of sankey view\n * @param edges edge of sankey view\n * @param height the whole height of the area to draw the view\n * @param nodeGap the vertical distance between two nodes\n * in the same column.\n * @param iterations the number of iterations for the algorithm\n */\n\n\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n\n for (var alpha = 1; iterations > 0; iterations--) {\n // 0.99 is a experience parameter, ensure that each iterations of\n // changes as small as possible.\n alpha *= 0.99;\n relaxRightToLeft(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n relaxLeftToRight(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n }\n}\n\nfunction prepareNodesByBreadth(nodes, orient) {\n var nodesByBreadth = [];\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\n var groupResult = groupData(nodes, function (node) {\n return node.getLayout()[keyAttr];\n });\n groupResult.keys.sort(function (a, b) {\n return a - b;\n });\n zrUtil.each(groupResult.keys, function (key) {\n nodesByBreadth.push(groupResult.buckets.get(key));\n });\n return nodesByBreadth;\n}\n/**\n * Compute the original y-position for each node\n */\n\n\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n zrUtil.each(nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n zrUtil.each(nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\n if (ky < minKy) {\n minKy = ky;\n }\n });\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n zrUtil.each(edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}\n/**\n * Resolve the collision of initialized depth (y-position)\n */\n\n\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodesByBreadth, function (nodes) {\n nodes.sort(function (a, b) {\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n });\n var nodeX;\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n\n for (var i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout()[keyAttr];\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] + dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n }\n\n var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up\n\n dy = y0 - nodeGap - viewWidth;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n y0 = nodeX;\n\n for (var i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr];\n }\n }\n });\n}\n/**\n * Change the y-position of the nodes, except most the right side nodes\n * @param nodesByBreadth\n * @param alpha parameter used to adjust the nodes y-position\n */\n\n\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.outEdges.length) {\n var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.outEdges.length;\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n\nfunction weightedTarget(edge, orient) {\n return center(edge.node2, orient) * edge.getValue();\n}\n\nfunction centerTarget(edge, orient) {\n return center(edge.node2, orient);\n}\n\nfunction weightedSource(edge, orient) {\n return center(edge.node1, orient) * edge.getValue();\n}\n\nfunction centerSource(edge, orient) {\n return center(edge.node1, orient);\n}\n\nfunction center(node, orient) {\n return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;\n}\n\nfunction getEdgeValue(edge) {\n return edge.getValue();\n}\n\nfunction sum(array, cb, orient) {\n var sum = 0;\n var len = array.length;\n var i = -1;\n\n while (++i < len) {\n var value = +cb(array[i], orient);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n\n return sum;\n}\n/**\n * Change the y-position of the nodes, except most the left side nodes\n */\n\n\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.inEdges.length) {\n var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.inEdges.length;\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n/**\n * Compute the depth(y-position) of each edge\n */\n\n\nfunction computeEdgeDepths(nodes, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodes, function (node) {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\n });\n });\n zrUtil.each(nodes, function (node) {\n var sy = 0;\n var ty = 0;\n zrUtil.each(node.outEdges, function (edge) {\n edge.setLayout({\n sy: sy\n }, true);\n sy += edge.getLayout().dy;\n });\n zrUtil.each(node.inEdges, function (edge) {\n edge.setLayout({\n ty: ty\n }, true);\n ty += edge.getLayout().dy;\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport VisualMapping from '../../visual/VisualMapping';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SankeyView from './SankeyView';\nimport SankeySeriesModel from './SankeySeries';\nimport sankeyLayout from './sankeyLayout';\nimport sankeyVisual from './sankeyVisual';\nexport function install(registers) {\n registers.registerChartView(SankeyView);\n registers.registerSeriesModel(SankeySeriesModel);\n registers.registerLayout(sankeyLayout);\n registers.registerVisual(sankeyVisual);\n registers.registerAction({\n type: 'dragNode',\n event: 'dragnode',\n // here can only use 'update' now, other value is not support in echarts.\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sankey',\n query: payload\n }, function (seriesModel) {\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createListSimply from '../helper/createListSimply';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper';\n\nvar WhiskerBoxCommonMixin =\n/** @class */\nfunction () {\n function WhiskerBoxCommonMixin() {}\n /**\n * @override\n */\n\n\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal; // FIXME\n // Consider time axis.\n\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data; // ??? FIXME make a stage to perform data transfrom.\n // MUST create a new data, consider setOption({}) again.\n\n if (data && addOrdinal) {\n var newOptionData_1 = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n\n if (zrUtil.isArray(item)) {\n newItem = item.slice();\n item.unshift(index);\n } else if (zrUtil.isArray(item.value)) {\n newItem = item.value.slice();\n item.value.unshift(index);\n } else {\n newItem = item;\n }\n\n newOptionData_1.push(newItem);\n });\n option.data = newOptionData_1;\n }\n\n var defaultValueDimensions = this.defaultValueDimensions;\n var coordDimensions = [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }];\n return createListSimply(this, {\n coordDimensions: coordDimensions,\n dimensionsCount: defaultValueDimensions.length + 1,\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\n });\n };\n /**\n * If horizontal, base axis is x, otherwise y.\n * @override\n */\n\n\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n };\n\n return WhiskerBoxCommonMixin;\n}();\n\n;\nexport { WhiskerBoxCommonMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon';\nimport { mixin } from 'zrender/lib/core/util';\n\nvar BoxplotSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BoxplotSeriesModel, _super);\n\n function BoxplotSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotSeriesModel.type; // TODO\n // box width represents group size, so dimension should have 'size'.\n\n /**\n * @see <https://en.wikipedia.org/wiki/Box_plot>\n * The meanings of 'min' and 'max' depend on user,\n * and echarts do not need to know it.\n * @readOnly\n */\n\n _this.defaultValueDimensions = [{\n name: 'min',\n defaultTooltip: true\n }, {\n name: 'Q1',\n defaultTooltip: true\n }, {\n name: 'median',\n defaultTooltip: true\n }, {\n name: 'Q3',\n defaultTooltip: true\n }, {\n name: 'max',\n defaultTooltip: true\n }];\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n BoxplotSeriesModel.type = 'series.boxplot';\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n BoxplotSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n layout: null,\n boxWidth: [7, 50],\n itemStyle: {\n color: '#fff',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2,\n shadowBlur: 5,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n }\n },\n animationDuration: 800\n };\n return BoxplotSeriesModel;\n}(SeriesModel);\n\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\nexport default BoxplotSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ChartView from '../../view/Chart';\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport Path from 'zrender/lib/graphic/Path';\n\nvar BoxplotView =\n/** @class */\nfunction (_super) {\n __extends(BoxplotView, _super);\n\n function BoxplotView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotView.type;\n return _this;\n }\n\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var oldData = this._data; // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(symbolEl);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (!symbolEl) {\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n } else {\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n }\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n BoxplotView.prototype.remove = function (ecModel) {\n var group = this.group;\n var data = this._data;\n this._data = null;\n data && data.eachItemGraphicEl(function (el) {\n el && group.remove(el);\n });\n };\n\n BoxplotView.type = 'boxplot';\n return BoxplotView;\n}(ChartView);\n\nvar BoxPathShape =\n/** @class */\nfunction () {\n function BoxPathShape() {}\n\n return BoxPathShape;\n}();\n\nvar BoxPath =\n/** @class */\nfunction (_super) {\n __extends(BoxPath, _super);\n\n function BoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'boxplotBoxPath';\n return _this;\n }\n\n BoxPath.prototype.getDefaultShape = function () {\n return new BoxPathShape();\n };\n\n BoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n var i = 0;\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n\n for (; i < 4; i++) {\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n\n ctx.closePath();\n\n for (; i < ends.length; i++) {\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n };\n\n return BoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n var ends = itemLayout.ends;\n var el = new BoxPath({\n shape: {\n points: isInit ? transInit(ends, constDim, itemLayout) : ends\n }\n });\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n return el;\n}\n\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n var seriesModel = data.hostModel;\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n updateMethod(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.z2 = 100;\n var itemModel = data.getItemModel(dataIndex);\n setStatesStylesFromModel(el, itemModel);\n enableHoverEmphasis(el, itemModel.get(['emphasis', 'focus']), itemModel.get(['emphasis', 'blurScope']));\n}\n\nfunction transInit(points, dim, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[dim] = itemLayout.initBaseline;\n return point;\n });\n}\n\nexport default BoxplotView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function boxplotVisual(ecModel, api) {}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parsePercent } from '../../util/number';\nvar each = zrUtil.each;\nexport default function boxplotLayout(ecModel) {\n var groupResult = groupSeriesByAxis(ecModel);\n each(groupResult, function (groupItem) {\n var seriesModels = groupItem.seriesModels;\n\n if (!seriesModels.length) {\n return;\n }\n\n calculateBase(groupItem);\n each(seriesModels, function (seriesModel, idx) {\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n });\n });\n}\n/**\n * Group series by axis.\n */\n\nfunction groupSeriesByAxis(ecModel) {\n var result = [];\n var axisList = [];\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n var baseAxis = seriesModel.getBaseAxis();\n var idx = zrUtil.indexOf(axisList, baseAxis);\n\n if (idx < 0) {\n idx = axisList.length;\n axisList[idx] = baseAxis;\n result[idx] = {\n axis: baseAxis,\n seriesModels: []\n };\n }\n\n result[idx].seriesModels.push(seriesModel);\n });\n return result;\n}\n/**\n * Calculate offset and box width for each series.\n */\n\n\nfunction calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}\n/**\n * Calculate points location for each series.\n */\n\n\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var halfWidth = boxWidth / 2;\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n var vDimIdx = 1 - cDimIdx;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n\n if (cDim == null || vDims.length < 5) {\n return;\n }\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var axisDimVal = data.get(cDim, dataIndex);\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n var ends = [];\n addBodyEnd(ends, end2, false);\n addBodyEnd(ends, end4, true);\n ends.push(end1, end2, end5, end4);\n layEndLine(ends, end1);\n layEndLine(ends, end5);\n layEndLine(ends, median);\n data.setItemLayout(dataIndex, {\n initBaseline: median[vDimIdx],\n ends: ends\n });\n }\n\n function getPoint(axisDimVal, dim, dataIndex) {\n var val = data.get(dim, dataIndex);\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n var point;\n\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n } else {\n point = coordSys.dataToPoint(p);\n point[cDimIdx] += offset;\n }\n\n return point;\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] += halfWidth;\n point2[cDimIdx] -= halfWidth;\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function layEndLine(ends, endCenter) {\n var from = endCenter.slice();\n var to = endCenter.slice();\n from[cDimIdx] -= halfWidth;\n to[cDimIdx] += halfWidth;\n ends.push(from, to);\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { quantile, asc } from '../../util/number';\nimport { isFunction, isString } from 'zrender/lib/core/util';\n/**\n * See:\n * <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>\n * <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>\n *\n * Helper method for preparing data.\n *\n * @param rawData like\n * [\n * [12,232,443], (raw data set for the first box)\n * [3843,5545,1232], (raw data set for the second box)\n * ...\n * ]\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\n * default 1.5, means Q1 - 1.5 * (Q3 - Q1).\n * If 'none'/0 passed, min bound will not be used.\n */\n\nexport default function prepareBoxplotData(rawData, opt) {\n opt = opt || {};\n var boxData = [];\n var outliers = [];\n var boundIQR = opt.boundIQR;\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\n\n for (var i = 0; i < rawData.length; i++) {\n var ascList = asc(rawData[i].slice());\n var Q1 = quantile(ascList, 0.25);\n var Q2 = quantile(ascList, 0.5);\n var Q3 = quantile(ascList, 0.75);\n var min = ascList[0];\n var max = ascList[ascList.length - 1];\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\n var low = useExtreme ? min : Math.max(min, Q1 - bound);\n var high = useExtreme ? max : Math.min(max, Q3 + bound);\n var itemNameFormatter = opt.itemNameFormatter;\n var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({\n value: i\n }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + '';\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\n\n for (var j = 0; j < ascList.length; j++) {\n var dataItem = ascList[j];\n\n if (dataItem < low || dataItem > high) {\n var outlier = [itemName, dataItem];\n outliers.push(outlier);\n }\n }\n }\n\n return {\n boxData: boxData,\n outliers: outliers\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport prepareBoxplotData from './prepareBoxplotData';\nimport { throwError, makePrintable } from '../../util/log';\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types';\nexport var boxplotTransform = {\n type: 'echarts:boxplot',\n transform: function transform(params) {\n var upstream = params.upstream;\n\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\n }\n\n throwError(errMsg);\n }\n\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\n return [{\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\n data: result.boxData\n }, {\n data: result.outliers\n }];\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoxplotSeriesModel from './BoxplotSeries';\nimport BoxplotView from './BoxplotView';\nimport boxplotVisual from './boxplotVisual';\nimport boxplotLayout from './boxplotLayout';\nimport { boxplotTransform } from './boxplotTransform';\nexport function install(registers) {\n registers.registerSeriesModel(BoxplotSeriesModel);\n registers.registerChartView(BoxplotView);\n registers.registerVisual(boxplotVisual);\n registers.registerLayout(boxplotLayout);\n registers.registerTransform(boxplotTransform);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ChartView from '../../view/Chart';\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel } from '../../util/states';\nimport Path from 'zrender/lib/graphic/Path';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys';\nvar SKIP_PROPS = ['color', 'borderColor'];\n\nvar CandlestickView =\n/** @class */\nfunction (_super) {\n __extends(CandlestickView, _super);\n\n function CandlestickView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickView.type;\n return _this;\n }\n\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\n // If there is clipPath created in large mode. Remove it.\n this.group.removeClipPath();\n\n this._updateDrawMode(seriesModel);\n\n this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n };\n\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._clear();\n\n this._updateDrawMode(seriesModel);\n };\n\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n };\n\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n CandlestickView.prototype._renderNormal = function (seriesModel) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var isSimpleBox = data.getLayout('isSimpleBox');\n var needsClip = seriesModel.get('clip', true);\n var coord = seriesModel.coordinateSystem;\n var clipArea = coord.getArea && coord.getArea(); // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n return;\n }\n\n var el = createNormalBox(itemLayout, newIdx, true);\n graphic.initProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(el);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n group.remove(el);\n return;\n }\n\n if (!el) {\n el = createNormalBox(itemLayout, newIdx);\n } else {\n graphic.updateProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n }\n\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n CandlestickView.prototype._renderLarge = function (seriesModel) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n };\n\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\n var data = seriesModel.getData();\n var isSimpleBox = data.getLayout('isSimpleBox');\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemLayout = data.getItemLayout(dataIndex);\n var el = createNormalBox(itemLayout, dataIndex);\n setBoxCommon(el, data, dataIndex, isSimpleBox);\n el.incremental = true;\n this.group.add(el);\n }\n };\n\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n createLarge(seriesModel, this.group, true);\n };\n\n CandlestickView.prototype.remove = function (ecModel) {\n this._clear();\n };\n\n CandlestickView.prototype._clear = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n CandlestickView.type = 'candlestick';\n return CandlestickView;\n}(ChartView);\n\nvar NormalBoxPathShape =\n/** @class */\nfunction () {\n function NormalBoxPathShape() {}\n\n return NormalBoxPathShape;\n}();\n\nvar NormalBoxPath =\n/** @class */\nfunction (_super) {\n __extends(NormalBoxPath, _super);\n\n function NormalBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'normalCandlestickBox';\n return _this;\n }\n\n NormalBoxPath.prototype.getDefaultShape = function () {\n return new NormalBoxPathShape();\n };\n\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n\n if (this.__simpleBox) {\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[6][0], ends[6][1]);\n } else {\n ctx.moveTo(ends[0][0], ends[0][1]);\n ctx.lineTo(ends[1][0], ends[1][1]);\n ctx.lineTo(ends[2][0], ends[2][1]);\n ctx.lineTo(ends[3][0], ends[3][1]);\n ctx.closePath();\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[5][0], ends[5][1]);\n ctx.moveTo(ends[6][0], ends[6][1]);\n ctx.lineTo(ends[7][0], ends[7][1]);\n }\n };\n\n return NormalBoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n var ends = itemLayout.ends;\n return new NormalBoxPath({\n shape: {\n points: isInit ? transInit(ends, itemLayout) : ends\n },\n z2: 100\n });\n}\n\nfunction isNormalBoxClipped(clipArea, itemLayout) {\n var clipped = true;\n\n for (var i = 0; i < itemLayout.ends.length; i++) {\n // If any point are in the region.\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\n clipped = false;\n break;\n }\n }\n\n return clipped;\n}\n\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n var itemModel = data.getItemModel(dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.__simpleBox = isSimpleBox;\n setStatesStylesFromModel(el, itemModel);\n}\n\nfunction transInit(points, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[1] = itemLayout.initBaseline;\n return point;\n });\n}\n\nvar LargeBoxPathShape =\n/** @class */\nfunction () {\n function LargeBoxPathShape() {}\n\n return LargeBoxPathShape;\n}();\n\nvar LargeBoxPath =\n/** @class */\nfunction (_super) {\n __extends(LargeBoxPath, _super);\n\n function LargeBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeCandlestickBox';\n return _this;\n }\n\n LargeBoxPath.prototype.getDefaultShape = function () {\n return new LargeBoxPathShape();\n };\n\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n\n for (var i = 0; i < points.length;) {\n if (this.__sign === points[i++]) {\n var x = points[i++];\n ctx.moveTo(x, points[i++]);\n ctx.lineTo(x, points[i++]);\n } else {\n i += 3;\n }\n }\n };\n\n return LargeBoxPath;\n}(Path);\n\nfunction createLarge(seriesModel, group, incremental) {\n var data = seriesModel.getData();\n var largePoints = data.getLayout('largePoints');\n var elP = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 1\n });\n group.add(elP);\n var elN = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: -1\n });\n group.add(elN);\n setLargeStyle(1, elP, seriesModel, data);\n setLargeStyle(-1, elN, seriesModel, data);\n\n if (incremental) {\n elP.incremental = true;\n elN.incremental = true;\n }\n}\n\nfunction setLargeStyle(sign, el, seriesModel, data) {\n // TODO put in visual?\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']); // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n}\n\nexport default CandlestickView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon';\nimport { mixin } from 'zrender/lib/core/util';\n\nvar CandlestickSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CandlestickSeriesModel, _super);\n\n function CandlestickSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickSeriesModel.type;\n _this.defaultValueDimensions = [{\n name: 'open',\n defaultTooltip: true\n }, {\n name: 'close',\n defaultTooltip: true\n }, {\n name: 'lowest',\n defaultTooltip: true\n }, {\n name: 'highest',\n defaultTooltip: true\n }];\n return _this;\n }\n /**\n * Get dimension for shadow in dataZoom\n * @return dimension name\n */\n\n\n CandlestickSeriesModel.prototype.getShadowDim = function () {\n return 'open';\n };\n\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n var itemLayout = data.getItemLayout(dataIndex);\n return itemLayout && selectors.rect(itemLayout.brushRect);\n };\n\n CandlestickSeriesModel.type = 'series.candlestick';\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n CandlestickSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n clip: true,\n itemStyle: {\n color: '#eb5454',\n color0: '#47b262',\n borderColor: '#eb5454',\n borderColor0: '#47b262',\n // borderColor: '#d24040',\n // borderColor0: '#398f4f',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2\n }\n },\n barMaxWidth: null,\n barMinWidth: null,\n barWidth: null,\n large: true,\n largeThreshold: 600,\n progressive: 3e3,\n progressiveThreshold: 1e4,\n progressiveChunkMode: 'mod',\n animationEasing: 'linear',\n animationDuration: 300\n };\n return CandlestickSeriesModel;\n}(SeriesModel);\n\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\nexport default CandlestickSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function candlestickPreprocessor(option) {\n if (!option || !zrUtil.isArray(option.series)) {\n return;\n } // Translate 'k' to 'candlestick'.\n\n\n zrUtil.each(option.series, function (seriesItem) {\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n seriesItem.type = 'candlestick';\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createRenderPlanner from '../helper/createRenderPlanner';\nimport { extend } from 'zrender/lib/core/util';\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nvar candlestickVisual = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n function getColor(sign, model) {\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n }\n\n function getBorderColor(sign, model) {\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n }\n\n var data = seriesModel.getData(); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var isLargeRender = seriesModel.pipelineContext.large;\n return !isLargeRender && {\n progress: function (params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemModel = data.getItemModel(dataIndex);\n var sign = data.getItemLayout(dataIndex).sign;\n var style = itemModel.getItemStyle();\n style.fill = getColor(sign, itemModel);\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n extend(existsStyle, style);\n }\n }\n };\n }\n};\nexport default candlestickVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nimport { subPixelOptimize } from '../../util/graphic';\nimport createRenderPlanner from '../helper/createRenderPlanner';\nimport { parsePercent } from '../../util/number';\nimport { retrieve2 } from 'zrender/lib/core/util';\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar candlestickLayout = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var candleWidth = calculateCandleWidth(seriesModel, data);\n var cDimIdx = 0;\n var vDimIdx = 1;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n var openDim = vDims[0];\n var closeDim = vDims[1];\n var lowestDim = vDims[2];\n var highestDim = vDims[3];\n data.setLayout({\n candleWidth: candleWidth,\n // The value is experimented visually.\n isSimpleBox: candleWidth <= 1.3\n });\n\n if (cDim == null || vDims.length < 4) {\n return;\n }\n\n return {\n progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n };\n\n function normalProgress(params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = data.get(cDim, dataIndex);\n var openVal = data.get(openDim, dataIndex);\n var closeVal = data.get(closeDim, dataIndex);\n var lowestVal = data.get(lowestDim, dataIndex);\n var highestVal = data.get(highestDim, dataIndex);\n var ocLow = Math.min(openVal, closeVal);\n var ocHigh = Math.max(openVal, closeVal);\n var ocLowPoint = getPoint(ocLow, axisDimVal);\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\n var lowestPoint = getPoint(lowestVal, axisDimVal);\n var highestPoint = getPoint(highestVal, axisDimVal);\n var ends = [];\n addBodyEnd(ends, ocHighPoint, 0);\n addBodyEnd(ends, ocLowPoint, 1);\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n data.setItemLayout(dataIndex, {\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\n initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n ends: ends,\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n });\n }\n\n function getPoint(val, axisDimVal) {\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n var pmin = getPoint(lowestVal, axisDimVal);\n var pmax = getPoint(highestVal, axisDimVal);\n pmin[cDimIdx] -= candleWidth / 2;\n pmax[cDimIdx] -= candleWidth / 2;\n return {\n x: pmin[0],\n y: pmin[1],\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n };\n }\n\n function subPixelOptimizePoint(point) {\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n return point;\n }\n }\n\n function largeProgress(params, data) {\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n var points = new LargeArr(params.count * 4);\n var offset = 0;\n var point;\n var tmpIn = [];\n var tmpOut = [];\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = data.get(cDim, dataIndex);\n var openVal = data.get(openDim, dataIndex);\n var closeVal = data.get(closeDim, dataIndex);\n var lowestVal = data.get(lowestDim, dataIndex);\n var highestVal = data.get(highestDim, dataIndex);\n\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n points[offset++] = NaN;\n offset += 3;\n continue;\n }\n\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\n tmpIn[cDimIdx] = axisDimVal;\n tmpIn[vDimIdx] = lowestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n tmpIn[vDimIdx] = highestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[1] : NaN;\n }\n\n data.setLayout('largePoints', points);\n }\n }\n};\n\nfunction getSign(data, dataIndex, openVal, closeVal, closeDim) {\n var sign;\n\n if (openVal > closeVal) {\n sign = -1;\n } else if (openVal < closeVal) {\n sign = 1;\n } else {\n sign = dataIndex > 0 // If close === open, compare with close of last record\n ? data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive\n 1;\n }\n\n return sign;\n}\n\nfunction calculateCandleWidth(seriesModel, data) {\n var baseAxis = seriesModel.getBaseAxis();\n var extent;\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n var barWidth = seriesModel.get('barWidth');\n return barWidth != null ? parsePercent(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap.\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\n\nexport default candlestickLayout;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CandlestickView from './CandlestickView';\nimport CandlestickSeriesModel from './CandlestickSeries';\nimport preprocessor from './preprocessor';\nimport candlestickVisual from './candlestickVisual';\nimport candlestickLayout from './candlestickLayout';\nexport function install(registers) {\n registers.registerChartView(CandlestickView);\n registers.registerSeriesModel(CandlestickSeriesModel);\n registers.registerPreprocessor(preprocessor);\n registers.registerVisual(candlestickVisual);\n registers.registerLayout(candlestickLayout);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { createSymbol } from '../../util/symbol';\nimport { Group } from '../../util/graphic';\nimport { enterEmphasis, leaveEmphasis, enableHoverEmphasis } from '../../util/states';\nimport { parsePercent } from '../../util/number';\nimport SymbolClz from './Symbol';\nvar EFFECT_RIPPLE_NUMBER = 3;\n\nfunction normalizeSymbolSize(symbolSize) {\n if (!zrUtil.isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return symbolSize;\n}\n\nfunction updateRipplePath(rippleGroup, effectCfg) {\n var color = effectCfg.rippleEffectColor || effectCfg.color;\n rippleGroup.eachChild(function (ripplePath) {\n ripplePath.attr({\n z: effectCfg.z,\n zlevel: effectCfg.zlevel,\n style: {\n stroke: effectCfg.brushType === 'stroke' ? color : null,\n fill: effectCfg.brushType === 'fill' ? color : null\n }\n });\n });\n}\n\nvar EffectSymbol =\n/** @class */\nfunction (_super) {\n __extends(EffectSymbol, _super);\n\n function EffectSymbol(data, idx) {\n var _this = _super.call(this) || this;\n\n var symbol = new SymbolClz(data, idx);\n var rippleGroup = new Group();\n\n _this.add(symbol);\n\n _this.add(rippleGroup);\n\n _this.updateData(data, idx);\n\n return _this;\n }\n\n EffectSymbol.prototype.stopEffectAnimation = function () {\n this.childAt(1).removeAll();\n };\n\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\n var symbolType = effectCfg.symbolType;\n var color = effectCfg.color;\n var rippleGroup = this.childAt(1);\n\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4136.\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n ripplePath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 99,\n silent: true,\n scaleX: 0.5,\n scaleY: 0.5\n });\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset; // TODO Configurable effectCfg.period\n\n ripplePath.animate('', true).when(effectCfg.period, {\n scaleX: effectCfg.rippleScale / 2,\n scaleY: effectCfg.rippleScale / 2\n }).delay(delay).start();\n ripplePath.animateStyle(true).when(effectCfg.period, {\n opacity: 0\n }).delay(delay).start();\n rippleGroup.add(ripplePath);\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\n * Update effect symbol\n */\n\n\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\n var oldEffectCfg = this._effectCfg;\n var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed\n\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\n\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n var propName = DIFFICULT_PROPS[i];\n\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\n this.stopEffectAnimation();\n this.startEffectAnimation(effectCfg);\n return;\n }\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\n * Highlight symbol\n */\n\n\n EffectSymbol.prototype.highlight = function () {\n enterEmphasis(this);\n };\n /**\n * Downplay symbol\n */\n\n\n EffectSymbol.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n /**\n * Update symbol properties\n */\n\n\n EffectSymbol.prototype.updateData = function (data, idx) {\n var _this = this;\n\n var seriesModel = data.hostModel;\n this.childAt(0).updateData(data, idx);\n var rippleGroup = this.childAt(1);\n var itemModel = data.getItemModel(idx);\n var symbolType = data.getItemVisual(idx, 'symbol');\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolStyle = data.getItemVisual(idx, 'style');\n var color = symbolStyle && symbolStyle.fill;\n rippleGroup.setScale(symbolSize);\n rippleGroup.traverse(function (ripplePath) {\n ripplePath.setStyle('fill', color);\n });\n var symbolOffset = data.getItemVisual(idx, 'symbolOffset');\n\n if (symbolOffset) {\n if (!zrUtil.isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n\n rippleGroup.x = parsePercent(symbolOffset[0], symbolSize[0]);\n rippleGroup.y = parsePercent(zrUtil.retrieve2(symbolOffset[1], symbolOffset[0]) || 0, symbolSize[1]);\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var effectCfg = {};\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\n effectCfg.effectOffset = idx / data.count();\n effectCfg.z = seriesModel.getShallow('z') || 0;\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\n effectCfg.symbolType = symbolType;\n effectCfg.color = color;\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\n\n if (effectCfg.showEffectOn === 'render') {\n this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n this._effectCfg = effectCfg;\n } else {\n // Not keep old effect config\n this._effectCfg = null;\n this.stopEffectAnimation();\n\n this.onHoverStateChange = function (toState) {\n if (toState === 'emphasis') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.startEffectAnimation(effectCfg);\n }\n } else if (toState === 'normal') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.stopEffectAnimation();\n }\n }\n };\n }\n\n this._effectCfg = effectCfg;\n enableHoverEmphasis(this);\n };\n\n ;\n\n EffectSymbol.prototype.fadeOut = function (cb) {\n this.off('mouseover').off('mouseout');\n cb && cb();\n };\n\n ;\n return EffectSymbol;\n}(Group);\n\nexport default EffectSymbol;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw';\nimport EffectSymbol from '../helper/EffectSymbol';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport pointsLayout from '../../layout/points';\nimport ChartView from '../../view/Chart';\n\nvar EffectScatterView =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterView, _super);\n\n function EffectScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterView.type;\n return _this;\n }\n\n EffectScatterView.prototype.init = function () {\n this._symbolDraw = new SymbolDraw(EffectSymbol);\n };\n\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var effectSymbolDraw = this._symbolDraw;\n effectSymbolDraw.updateData(data, {\n clipShape: this._getClipShape(seriesModel)\n });\n this.group.add(effectSymbolDraw.group);\n };\n\n EffectScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n this.group.dirty();\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout();\n };\n\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.getRoamTransform) {\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\n this.group.decomposeTransform();\n }\n };\n\n EffectScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n };\n\n EffectScatterView.type = 'effectScatter';\n return EffectScatterView;\n}(ChartView);\n\nexport default EffectScatterView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createListFromArray from '../helper/createListFromArray';\nimport SeriesModel from '../../model/Series';\n\nvar EffectScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterSeriesModel, _super);\n\n function EffectScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n useEncodeDefaulter: true\n });\n };\n\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n EffectScatterSeriesModel.type = 'series.effectScatter';\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\n EffectScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n effectType: 'ripple',\n progressive: 0,\n // When to show the effect, option: 'render'|'emphasis'\n showEffectOn: 'render',\n clip: true,\n // Ripple effect config\n rippleEffect: {\n period: 4,\n // Scale of ripple\n scale: 2.5,\n // Brush type can be fill or stroke\n brushType: 'fill'\n },\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n // itemStyle: {\n // opacity: 1\n // }\n\n };\n return EffectScatterSeriesModel;\n}(SeriesModel);\n\nexport default EffectScatterSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport EffectScatterView from './EffectScatterView';\nimport EffectScatterSeriesModel from './EffectScatterSeries';\nimport layoutPoints from '../../layout/points';\nexport function install(registers) {\n registers.registerChartView(EffectScatterView);\n registers.registerSeriesModel(EffectScatterSeriesModel);\n registers.registerLayout(layoutPoints('effectScatter'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Provide effect for line\n */\n\nimport * as graphic from '../../util/graphic';\nimport Line from './Line';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { createSymbol } from '../../util/symbol';\nimport * as vec2 from 'zrender/lib/core/vector';\nimport * as curveUtil from 'zrender/lib/core/curve';\n\nvar EffectLine =\n/** @class */\nfunction (_super) {\n __extends(EffectLine, _super);\n\n function EffectLine(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this.add(_this.createLine(lineData, idx, seriesScope));\n\n _this._updateEffectSymbol(lineData, idx);\n\n return _this;\n }\n\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n };\n\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.scaleX = size[0];\n symbol.scaleY = size[1];\n symbol.setColor(color);\n this._symbolType = symbolType;\n this._symbolScale = size;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var self = this;\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n }); // Ignore when updating\n\n symbol.ignore = true;\n\n this._updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this._getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop) {\n symbol.stopAnimation();\n\n if (period > 0) {\n var delayNum = void 0;\n\n if (typeof delayExpr === 'function') {\n delayNum = delayExpr(idx);\n } else {\n delayNum = delayExpr;\n }\n\n if (symbol.__t > 0) {\n delayNum = -period * symbol.__t;\n }\n\n symbol.__t = 0;\n var animator = symbol.animate('', loop).when(period, {\n __t: 1\n }).delay(delayNum).during(function () {\n self._updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self.remove(symbol);\n });\n }\n\n animator.start();\n }\n }\n\n this._period = period;\n this._loop = loop;\n };\n\n EffectLine.prototype._getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n };\n\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n };\n\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n };\n\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t;\n var pos = [symbol.x, symbol.y];\n var lastPos = pos.slice();\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);\n var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint\n\n if (t === 1) {\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n }\n } else if (symbol.__lastT === 1) {\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n symbol.scaleY = 2 * vec2.dist(p1, pos);\n } else {\n symbol.scaleY = this._symbolScale[1];\n }\n }\n\n symbol.__lastT = symbol.__t;\n symbol.ignore = false;\n symbol.x = pos[0];\n symbol.y = pos[1];\n };\n\n EffectLine.prototype.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n return EffectLine;\n}(graphic.Group);\n\nexport default EffectLine;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis } from '../../util/states';\n\nvar Polyline =\n/** @class */\nfunction (_super) {\n __extends(Polyline, _super);\n\n function Polyline(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createPolyline(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Polyline.prototype._createPolyline = function (lineData, idx, seriesScope) {\n // let seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var hoverLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n\n if (!seriesScope || lineData.hasItemOption) {\n hoverLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\n }\n\n line.useStyle(lineData.getItemVisual(idx, 'style'));\n line.style.fill = null;\n line.style.strokeNoScale = true;\n var lineEmphasisState = line.ensureState('emphasis');\n lineEmphasisState.style = hoverLineStyle;\n enableHoverEmphasis(this);\n };\n\n ;\n\n Polyline.prototype.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n };\n\n ;\n return Polyline;\n}(graphic.Group);\n\nexport default Polyline;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Polyline from './Polyline';\nimport EffectLine from './EffectLine';\nimport * as vec2 from 'zrender/lib/core/vector';\n\nvar EffectPolyline =\n/** @class */\nfunction (_super) {\n __extends(EffectPolyline, _super);\n\n function EffectPolyline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this._lastFrame = 0;\n _this._lastFramePercent = 0;\n return _this;\n } // Override\n\n\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Polyline(lineData, idx, seriesScope);\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\n this._points = points;\n var accLenArr = [0];\n var len = 0;\n\n for (var i = 1; i < points.length; i++) {\n var p1 = points[i - 1];\n var p2 = points[i];\n len += vec2.dist(p1, p2);\n accLenArr.push(len);\n }\n\n if (len === 0) {\n this._length = 0;\n return;\n }\n\n for (var i = 0; i < accLenArr.length; i++) {\n accLenArr[i] /= len;\n }\n\n this._offsets = accLenArr;\n this._length = len;\n };\n\n ; // Override\n\n EffectPolyline.prototype._getLineLength = function () {\n return this._length;\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\n var t = symbol.__t;\n var points = this._points;\n var offsets = this._offsets;\n var len = points.length;\n\n if (!offsets) {\n // Has length 0\n return;\n }\n\n var lastFrame = this._lastFrame;\n var frame;\n\n if (t < this._lastFramePercent) {\n // Start from the next frame\n // PENDING start from lastFrame ?\n var start = Math.min(lastFrame + 1, len - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (offsets[frame] <= t) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, len - 2);\n } else {\n for (frame = lastFrame; frame < len; frame++) {\n if (offsets[frame] > t) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, len - 2);\n }\n\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\n var p0 = points[frame];\n var p1 = points[frame + 1];\n symbol.x = p0[0] * (1 - p) + p * p1[0];\n symbol.y = p0[1] * (1 - p) + p * p1[1];\n var tx = p1[0] - p0[0];\n var ty = p1[1] - p0[1];\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n this._lastFrame = frame;\n this._lastFramePercent = t;\n symbol.ignore = false;\n };\n\n ;\n return EffectPolyline;\n}(EffectLine);\n\nexport default EffectPolyline;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\"; // TODO Batch by color\n\nimport * as graphic from '../../util/graphic';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable';\nimport * as lineContain from 'zrender/lib/contain/line';\nimport * as quadraticContain from 'zrender/lib/contain/quadratic';\nimport { getECData } from '../../util/innerStore';\n\nvar LargeLinesPathShape =\n/** @class */\nfunction () {\n function LargeLinesPathShape() {\n this.polyline = false;\n this.curveness = 0;\n this.segs = [];\n }\n\n return LargeLinesPathShape;\n}();\n\nvar LargeLinesPath =\n/** @class */\nfunction (_super) {\n __extends(LargeLinesPath, _super);\n\n function LargeLinesPath(opts) {\n return _super.call(this, opts) || this;\n }\n\n LargeLinesPath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n LargeLinesPath.prototype.getDefaultShape = function () {\n return new LargeLinesPathShape();\n };\n\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\n var segs = shape.segs;\n var curveness = shape.curveness;\n\n if (shape.polyline) {\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n ctx.moveTo(segs[i++], segs[i++]);\n\n for (var k = 1; k < count; k++) {\n ctx.lineTo(segs[i++], segs[i++]);\n }\n }\n }\n } else {\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n ctx.moveTo(x0, y0);\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n ctx.quadraticCurveTo(x2, y2, x1, y1);\n } else {\n ctx.lineTo(x1, y1);\n }\n }\n }\n };\n\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\n var shape = this.shape;\n var segs = shape.segs;\n var curveness = shape.curveness;\n var lineWidth = this.style.lineWidth;\n\n if (shape.polyline) {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n\n for (var k = 1; k < count; k++) {\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n }\n\n dataIndex++;\n }\n } else {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n\n if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n } else {\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n\n dataIndex++;\n }\n }\n\n return -1;\n };\n\n return LargeLinesPath;\n}(graphic.Path);\n\nvar LargeLineDraw =\n/** @class */\nfunction () {\n function LargeLineDraw() {\n this.group = new graphic.Group();\n }\n\n LargeLineDraw.prototype.isPersistent = function () {\n return !this._incremental;\n };\n\n ;\n /**\n * Update symbols draw by new data\n */\n\n LargeLineDraw.prototype.updateData = function (data) {\n this.group.removeAll();\n var lineEl = new LargeLinesPath({\n rectHover: true,\n cursor: 'default'\n });\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data); // Add back\n\n\n this.group.add(lineEl);\n this._incremental = null;\n };\n\n ;\n /**\n * @override\n */\n\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clearIncremental();\n\n if (data.count() > 5e5) {\n if (!this._incremental) {\n this._incremental = new IncrementalDisplayable({\n silent: true\n });\n }\n\n this.group.add(this._incremental);\n } else {\n this._incremental = null;\n }\n };\n\n ;\n /**\n * @override\n */\n\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\n var lineEl = new LargeLinesPath();\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data, !!this._incremental);\n\n if (!this._incremental) {\n lineEl.rectHover = true;\n lineEl.cursor = 'default';\n lineEl.__startIndex = taskParams.start;\n this.group.add(lineEl);\n } else {\n this._incremental.addDisplayable(lineEl, true);\n }\n };\n\n ;\n /**\n * @override\n */\n\n LargeLineDraw.prototype.remove = function () {\n this._clearIncremental();\n\n this._incremental = null;\n this.group.removeAll();\n };\n\n ;\n\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\n var hostModel = data.hostModel;\n lineEl.setShape({\n polyline: hostModel.get('polyline'),\n curveness: hostModel.get(['lineStyle', 'curveness'])\n });\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n lineEl.style.strokeNoScale = true;\n var style = data.getVisual('style');\n\n if (style && style.stroke) {\n lineEl.setStyle('stroke', style.stroke);\n }\n\n lineEl.setStyle('fill', null);\n\n if (!isIncremental) {\n var ecData_1 = getECData(lineEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData_1.seriesIndex = hostModel.seriesIndex;\n lineEl.on('mousemove', function (e) {\n ecData_1.dataIndex = null;\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\n\n if (dataIndex > 0) {\n // Provide dataIndex for tooltip\n ecData_1.dataIndex = dataIndex + lineEl.__startIndex;\n }\n });\n }\n };\n\n ;\n\n LargeLineDraw.prototype._clearIncremental = function () {\n var incremental = this._incremental;\n\n if (incremental) {\n incremental.clearDisplaybles();\n }\n };\n\n ;\n return LargeLineDraw;\n}();\n\nexport default LargeLineDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nimport createRenderPlanner from '../helper/createRenderPlanner';\nvar linesLayout = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n return {\n progress: function (params, lineData) {\n var lineCoords = [];\n\n if (isLarge) {\n var points = void 0;\n var segCount = params.end - params.start;\n\n if (isPolyline) {\n var totalCoordsCount = 0;\n\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n\n var offset = 0;\n var pt = [];\n\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n\n if (isPolyline) {\n points[offset++] = len;\n }\n\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get(['lineStyle', 'curveness']);\n\n if (+curveness) {\n pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];\n }\n }\n\n lineData.setItemLayout(i, pts);\n }\n }\n }\n };\n }\n};\nexport default linesLayout;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw';\nimport EffectLine from '../helper/EffectLine';\nimport Line from '../helper/Line';\nimport Polyline from '../helper/Polyline';\nimport EffectPolyline from '../helper/EffectPolyline';\nimport LargeLineDraw from '../helper/LargeLineDraw';\nimport linesLayout from './linesLayout';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys';\nimport ChartView from '../../view/Chart';\n\nvar LinesView =\n/** @class */\nfunction (_super) {\n __extends(LinesView, _super);\n\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesView.type;\n return _this;\n }\n\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength) {\n if (process.env.NODE_ENV !== 'production') {\n var notInIndividual_1 = false;\n ecModel.eachSeries(function (otherSeriesModel) {\n if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {\n notInIndividual_1 = true;\n }\n });\n notInIndividual_1 && console.warn('Lines with trail effect should have an individual zlevel');\n }\n\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n }\n }\n\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n };\n\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n } // Not in large mode\n\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n };\n\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n };\n\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\n\nexport default LinesView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Uint32Array, Float64Array, Float32Array */\n\nimport SeriesModel from '../../model/Series';\nimport List from '../../data/List';\nimport { concatArray, mergeAll, map } from 'zrender/lib/core/util';\nimport CoordinateSystem from '../../core/CoordinateSystem';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\n\nfunction compatEc2(seriesOpt) {\n var data = seriesOpt.data;\n\n if (data && data[0] && data[0][0] && data[0][0].coord) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');\n }\n\n seriesOpt.data = map(data, function (itemOpt) {\n var coords = [itemOpt[0].coord, itemOpt[1].coord];\n var target = {\n coords: coords\n };\n\n if (itemOpt[0].name) {\n target.fromName = itemOpt[0].name;\n }\n\n if (itemOpt[1].name) {\n target.toName = itemOpt[1].name;\n }\n\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\n });\n }\n}\n\nvar LinesSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LinesSeriesModel, _super);\n\n function LinesSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n LinesSeriesModel.prototype.init = function (option) {\n // The input data may be null/undefined.\n option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type\n\n compatEc2(option);\n\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n\n _super.prototype.init.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.mergeOption = function (option) {\n compatEc2(option);\n\n if (option.data) {\n // Only update when have option data to merge.\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n }\n\n _super.prototype.mergeOption.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.appendData = function (params) {\n var result = this._processFlatCoordsArray(params.data);\n\n if (result.flatCoords) {\n if (!this._flatCoords) {\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n } else {\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n }\n\n params.data = new Float32Array(result.count);\n }\n\n this.getRawData().appendData(params.data);\n };\n\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\n var itemModel = this.getData().getItemModel(idx);\n var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\n }\n }\n\n return coords;\n };\n\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\n if (this._flatCoordsOffset) {\n return this._flatCoordsOffset[idx * 2 + 1];\n } else {\n return this._getCoordsFromItemModel(idx).length;\n }\n };\n\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\n if (this._flatCoordsOffset) {\n var offset = this._flatCoordsOffset[idx * 2];\n var len = this._flatCoordsOffset[idx * 2 + 1];\n\n for (var i = 0; i < len; i++) {\n out[i] = out[i] || [];\n out[i][0] = this._flatCoords[offset + i * 2];\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\n }\n\n return len;\n } else {\n var coords = this._getCoordsFromItemModel(idx);\n\n for (var i = 0; i < coords.length; i++) {\n out[i] = out[i] || [];\n out[i][0] = coords[i][0];\n out[i][1] = coords[i][1];\n }\n\n return coords.length;\n }\n };\n\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\n var startOffset = 0;\n\n if (this._flatCoords) {\n startOffset = this._flatCoords.length;\n } // Stored as a typed array. In format\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\n\n\n if (typeof data[0] === 'number') {\n var len = data.length; // Store offset and len of each segment\n\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\n var coordsStorage = new Float64Arr(len);\n var coordsCursor = 0;\n var offsetCursor = 0;\n var dataCount = 0;\n\n for (var i = 0; i < len;) {\n dataCount++;\n var count = data[i++]; // Offset\n\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len\n\n coordsOffsetAndLenStorage[offsetCursor++] = count;\n\n for (var k = 0; k < count; k++) {\n var x = data[i++];\n var y = data[i++];\n coordsStorage[coordsCursor++] = x;\n coordsStorage[coordsCursor++] = y;\n\n if (i > len) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invalid data format.');\n }\n }\n }\n }\n\n return {\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n flatCoords: coordsStorage,\n count: dataCount\n };\n }\n\n return {\n flatCoordsOffset: null,\n flatCoords: null,\n count: data.length\n };\n };\n\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n var CoordSys = CoordinateSystem.get(option.coordinateSystem);\n\n if (!CoordSys) {\n throw new Error('Unkown coordinate system ' + option.coordinateSystem);\n }\n }\n\n var lineData = new List(['value'], this);\n lineData.hasItemOption = false;\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n // dataItem is simply coords\n if (dataItem instanceof Array) {\n return NaN;\n } else {\n lineData.hasItemOption = true;\n var value = dataItem.value;\n\n if (value != null) {\n return value instanceof Array ? value[dimIndex] : value;\n }\n }\n });\n return lineData;\n };\n\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var itemModel = data.getItemModel(dataIndex);\n var name = itemModel.get('name');\n\n if (name) {\n return name;\n }\n\n var fromName = itemModel.get('fromName');\n var toName = itemModel.get('toName');\n var nameArr = [];\n fromName != null && nameArr.push(fromName);\n toName != null && nameArr.push(toName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > ')\n });\n };\n\n LinesSeriesModel.prototype.preventIncremental = function () {\n return !!this.get(['effect', 'show']);\n };\n\n LinesSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n return this.option.large ? 1e4 : this.get('progressive');\n }\n\n return progressive;\n };\n\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n LinesSeriesModel.type = 'series.lines';\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\n LinesSeriesModel.defaultOption = {\n coordinateSystem: 'geo',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Cartesian coordinate system\n xAxisIndex: 0,\n yAxisIndex: 0,\n symbol: ['none', 'none'],\n symbolSize: [10, 10],\n // Geo coordinate system\n geoIndex: 0,\n effect: {\n show: false,\n period: 4,\n constantSpeed: 0,\n symbol: 'circle',\n symbolSize: 3,\n loop: true,\n trailLength: 0.2\n },\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n polyline: false,\n clip: true,\n label: {\n show: false,\n position: 'end' // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n lineStyle: {\n opacity: 0.5\n }\n };\n return LinesSeriesModel;\n}(SeriesModel);\n\nexport default LinesSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nvar linesVisual = {\n seriesType: 'lines',\n reset: function (seriesModel) {\n var symbolType = normalize(seriesModel.get('symbol'));\n var symbolSize = normalize(seriesModel.get('symbolSize'));\n var data = seriesModel.getData();\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\n data.setVisual('toSymbol', symbolType && symbolType[1]);\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport default linesVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LinesView from './LinesView';\nimport LinesSeriesModel from './LinesSeries';\nimport linesLayout from './linesLayout';\nimport linesVisual from './linesVisual';\nexport function install(registers) {\n registers.registerChartView(LinesView);\n registers.registerSeriesModel(LinesSeriesModel);\n registers.registerLayout(linesLayout);\n registers.registerVisual(linesVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Uint8ClampedArray */\nimport * as zrUtil from 'zrender/lib/core/util';\nvar GRADIENT_LEVELS = 256;\n\nvar HeatmapLayer =\n/** @class */\nfunction () {\n function HeatmapLayer() {\n this.blurSize = 30;\n this.pointSize = 20;\n this.maxOpacity = 1;\n this.minOpacity = 0;\n this._gradientPixels = {\n inRange: null,\n outOfRange: null\n };\n var canvas = zrUtil.createCanvas();\n this.canvas = canvas;\n }\n /**\n * Renders Heatmap and returns the rendered canvas\n * @param data array of data, each has x, y, value\n * @param width canvas width\n * @param height canvas height\n */\n\n\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\n var brush = this._getBrush();\n\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\n\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\n\n var r = this.pointSize + this.blurSize;\n var canvas = this.canvas;\n var ctx = canvas.getContext('2d');\n var len = data.length;\n canvas.width = width;\n canvas.height = height;\n\n for (var i = 0; i < len; ++i) {\n var p = data[i];\n var x = p[0];\n var y = p[1];\n var value = p[2]; // calculate alpha using value\n\n var alpha = normalize(value); // draw with the circle brush with alpha\n\n ctx.globalAlpha = alpha;\n ctx.drawImage(brush, x - r, y - r);\n }\n\n if (!canvas.width || !canvas.height) {\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n // 'CanvasRenderingContext2D': The source height is 0.\"\n return canvas;\n } // colorize the canvas using alpha value and set with gradient\n\n\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imageData.data;\n var offset = 0;\n var pixelLen = pixels.length;\n var minOpacity = this.minOpacity;\n var maxOpacity = this.maxOpacity;\n var diffOpacity = maxOpacity - minOpacity;\n\n while (offset < pixelLen) {\n var alpha = pixels[offset + 3] / 256;\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data\n\n if (alpha > 0) {\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n pixels[offset++] = gradient[gradientOffset];\n pixels[offset++] = gradient[gradientOffset + 1];\n pixels[offset++] = gradient[gradientOffset + 2];\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n } else {\n offset += 4;\n }\n }\n\n ctx.putImageData(imageData, 0, 0);\n return canvas;\n };\n /**\n * get canvas of a black circle brush used for canvas to draw later\n */\n\n\n HeatmapLayer.prototype._getBrush = function () {\n var brushCanvas = this._brushCanvas || (this._brushCanvas = zrUtil.createCanvas()); // set brush size\n\n var r = this.pointSize + this.blurSize;\n var d = r * 2;\n brushCanvas.width = d;\n brushCanvas.height = d;\n var ctx = brushCanvas.getContext('2d');\n ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle,\n // draw the distinct circle in an invisible place,\n // and use shadowOffset to draw shadow in the center of the canvas\n\n ctx.shadowOffsetX = d;\n ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate\n // color in color map\n\n ctx.shadowColor = '#000'; // draw circle in the left to the canvas\n\n ctx.beginPath();\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n return brushCanvas;\n };\n /**\n * get gradient color map\n * @private\n */\n\n\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\n var gradientPixels = this._gradientPixels;\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n var color = [0, 0, 0, 0];\n var off = 0;\n\n for (var i = 0; i < 256; i++) {\n colorFunc[state](i / 255, true, color);\n pixelsSingleState[off++] = color[0];\n pixelsSingleState[off++] = color[1];\n pixelsSingleState[off++] = color[2];\n pixelsSingleState[off++] = color[3];\n }\n\n return pixelsSingleState;\n };\n\n return HeatmapLayer;\n}();\n\nexport default HeatmapLayer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis } from '../../util/states';\nimport HeatmapLayer from './HeatmapLayer';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ChartView from '../../view/Chart';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\n\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n var i; // Try to find in the location of the last found\n\n for (i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}\n\nfunction getIsInContinuousRange(dataExtent, range) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n return function (val) {\n return val >= range[0] && val <= range[1];\n };\n}\n\nfunction isGeoCoordSys(coordSys) {\n var dimensions = coordSys.dimensions; // Not use coorSys.type === 'geo' because coordSys maybe extended\n\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\n\nvar HeatmapView =\n/** @class */\nfunction (_super) {\n __extends(HeatmapView, _super);\n\n function HeatmapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapView.type;\n return _this;\n }\n\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\n var visualMapOfThisSeries;\n ecModel.eachComponent('visualMap', function (visualMap) {\n visualMap.eachTargetSeries(function (targetSeries) {\n if (targetSeries === seriesModel) {\n visualMapOfThisSeries = visualMap;\n }\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n if (!visualMapOfThisSeries) {\n throw new Error('Heatmap must use with visualMap');\n }\n }\n\n this.group.removeAll();\n this._incrementalDisplayable = null;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\n } else if (isGeoCoordSys(coordSys)) {\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n }\n };\n\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n };\n\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n // geo does not support incremental rendering?\n if (isGeoCoordSys(coordSys)) {\n this.render(seriesModel, ecModel, api);\n } else {\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\n }\n }\n };\n\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\n var coordSys = seriesModel.coordinateSystem;\n var width;\n var height;\n var xAxisExtent;\n var yAxisExtent;\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\n throw new Error('Heatmap on cartesian must have two category axes');\n }\n\n if (!(xAxis.onBand && yAxis.onBand)) {\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\n }\n }\n\n width = xAxis.getBandWidth();\n height = yAxis.getBandWidth();\n xAxisExtent = xAxis.scale.getExtent();\n yAxisExtent = yAxis.scale.getExtent();\n }\n\n var group = this.group;\n var data = seriesModel.getData();\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\n var labelStatesModels = getLabelStatesModels(seriesModel);\n var focus = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n var dataDims = isCoordinateSystemType(coordSys, 'cartesian2d') ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n\n for (var idx = start; idx < end; idx++) {\n var rect = void 0;\n var style = data.getItemVisual(idx, 'style');\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var dataDimX = data.get(dataDims[0], idx);\n var dataDimY = data.get(dataDims[1], idx); // Ignore empty data and out of extent data\n\n if (isNaN(data.get(dataDims[2], idx)) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {\n continue;\n }\n\n var point = coordSys.dataToPoint([dataDimX, dataDimY]);\n rect = new graphic.Rect({\n shape: {\n x: Math.floor(Math.round(point[0]) - width / 2),\n y: Math.floor(Math.round(point[1]) - height / 2),\n width: Math.ceil(width),\n height: Math.ceil(height)\n },\n style: style\n });\n } else {\n // Ignore empty data\n if (isNaN(data.get(dataDims[1], idx))) {\n continue;\n }\n\n rect = new graphic.Rect({\n z2: 1,\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\n style: style\n });\n }\n\n var itemModel = data.getItemModel(idx); // Optimization for large datset\n\n if (data.hasItemOption) {\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n var rawValue = seriesModel.getRawValue(idx);\n var defaultText = '-';\n\n if (rawValue && rawValue[2] != null) {\n defaultText = rawValue[2] + '';\n }\n\n setLabelStyle(rect, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: defaultText\n });\n rect.ensureState('emphasis').style = emphasisStyle;\n rect.ensureState('blur').style = blurStyle;\n rect.ensureState('select').style = selectStyle;\n enableHoverEmphasis(rect, focus, blurScope);\n rect.incremental = incremental; // PENDING\n\n if (incremental) {\n // Rect must use hover layer if it's incremental.\n rect.states.emphasis.hoverLayer = true;\n }\n\n group.add(rect);\n data.setItemGraphicEl(idx, rect);\n }\n };\n\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) {\n // throw new Error('Data range must have color visuals');\n // }\n\n var data = seriesModel.getData();\n var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n hmLayer.blurSize = seriesModel.get('blurSize');\n hmLayer.pointSize = seriesModel.get('pointSize');\n hmLayer.minOpacity = seriesModel.get('minOpacity');\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n var rect = geo.getViewRect().clone();\n var roamTransform = geo.getRoamTransform();\n rect.applyTransform(roamTransform); // Clamp on viewport\n\n var x = Math.max(rect.x, 0);\n var y = Math.max(rect.y, 0);\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\n var width = x2 - x;\n var height = y2 - y;\n var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n var points = data.mapArray(dims, function (lng, lat, value) {\n var pt = geo.dataToPoint([lng, lat]);\n pt[0] -= x;\n pt[1] -= y;\n pt.push(value);\n return pt;\n });\n var dataExtent = visualMapModel.getExtent();\n var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n inRange: inRangeVisuals.color.getColorMapper(),\n outOfRange: outOfRangeVisuals.color.getColorMapper()\n }, isInRange);\n var img = new graphic.Image({\n style: {\n width: width,\n height: height,\n x: x,\n y: y,\n image: hmLayer.canvas\n },\n silent: true\n });\n this.group.add(img);\n };\n\n HeatmapView.type = 'heatmap';\n return HeatmapView;\n}(ChartView);\n\nexport default HeatmapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport createListFromArray from '../helper/createListFromArray';\nimport CoordinateSystem from '../../core/CoordinateSystem';\n\nvar HeatmapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(HeatmapSeriesModel, _super);\n\n function HeatmapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapSeriesModel.type;\n return _this;\n }\n\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n generateCoord: 'value'\n });\n };\n\n HeatmapSeriesModel.prototype.preventIncremental = function () {\n var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n\n if (coordSysCreator && coordSysCreator.dimensions) {\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n }\n };\n\n HeatmapSeriesModel.type = 'series.heatmap';\n HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar'];\n HeatmapSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Geo coordinate system\n geoIndex: 0,\n blurSize: 30,\n pointSize: 20,\n maxOpacity: 1,\n minOpacity: 0,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return HeatmapSeriesModel;\n}(SeriesModel);\n\nexport default HeatmapSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport HeatmapView from './HeatmapView';\nimport HeatmapSeriesModel from './HeatmapSeries';\nexport function install(registers) {\n registers.registerChartView(HeatmapView);\n registers.registerSeriesModel(HeatmapSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis } from '../../util/states';\nimport { createSymbol } from '../../util/symbol';\nimport { parsePercent, isNumeric } from '../../util/number';\nimport ChartView from '../../view/Chart';\nimport { getDefaultLabel } from '../helper/labelHelper';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport ZRImage from 'zrender/lib/graphic/Image';\nimport { getECData } from '../../util/innerStore';\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth']; // index: +isHorizontal\n\nvar LAYOUT_ATTRS = [{\n xy: 'x',\n wh: 'width',\n index: 0,\n posDesc: ['left', 'right']\n}, {\n xy: 'y',\n wh: 'height',\n index: 1,\n posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\n\nvar PictorialBarView =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarView, _super);\n\n function PictorialBarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarView.type;\n return _this;\n }\n\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var coordSysRect = cartesian.master.getRect();\n var opt = {\n ecSize: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n seriesModel: seriesModel,\n coordSys: cartesian,\n coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n isHorizontal: isHorizontal,\n valueDim: LAYOUT_ATTRS[+isHorizontal],\n categoryDim: LAYOUT_ATTRS[1 - +isHorizontal]\n };\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var itemModel = getItemModel(data, dataIndex);\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n var bar = createBar(data, opt, symbolMeta);\n data.setItemGraphicEl(dataIndex, bar);\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).update(function (newIndex, oldIndex) {\n var bar = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(bar);\n return;\n }\n\n var itemModel = getItemModel(data, newIndex);\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\n\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n group.remove(bar);\n data.setItemGraphicEl(newIndex, null);\n bar = null;\n }\n\n if (bar) {\n updateBar(bar, opt, symbolMeta);\n } else {\n bar = createBar(data, opt, symbolMeta, true);\n }\n\n data.setItemGraphicEl(newIndex, bar);\n bar.__pictorialSymbolMeta = symbolMeta; // Add back\n\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).remove(function (dataIndex) {\n var bar = oldData.getItemGraphicEl(dataIndex);\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n }).execute();\n this._data = data;\n return this.group;\n };\n\n PictorialBarView.prototype.remove = function (ecModel, api) {\n var group = this.group;\n var data = this._data;\n\n if (ecModel.get('animation')) {\n if (data) {\n data.eachItemGraphicEl(function (bar) {\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\n });\n }\n } else {\n group.removeAll();\n }\n };\n\n PictorialBarView.type = 'pictorialBar';\n return PictorialBarView;\n}(ChartView); // Set or calculate default value about symbol, and calculate layout info.\n\n\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n style: data.getItemVisual(dataIndex, 'style'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.\n\n\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n boundingLength = symbolBoundingExtent[pxSignIdx];\n } else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n } else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n } else {\n boundingLength = layout[valueDim.wh];\n }\n\n outputSymbolMeta.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\n }\n\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n}\n\nfunction convertToCoordOnAxis(axis, value) {\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n} // Support ['100%', '100%']\n\n\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var categoryDim = opt.categoryDim;\n var categorySize = Math.abs(layout[categoryDim.wh]);\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n var parsedSymbolSize;\n\n if (zrUtil.isArray(symbolSize)) {\n parsedSymbolSize = symbolSize.slice();\n } else {\n if (symbolSize == null) {\n // will parse to number below\n parsedSymbolSize = ['100%', '100%'];\n } else {\n parsedSymbolSize = [symbolSize, symbolSize];\n }\n } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n // to complicated to calculate real percent value if considering scaled lineWidth.\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n // which can be tolerated in pictorial chart.\n\n\n parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);\n parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n outputSymbolMeta.symbolSize = parsedSymbolSize; // If x or y is less than zero, show reversed shape.\n\n var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale.\n\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\n\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\n // In symbols are drawn with scale, so do not need to care about the case that width\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n // be calculated.\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n\n if (valueLineWidth) {\n pathForLineWidth.attr({\n scaleX: symbolScale[0],\n scaleY: symbolScale[1],\n rotation: rotation\n });\n pathForLineWidth.updateTransform();\n valueLineWidth /= pathForLineWidth.getLineScale();\n valueLineWidth *= symbolScale[opt.valueDim.index];\n }\n\n outputSymbolMeta.valueLineWidth = valueLineWidth;\n}\n\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\n var categoryDim = opt.categoryDim;\n var valueDim = opt.valueDim;\n var pxSign = outputSymbolMeta.pxSign;\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may\n // want symbols to rotate on its center, which should not be translated\n // when rotating.\n\n if (symbolRepeat) {\n var absBoundingLength = Math.abs(boundingLength);\n var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n var hasEndGap = false;\n\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n hasEndGap = true;\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n }\n\n var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted\n // to ensure that all of the symbols will not be overflow the given area.\n\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Both final repeatTimes and final symbolMarginNumeric area calculated based on\n // boundingLength.\n\n var repeatSpecified = isNumeric(symbolRepeat);\n var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed\n // entirely in the given layout area.\n\n var mDiff = absBoundingLength - repeatTimes * unitLength;\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Update repeatTimes when not all symbol will be shown.\n\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\n repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n }\n\n pathLen = repeatTimes * uLenWithMargin - endFix;\n outputSymbolMeta.repeatTimes = repeatTimes;\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\n }\n\n var sizeFix = pxSign * (pathLen / 2);\n var pathPosition = outputSymbolMeta.pathPosition = [];\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n\n if (symbolOffset) {\n pathPosition[0] += symbolOffset[0];\n pathPosition[1] += symbolOffset[1];\n }\n\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n bundlePosition[valueDim.index] = layout[valueDim.xy];\n var barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n var clipShape = outputSymbolMeta.clipShape = {}; // Consider that symbol may be overflow layout rect.\n\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n clipShape[valueDim.xy] = 0;\n clipShape[valueDim.wh] = layout[valueDim.wh];\n}\n\nfunction createPath(symbolMeta) {\n var symbolPatternSize = symbolMeta.symbolPatternSize;\n var path = createSymbol( // Consider texture img, make a big size.\n symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\n path.attr({\n culling: true\n });\n path.type !== 'image' && path.setStyle({\n strokeNoScale: true\n });\n return path;\n}\n\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var symbolSize = symbolMeta.symbolSize;\n var valueLineWidth = symbolMeta.valueLineWidth;\n var pathPosition = symbolMeta.pathPosition;\n var valueDim = opt.valueDim;\n var repeatTimes = symbolMeta.repeatTimes || 0;\n var index = 0;\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n eachPath(bar, function (path) {\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n\n if (index < repeatTimes) {\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n } else {\n updateAttr(path, null, {\n scaleX: 0,\n scaleY: 0\n }, symbolMeta, isUpdate, function () {\n bundle.remove(path);\n });\n } // updateHoverAnimation(path, symbolMeta);\n\n\n index++;\n });\n\n for (; index < repeatTimes; index++) {\n var path = createPath(symbolMeta);\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n bundle.add(path);\n var target = makeTarget(index);\n updateAttr(path, {\n x: target.x,\n y: target.y,\n scaleX: 0,\n scaleY: 0\n }, {\n scaleX: target.scaleX,\n scaleY: target.scaleY,\n rotation: target.rotation\n }, symbolMeta, isUpdate);\n }\n\n function makeTarget(index) {\n var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n // Otherwise: i = index;\n\n var pxSign = symbolMeta.pxSign;\n var i = index;\n\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n i = repeatTimes - 1 - index;\n }\n\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n return {\n x: position[0],\n y: position[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n };\n }\n}\n\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var mainPath = bar.__pictorialMainPath;\n\n if (!mainPath) {\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n bundle.add(mainPath);\n updateAttr(mainPath, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: 0,\n scaleY: 0,\n rotation: symbolMeta.rotation\n }, {\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1]\n }, symbolMeta, isUpdate);\n } else {\n updateAttr(mainPath, null, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n }, symbolMeta, isUpdate);\n }\n} // bar rect is used for label.\n\n\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n var barRect = bar.__pictorialBarRect;\n\n if (!barRect) {\n barRect = bar.__pictorialBarRect = new graphic.Rect({\n z2: 2,\n shape: rectShape,\n silent: true,\n style: {\n stroke: 'transparent',\n fill: 'transparent',\n lineWidth: 0\n }\n });\n bar.add(barRect);\n } else {\n updateAttr(barRect, null, {\n shape: rectShape\n }, symbolMeta, isUpdate);\n }\n}\n\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n // If not clip, symbol will be remove and rebuilt.\n if (symbolMeta.symbolClip) {\n var clipPath = bar.__pictorialClipPath;\n var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n var valueDim = opt.valueDim;\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n\n if (clipPath) {\n graphic.updateProps(clipPath, {\n shape: clipShape\n }, animationModel, dataIndex);\n } else {\n clipShape[valueDim.wh] = 0;\n clipPath = new graphic.Rect({\n shape: clipShape\n });\n\n bar.__pictorialBundle.setClipPath(clipPath);\n\n bar.__pictorialClipPath = clipPath;\n var target = {};\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n shape: target\n }, animationModel, dataIndex);\n }\n }\n}\n\nfunction getItemModel(data, dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\n itemModel.isAnimationEnabled = isAnimationEnabled;\n return itemModel;\n}\n\nfunction getAnimationDelayParams(path) {\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\n return {\n index: path.__pictorialAnimationIndex,\n count: path.__pictorialRepeatTimes\n };\n}\n\nfunction isAnimationEnabled() {\n // `animation` prop can be set on itemModel in pictorial bar chart.\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\n\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n // bar is the main element for each data.\n var bar = new graphic.Group(); // bundle is used for location and clip.\n\n var bundle = new graphic.Group();\n bar.add(bundle);\n bar.__pictorialBundle = bundle;\n bundle.x = symbolMeta.bundlePosition[0];\n bundle.y = symbolMeta.bundlePosition[1];\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n bar.__pictorialSymbolMeta = symbolMeta;\n return bar;\n}\n\nfunction updateBar(bar, opt, symbolMeta) {\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n var bundle = bar.__pictorialBundle;\n graphic.updateProps(bundle, {\n x: symbolMeta.bundlePosition[0],\n y: symbolMeta.bundlePosition[1]\n }, animationModel, dataIndex);\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, true);\n createOrUpdateClip(bar, opt, symbolMeta, true);\n}\n\nfunction removeBar(data, dataIndex, animationModel, bar) {\n // Not show text when animating\n var labelRect = bar.__pictorialBarRect;\n labelRect && labelRect.removeTextContent();\n var pathes = [];\n eachPath(bar, function (path) {\n pathes.push(path);\n });\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet.\n\n bar.__pictorialClipPath && (animationModel = null);\n zrUtil.each(pathes, function (path) {\n graphic.removeElement(path, {\n scaleX: 0,\n scaleY: 0\n }, animationModel, dataIndex, function () {\n bar.parent && bar.parent.remove(bar);\n });\n });\n data.setItemGraphicEl(dataIndex, null);\n}\n\nfunction getShapeStr(data, symbolMeta) {\n return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\n\nfunction eachPath(bar, cb, context) {\n // Do not use Group#eachChild, because it do not support remove.\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n el !== bar.__pictorialBarRect && cb.call(context, el);\n });\n}\n\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n\n if (symbolMeta.symbolClip && !isUpdate) {\n animationAttrs && el.attr(animationAttrs);\n } else {\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n }\n}\n\nfunction updateCommon(bar, opt, symbolMeta) {\n var dataIndex = symbolMeta.dataIndex;\n var itemModel = symbolMeta.itemModel; // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var emphasisModel = itemModel.getModel('emphasis');\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var hoverScale = emphasisModel.get('scale');\n eachPath(bar, function (path) {\n if (path instanceof ZRImage) {\n var pathStyle = path.style;\n path.useStyle(zrUtil.extend({\n // TODO other properties like dx, dy ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolMeta.style));\n } else {\n path.useStyle(symbolMeta.style);\n }\n\n var emphasisState = path.ensureState('emphasis');\n emphasisState.style = emphasisStyle;\n\n if (hoverScale) {\n // NOTE: Must after scale is set after updateAttr\n emphasisState.scaleX = path.scaleX * 1.1;\n emphasisState.scaleY = path.scaleY * 1.1;\n }\n\n path.ensureState('blur').style = blurStyle;\n path.ensureState('select').style = selectStyle;\n cursorStyle && (path.cursor = cursorStyle);\n path.z2 = symbolMeta.z2;\n });\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n var barRect = bar.__pictorialBarRect;\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\n labelFetcher: opt.seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\n inheritColor: symbolMeta.style.fill,\n defaultOpacity: symbolMeta.style.opacity,\n defaultOutsidePosition: barPositionOutside\n });\n enableHoverEmphasis(bar, focus, blurScope);\n}\n\nfunction toIntTimes(times) {\n var roundedTimes = Math.round(times); // Escapse accurate error\n\n return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\n\nexport default PictorialBarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar PictorialBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarSeriesModel, _super);\n\n function PictorialBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarSeriesModel.type;\n _this.hasSymbolVisual = true;\n _this.defaultSymbol = 'roundRect';\n return _this;\n }\n\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\n // Disable stack.\n option.stack = null;\n return _super.prototype.getInitialData.apply(this, arguments);\n };\n\n PictorialBarSeriesModel.type = 'series.pictorialBar';\n PictorialBarSeriesModel.dependencies = ['grid'];\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n symbol: 'circle',\n symbolSize: null,\n symbolRotate: null,\n symbolPosition: null,\n symbolOffset: null,\n symbolMargin: null,\n symbolRepeat: false,\n symbolRepeatDirection: 'end',\n symbolClip: false,\n symbolBoundingData: null,\n symbolPatternSize: 400,\n barGap: '-100%',\n // z can be set in data item, which is z2 actually.\n // Disable progressive\n progressive: 0,\n emphasis: {\n // By default pictorialBar do not hover scale. Hover scale is not suitable\n // for the case that both has foreground and background.\n scale: false\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n });\n return PictorialBarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default PictorialBarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PictorialBarView from './PictorialBarView';\nimport PictorialBarSeriesModel from './PictorialBarSeries';\nimport { layout } from '../../layout/barGrid';\nimport { curry } from 'zrender/lib/core/util';\nexport function install(registers) {\n registers.registerChartView(PictorialBarView);\n registers.registerSeriesModel(PictorialBarSeriesModel);\n registers.registerLayout(curry(layout, 'pictorialBar'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { ECPolygon } from '../line/poly';\nimport * as graphic from '../../util/graphic';\nimport { setStatesStylesFromModel, enableHoverEmphasis } from '../../util/states';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport { bind } from 'zrender/lib/core/util';\nimport DataDiffer from '../../data/DataDiffer';\nimport ChartView from '../../view/Chart';\n\nvar ThemeRiverView =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverView, _super);\n\n function ThemeRiverView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverView.type;\n _this._layers = [];\n return _this;\n }\n\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var self = this;\n var group = this.group;\n var layersSeries = seriesModel.getLayerSeries();\n var layoutInfo = data.getLayout('layoutInfo');\n var rect = layoutInfo.rect;\n var boundaryGap = layoutInfo.boundaryGap;\n group.x = 0;\n group.y = rect.y + boundaryGap[0];\n\n function keyGetter(item) {\n return item.name;\n }\n\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\n var newLayersGroups = [];\n dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n\n function process(status, idx, oldIdx) {\n var oldLayersGroups = self._layers;\n\n if (status === 'remove') {\n group.remove(oldLayersGroups[idx]);\n return;\n }\n\n var points0 = [];\n var points1 = [];\n var style;\n var indices = layersSeries[idx].indices;\n var j = 0;\n\n for (; j < indices.length; j++) {\n var layout = data.getItemLayout(indices[j]);\n var x = layout.x;\n var y0 = layout.y0;\n var y = layout.y;\n points0.push(x, y0);\n points1.push(x, y0 + y);\n style = data.getItemVisual(indices[j], 'style');\n }\n\n var polygon;\n var textLayout = data.getItemLayout(indices[0]);\n var labelModel = seriesModel.getModel('label');\n var margin = labelModel.get('margin');\n var emphasisModel = seriesModel.getModel('emphasis');\n\n if (status === 'add') {\n var layerGroup = newLayersGroups[idx] = new graphic.Group();\n polygon = new ECPolygon({\n shape: {\n points: points0,\n stackedOnPoints: points1,\n smooth: 0.4,\n stackedOnSmooth: 0.4,\n smoothConstraint: false\n },\n z2: 0\n });\n layerGroup.add(polygon);\n group.add(layerGroup);\n\n if (seriesModel.isAnimationEnabled()) {\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n polygon.removeClipPath();\n }));\n }\n } else {\n var layerGroup = oldLayersGroups[oldIdx];\n polygon = layerGroup.childAt(0);\n group.add(layerGroup);\n newLayersGroups[idx] = layerGroup;\n graphic.updateProps(polygon, {\n shape: {\n points: points0,\n stackedOnPoints: points1\n }\n }, seriesModel);\n }\n\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\n labelDataIndex: indices[j - 1],\n defaultText: data.getName(indices[j - 1]),\n inheritColor: style.fill\n }, {\n normal: {\n verticalAlign: 'middle' // align: 'right'\n\n }\n });\n polygon.setTextConfig({\n position: null,\n local: true\n });\n var labelEl = polygon.getTextContent(); // TODO More label position options.\n\n if (labelEl) {\n labelEl.x = textLayout.x - margin;\n labelEl.y = textLayout.y0 + textLayout.y / 2;\n }\n\n polygon.useStyle(style);\n data.setItemGraphicEl(idx, polygon);\n setStatesStylesFromModel(polygon, seriesModel);\n enableHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\n }\n\n this._layersSeries = layersSeries;\n this._layers = newLayersGroups;\n };\n\n ThemeRiverView.type = 'themeRiver';\n return ThemeRiverView;\n}(ChartView);\n\n; // add animation to the view\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n x: rect.x - 50,\n width: rect.width + 100,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default ThemeRiverView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series';\nimport createDimensions from '../../data/helper/createDimensions';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper';\nimport List from '../../data/List';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { groupData, SINGLE_REFERRING } from '../../util/model';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\nvar DATA_NAME_INDEX = 2;\n\nvar ThemeRiverSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverSeriesModel, _super);\n\n function ThemeRiverSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverSeriesModel.type;\n _this.useColorPaletteOnData = true;\n return _this;\n }\n /**\n * @override\n */\n\n\n ThemeRiverSeriesModel.prototype.init = function (option) {\n // eslint-disable-next-line\n _super.prototype.init.apply(this, arguments); // Put this function here is for the sake of consistency of code style.\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n /**\n * If there is no value of a certain point in the time for some event,set it value to 0.\n *\n * @param {Array} data initial data in the option\n * @return {Array}\n */\n\n\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\n var rawDataLength = data.length;\n /**\n * Make sure every layer data get the same keys.\n * The value index tells which layer has visited.\n * {\n * 2014/01/01: -1\n * }\n */\n\n var timeValueKeys = {}; // grouped data by name\n\n var groupResult = groupData(data, function (item) {\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\n timeValueKeys[item[0] + ''] = -1;\n }\n\n return item[2];\n });\n var layerData = [];\n groupResult.buckets.each(function (items, key) {\n layerData.push({\n name: key,\n dataList: items\n });\n });\n var layerNum = layerData.length;\n\n for (var k = 0; k < layerNum; ++k) {\n var name_1 = layerData[k].name;\n\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\n var timeValue = layerData[k].dataList[j][0] + '';\n timeValueKeys[timeValue] = k;\n }\n\n for (var timeValue in timeValueKeys) {\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\n timeValueKeys[timeValue] = k;\n data[rawDataLength] = [timeValue, 0, name_1];\n rawDataLength++;\n }\n }\n }\n\n return data;\n };\n /**\n * @override\n * @param option the initial option that user gived\n * @param ecModel the model object for themeRiver option\n */\n\n\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined\n\n var filterData = zrUtil.filter(option.data, function (dataItem) {\n return dataItem[2] !== undefined;\n }); // ??? TODO design a stage to transfer data for themeRiver and lines?\n\n var data = this.fixData(filterData || []);\n var nameList = [];\n var nameMap = this.nameMap = zrUtil.createHashMap();\n var count = 0;\n\n for (var i = 0; i < data.length; ++i) {\n nameList.push(data[i][DATA_NAME_INDEX]);\n\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n nameMap.set(data[i][DATA_NAME_INDEX], count);\n count++;\n }\n }\n\n var dimensionsInfo = createDimensions(data, {\n coordDimensions: ['single'],\n dimensionsDefine: [{\n name: 'time',\n type: getDimensionTypeByAxis(axisType)\n }, {\n name: 'value',\n type: 'float'\n }, {\n name: 'name',\n type: 'ordinal'\n }],\n encodeDefine: {\n single: 0,\n value: 1,\n itemName: 2\n }\n });\n var list = new List(dimensionsInfo, this);\n list.initData(data);\n return list;\n };\n /**\n * The raw data is divided into multiple layers and each layer\n * has same name.\n */\n\n\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\n var data = this.getData();\n var lenCount = data.count();\n var indexArr = [];\n\n for (var i = 0; i < lenCount; ++i) {\n indexArr[i] = i;\n }\n\n var timeDim = data.mapDimension('single'); // data group by name\n\n var groupResult = groupData(indexArr, function (index) {\n return data.get('name', index);\n });\n var layerSeries = [];\n groupResult.buckets.each(function (items, key) {\n items.sort(function (index1, index2) {\n return data.get(timeDim, index1) - data.get(timeDim, index2);\n });\n layerSeries.push({\n name: key,\n indices: items\n });\n });\n return layerSeries;\n };\n /**\n * Get data indices for show tooltip content\n */\n\n\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\n if (!zrUtil.isArray(dim)) {\n dim = dim ? [dim] : [];\n }\n\n var data = this.getData();\n var layerSeries = this.getLayerSeries();\n var indices = [];\n var layerNum = layerSeries.length;\n var nestestValue;\n\n for (var i = 0; i < layerNum; ++i) {\n var minDist = Number.MAX_VALUE;\n var nearestIdx = -1;\n var pointNum = layerSeries[i].indices.length;\n\n for (var j = 0; j < pointNum; ++j) {\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n var dist = Math.abs(theValue - value);\n\n if (dist <= minDist) {\n nestestValue = theValue;\n minDist = dist;\n nearestIdx = layerSeries[i].indices[j];\n }\n }\n\n indices.push(nearestIdx);\n }\n\n return {\n dataIndices: indices,\n nestestValue: nestestValue\n };\n };\n\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var name = data.getName(dataIndex);\n var value = data.get(data.mapDimension('value'), dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n\n ThemeRiverSeriesModel.type = 'series.themeRiver';\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\n ThemeRiverSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'singleAxis',\n // gap in axis's orthogonal orientation\n boundaryGap: ['10%', '10%'],\n // legendHoverLink: true,\n singleAxisIndex: 0,\n animationEasing: 'linear',\n label: {\n margin: 4,\n show: true,\n position: 'left',\n fontSize: 11\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return ThemeRiverSeriesModel;\n}(SeriesModel);\n\nexport default ThemeRiverSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as numberUtil from '../../util/number';\nexport default function themeRiverLayout(ecModel, api) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var single = seriesModel.coordinateSystem;\n var layoutInfo = {}; // use the axis boundingRect for view\n\n var rect = single.getRect();\n layoutInfo.rect = rect;\n var boundaryGap = seriesModel.get('boundaryGap');\n var axis = single.getAxis();\n layoutInfo.boundaryGap = boundaryGap;\n\n if (axis.orient === 'horizontal') {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, height);\n } else {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, width);\n }\n\n data.setLayout('layoutInfo', layoutInfo);\n });\n}\n/**\n * The layout information about themeriver\n *\n * @param data data in the series\n * @param seriesModel the model object of themeRiver series\n * @param height value used to compute every series height\n */\n\nfunction doThemeRiverLayout(data, seriesModel, height) {\n if (!data.count()) {\n return;\n }\n\n var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series.\n\n var layerSeries = seriesModel.getLayerSeries(); // the points in each layer.\n\n var timeDim = data.mapDimension('single');\n var valueDim = data.mapDimension('value');\n var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n return zrUtil.map(singleLayer.indices, function (idx) {\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n pt[1] = data.get(valueDim, idx);\n return pt;\n });\n });\n var base = computeBaseline(layerPoints);\n var baseLine = base.y0;\n var ky = height / base.max; // set layout information for each item.\n\n var n = layerSeries.length;\n var m = layerSeries[0].indices.length;\n var baseY0;\n\n for (var j = 0; j < m; ++j) {\n baseY0 = baseLine[j] * ky;\n data.setItemLayout(layerSeries[0].indices[j], {\n layerIndex: 0,\n x: layerPoints[0][j][0],\n y0: baseY0,\n y: layerPoints[0][j][1] * ky\n });\n\n for (var i = 1; i < n; ++i) {\n baseY0 += layerPoints[i - 1][j][1] * ky;\n data.setItemLayout(layerSeries[i].indices[j], {\n layerIndex: i,\n x: layerPoints[i][j][0],\n y0: baseY0,\n y: layerPoints[i][j][1] * ky\n });\n }\n }\n}\n/**\n * Compute the baseLine of the rawdata\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\n *\n * @param data the points in each layer\n */\n\n\nfunction computeBaseline(data) {\n var layerNum = data.length;\n var pointNum = data[0].length;\n var sums = [];\n var y0 = [];\n var max = 0;\n\n for (var i = 0; i < pointNum; ++i) {\n var temp = 0;\n\n for (var j = 0; j < layerNum; ++j) {\n temp += data[j][i][1];\n }\n\n if (temp > max) {\n max = temp;\n }\n\n sums.push(temp);\n }\n\n for (var k = 0; k < pointNum; ++k) {\n y0[k] = (max - sums[k]) / 2;\n }\n\n max = 0;\n\n for (var l = 0; l < pointNum; ++l) {\n var sum = sums[l] + y0[l];\n\n if (sum > max) {\n max = sum;\n }\n }\n\n return {\n y0: y0,\n max: max\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport ThemeRiverView from './ThemeRiverView';\nimport ThemeRiverSeriesModel from './ThemeRiverSeries';\nimport themeRiverLayout from './themeRiverLayout';\nimport dataFilter from '../../processor/dataFilter';\nexport function install(registers) {\n registers.registerChartView(ThemeRiverView);\n registers.registerSeriesModel(ThemeRiverSeriesModel);\n registers.registerLayout(themeRiverLayout);\n registers.registerProcessor(dataFilter('themeRiver'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states';\nimport { createTextStyle } from '../../label/labelStyle';\nimport { getECData } from '../../util/innerStore';\nimport { getSectorCornerRadius } from '../helper/pieHelper';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\n * Sunburstce of Sunburst including Sector, Label, LabelLine\n */\n\nvar SunburstPiece =\n/** @class */\nfunction (_super) {\n __extends(SunburstPiece, _super);\n\n function SunburstPiece(node, seriesModel, ecModel, api) {\n var _this = _super.call(this) || this;\n\n _this.z2 = DEFAULT_SECTOR_Z;\n _this.textConfig = {\n inside: true\n };\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\n var text = new graphic.Text({\n z2: DEFAULT_TEXT_Z,\n silent: node.getModel().get(['label', 'silent'])\n });\n\n _this.setTextContent(text);\n\n _this.updateData(true, node, seriesModel, ecModel, api);\n\n return _this;\n }\n\n SunburstPiece.prototype.updateData = function (firstCreate, node, // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\n seriesModel, ecModel, api) {\n this.node = node;\n node.piece = this;\n seriesModel = seriesModel || this._seriesModel;\n ecModel = ecModel || this._ecModel;\n var sector = this;\n getECData(sector).dataIndex = node.dataIndex;\n var itemModel = node.getModel();\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = node.getLayout();\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n var normalStyle = node.getVisual('style');\n normalStyle.lineJoin = 'bevel';\n var decal = node.getVisual('decal');\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape);\n zrUtil.extend(sectorShape, cornerRadius);\n zrUtil.each(SPECIAL_STATES, function (stateName) {\n var state = sector.ensureState(stateName);\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\n state.style = itemStyleModel.getItemStyle(); // border radius\n\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\n\n if (cornerRadius) {\n state.shape = cornerRadius;\n }\n });\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n sector.shape.r = layout.r0;\n graphic.updateProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, node.dataIndex);\n } else {\n // Disable animation for gradient since no interpolation method\n // is supported for gradient\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel);\n }\n\n sector.useStyle(normalStyle);\n\n this._updateLabel(seriesModel);\n\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n this._seriesModel = seriesModel || this._seriesModel;\n this._ecModel = ecModel || this._ecModel;\n var focus = emphasisModel.get('focus');\n var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus;\n enableHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'));\n };\n\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\n var _this = this;\n\n var itemModel = this.node.getModel();\n var normalLabelModel = itemModel.getModel('label');\n var layout = this.node.getLayout();\n var angle = layout.endAngle - layout.startAngle;\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var sector = this;\n var label = sector.getTextContent();\n var dataIndex = this.node.dataIndex;\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\n var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\n label.ignore = !isNormalShown; // TODO use setLabelStyle\n\n zrUtil.each(DISPLAY_STATES, function (stateName) {\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']);\n var isNormal = stateName === 'normal';\n var state = isNormal ? label : label.ensureState(stateName);\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\n\n if (isNormal) {\n text = text || _this.node.name;\n }\n\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\n\n if (text) {\n state.style.text = text;\n } // Not displaying text when angle is too small\n\n\n var isShown = labelStateModel.get('show');\n\n if (isShown != null && !isNormal) {\n state.ignore = !isShown;\n }\n\n var labelPosition = getLabelAttr(labelStateModel, 'position');\n var sectorState = isNormal ? sector : sector.states[stateName];\n var labelColor = sectorState.style.fill;\n sectorState.textConfig = {\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\n inside: labelPosition !== 'outside'\n };\n var r;\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\n var textAlign = getLabelAttr(labelStateModel, 'align');\n\n if (labelPosition === 'outside') {\n r = layout.r + labelPadding;\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\n } else {\n if (!textAlign || textAlign === 'center') {\n r = (layout.r + layout.r0) / 2;\n textAlign = 'center';\n } else if (textAlign === 'left') {\n r = layout.r0 + labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'right';\n }\n } else if (textAlign === 'right') {\n r = layout.r - labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'left';\n }\n }\n }\n\n state.style.align = textAlign;\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\n state.x = r * dx + layout.cx;\n state.y = r * dy + layout.cy;\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = -midAngle;\n\n if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = Math.PI / 2 - midAngle;\n\n if (rotate > Math.PI / 2) {\n rotate -= Math.PI;\n } else if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (typeof rotateType === 'number') {\n rotate = rotateType * Math.PI / 180;\n }\n\n state.rotation = rotate;\n });\n\n function getLabelAttr(model, name) {\n var stateAttr = model.get(name);\n\n if (stateAttr == null) {\n return normalLabelModel.get(name);\n }\n\n return stateAttr;\n }\n\n label.dirtyStyle();\n };\n\n return SunburstPiece;\n}(graphic.Sector);\n\nexport default SunburstPiece;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util';\nimport { deprecateReplaceLog } from '../../util/log';\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper';\nexport var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\nexport function installSunburstAction(registers) {\n registers.registerAction({\n type: ROOT_TO_NODE_ACTION,\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n registers.registerAction({\n type: HIGHLIGHT_ACTION,\n update: 'none'\n }, function (payload, ecModel, api) {\n // Clone\n payload = extend({}, payload);\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleHighlight);\n\n function handleHighlight(model) {\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n\n if (targetInfo) {\n payload.dataIndex = targetInfo.node.dataIndex;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('highlight', 'sunburstHighlight');\n } // Fast forward action\n\n\n api.dispatchAction(extend(payload, {\n type: 'highlight'\n }));\n });\n registers.registerAction({\n type: UNHIGHLIGHT_ACTION,\n update: 'updateView'\n }, function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('downplay', 'sunburstUnhighlight');\n }\n\n api.dispatchAction(extend(payload, {\n type: 'downplay'\n }));\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ChartView from '../../view/Chart';\nimport SunburstPiece from './SunburstPiece';\nimport DataDiffer from '../../data/DataDiffer';\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction';\nimport { windowOpen } from '../../util/format';\n\nvar SunburstView =\n/** @class */\nfunction (_super) {\n __extends(SunburstView, _super);\n\n function SunburstView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstView.type;\n return _this;\n }\n\n SunburstView.prototype.render = function (seriesModel, ecModel, api, // @ts-ignore\n payload) {\n var self = this;\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var data = seriesModel.getData();\n var virtualRoot = data.tree.root;\n var newRoot = seriesModel.getViewRoot();\n var group = this.group;\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n var newChildren = [];\n newRoot.eachNode(function (node) {\n newChildren.push(node);\n });\n var oldChildren = this._oldChildren || [];\n dualTravel(newChildren, oldChildren);\n renderRollUp(virtualRoot, newRoot);\n\n this._initEvents();\n\n this._oldChildren = newChildren;\n\n function dualTravel(newChildren, oldChildren) {\n if (newChildren.length === 0 && oldChildren.length === 0) {\n return;\n }\n\n new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n\n function getKey(node) {\n return node.getId();\n }\n\n function processNode(newIdx, oldIdx) {\n var newNode = newIdx == null ? null : newChildren[newIdx];\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\n doRenderNode(newNode, oldNode);\n }\n }\n\n function doRenderNode(newNode, oldNode) {\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n // Not render data with value 0\n newNode = null;\n }\n\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n if (oldNode && oldNode.piece) {\n if (newNode) {\n // Update\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n } else {\n // Remove\n removeNode(oldNode);\n }\n } else if (newNode) {\n // Add\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\n group.add(piece); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, piece);\n }\n }\n }\n\n function removeNode(node) {\n if (!node) {\n return;\n }\n\n if (node.piece) {\n group.remove(node.piece);\n node.piece = null;\n }\n }\n\n function renderRollUp(virtualRoot, viewRoot) {\n if (viewRoot.depth > 0) {\n // Render\n if (self.virtualPiece) {\n // Update\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\n } else {\n // Add\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\n group.add(self.virtualPiece);\n } // TODO event scope\n\n\n viewRoot.piece.off('click');\n self.virtualPiece.on('click', function (e) {\n self._rootToNode(viewRoot.parentNode);\n });\n } else if (self.virtualPiece) {\n // Remove\n group.remove(self.virtualPiece);\n self.virtualPiece = null;\n }\n }\n };\n /**\n * @private\n */\n\n\n SunburstView.prototype._initEvents = function () {\n var _this = this;\n\n this.group.off('click');\n this.group.on('click', function (e) {\n var targetFound = false;\n\n var viewRoot = _this.seriesModel.getViewRoot();\n\n viewRoot.eachNode(function (node) {\n if (!targetFound && node.piece && node.piece === e.target) {\n var nodeClick = node.getModel().get('nodeClick');\n\n if (nodeClick === 'rootToNode') {\n _this._rootToNode(node);\n } else if (nodeClick === 'link') {\n var itemModel = node.getModel();\n var link = itemModel.get('link');\n\n if (link) {\n var linkTarget = itemModel.get('target', true) || '_blank';\n windowOpen(link, linkTarget);\n }\n }\n\n targetFound = true;\n }\n });\n });\n };\n /**\n * @private\n */\n\n\n SunburstView.prototype._rootToNode = function (node) {\n if (node !== this.seriesModel.getViewRoot()) {\n this.api.dispatchAction({\n type: ROOT_TO_NODE_ACTION,\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: node\n });\n }\n };\n /**\n * @implement\n */\n\n\n SunburstView.prototype.containPoint = function (point, seriesModel) {\n var treeRoot = seriesModel.getData();\n var itemLayout = treeRoot.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n SunburstView.type = 'sunburst';\n return SunburstView;\n}(ChartView);\n\nexport default SunburstView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport SeriesModel from '../../model/Series';\nimport Tree from '../../data/Tree';\nimport { wrapTreePathInfo } from '../helper/treeHelper';\nimport Model from '../../model/Model';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree';\n\nvar SunburstSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SunburstSeriesModel, _super);\n\n function SunburstSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstSeriesModel.type;\n _this.ignoreStyleOnData = true;\n return _this;\n }\n\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levelModels = zrUtil.map(option.levels || [], function (levelDefine) {\n return new Model(levelDefine, this, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = levelModels[node.depth];\n levelModel && (model.parentModel = levelModel);\n return model;\n });\n }\n\n return tree.data;\n };\n\n SunburstSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /*\n * @override\n */\n\n\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n };\n\n SunburstSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n SunburstSeriesModel.type = 'series.sunburst';\n SunburstSeriesModel.defaultOption = {\n zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // 'rootToNode', 'link', or false\n nodeClick: 'rootToNode',\n renderLabelForZeroData: false,\n label: {\n // could be: 'radial', 'tangential', or 'none'\n rotate: 'radial',\n show: true,\n opacity: 1,\n // 'left' is for inner side of inside, and 'right' is for outter\n // side for inside\n align: 'center',\n position: 'inside',\n distance: 5,\n silent: true\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: 'white',\n borderType: 'solid',\n shadowBlur: 0,\n shadowColor: 'rgba(0, 0, 0, 0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n emphasis: {\n focus: 'descendant'\n },\n blur: {\n itemStyle: {\n opacity: 0.2\n },\n label: {\n opacity: 0.1\n }\n },\n // Animation type canbe expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n data: [],\n levels: [],\n\n /**\n * Sort order.\n *\n * Valid values: 'desc', 'asc', null, or callback function.\n * 'desc' and 'asc' for descend and ascendant order;\n * null for not sorting;\n * example of callback function:\n * function(nodeA, nodeB) {\n * return nodeA.getValue() - nodeB.getValue();\n * }\n */\n sort: 'desc'\n };\n return SunburstSeriesModel;\n}(SeriesModel);\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value; // TODO First value of array must be a number\n\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n\nexport default SunburstSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parsePercent } from '../../util/number';\nimport * as zrUtil from 'zrender/lib/core/util'; // let PI2 = Math.PI * 2;\n\nvar RADIAN = Math.PI / 180;\nexport default function sunburstLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var virtualRoot = seriesModel.getData().tree.root;\n var treeRoot = seriesModel.getViewRoot();\n var rootDepth = treeRoot.depth;\n var sort = seriesModel.get('sort');\n\n if (sort != null) {\n initChildren(treeRoot, sort);\n }\n\n var validDataCount = 0;\n zrUtil.each(treeRoot.children, function (child) {\n !isNaN(child.getValue()) && validDataCount++;\n });\n var sum = treeRoot.getValue(); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var renderRollupNode = treeRoot.depth > 0;\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n var rPerLevel = (r - r0) / (levels || 1);\n var clockwise = seriesModel.get('clockwise');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle\n // let restAngle = PI2;\n // let valueSumLargerThanMinAngle = 0;\n\n var dir = clockwise ? 1 : -1;\n /**\n * Render a tree\n * @return increased angle\n */\n\n var renderNode = function (node, startAngle) {\n if (!node) {\n return;\n }\n\n var endAngle = startAngle; // Render self\n\n if (node !== virtualRoot) {\n // Tree node is virtual, so it doesn't need to be drawn\n var value = node.getValue();\n var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n\n if (angle < minAngle) {\n angle = minAngle; // restAngle -= minAngle;\n } // else {\n // valueSumLargerThanMinAngle += value;\n // }\n\n\n endAngle = startAngle + dir * angle;\n var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n var rStart = r0 + rPerLevel * depth;\n var rEnd = r0 + rPerLevel * (depth + 1);\n var itemModel = node.getModel(); // @ts-ignore. TODO this is not provided to developer yet. Rename it.\n\n if (itemModel.get('r0') != null) {\n // @ts-ignore\n rStart = parsePercent(itemModel.get('r0'), size / 2);\n } // @ts-ignore\n\n\n if (itemModel.get('r') != null) {\n // @ts-ignore\n rEnd = parsePercent(itemModel.get('r'), size / 2);\n }\n\n node.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n } // Render children\n\n\n if (node.children && node.children.length) {\n // currentAngle = startAngle;\n var siblingAngle_1 = 0;\n zrUtil.each(node.children, function (node) {\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\n });\n }\n\n return endAngle - startAngle;\n }; // Virtual root node for roll up\n\n\n if (renderRollupNode) {\n var rStart = r0;\n var rEnd = r0 + rPerLevel;\n var angle = Math.PI * 2;\n virtualRoot.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: startAngle + angle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n\n renderNode(treeRoot, startAngle);\n });\n}\n/**\n * Init node children by order and update visual\n */\n\nfunction initChildren(node, sortOrder) {\n var children = node.children || [];\n node.children = sort(children, sortOrder); // Init children recursively\n\n if (children.length) {\n zrUtil.each(node.children, function (child) {\n initChildren(child, sortOrder);\n });\n }\n}\n/**\n * Sort children nodes\n *\n * @param {TreeNode[]} children children of node to be sorted\n * @param {string | function | null} sort sort method\n * See SunburstSeries.js for details.\n */\n\n\nfunction sort(children, sortOrder) {\n if (typeof sortOrder === 'function') {\n var sortTargets = zrUtil.map(children, function (child, idx) {\n var value = child.getValue();\n return {\n params: {\n depth: child.depth,\n height: child.height,\n dataIndex: child.dataIndex,\n getValue: function () {\n return value;\n }\n },\n index: idx\n };\n });\n sortTargets.sort(function (a, b) {\n return sortOrder(a.params, b.params);\n });\n return zrUtil.map(sortTargets, function (target) {\n return children[target.index];\n });\n } else {\n var isAsc_1 = sortOrder === 'asc';\n return children.sort(function (a, b) {\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\n return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff;\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util';\nimport { lift } from 'zrender/lib/tool/color';\nexport default function sunburstVisual(ecModel) {\n var paletteScope = {}; // Default color strategy\n\n function pickColor(node, seriesModel, treeHeight) {\n // Choose color from palette based on the first level.\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n\n if (node.depth > 1 && typeof color === 'string') {\n // Lighter on the deeper level.\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n }\n\n return color;\n }\n\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n var style = model.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n style.fill = pickColor(node, seriesModel, tree.root.height);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SunburstView from './SunburstView';\nimport SunburstSeriesModel from './SunburstSeries';\nimport sunburstLayout from './sunburstLayout';\nimport sunburstVisual from './sunburstVisual';\nimport dataFilter from '../../processor/dataFilter';\nimport { curry } from 'zrender/lib/core/util';\nimport { installSunburstAction } from './sunburstAction';\nexport function install(registers) {\n registers.registerChartView(SunburstView);\n registers.registerSeriesModel(SunburstSeriesModel);\n registers.registerLayout(curry(sunburstLayout, 'sunburst'));\n registers.registerProcessor(curry(dataFilter, 'sunburst'));\n registers.registerVisual(sunburstVisual);\n installSunburstAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n var axis = this.getAxis(dim);\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n }, this);\n}\n\nexport default function cartesianPrepareCustom(coordSys) {\n var rect = coordSys.master.getRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'cartesian2d',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\n\nexport default function geoPrepareCustom(coordSys) {\n var rect = coordSys.getBoundingRect();\n return {\n coordSys: {\n type: 'geo',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n zoom: coordSys.getZoom()\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" and noRoam param,\n // Compatible with this usage:\n // echarts.util.map(item.points, api.coord)\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind } from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\n\nexport default function singlePrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n return {\n coordSys: {\n type: 'singleAxis',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (val) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(val);\n },\n size: bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // import AngleAxis from './AngleAxis';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis\n\n var axis = this[getterName]();\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n\n if (dim === 'Angle') {\n result = result * Math.PI / 180;\n }\n\n return result;\n }, this);\n}\n\nexport default function polarPrepareCustom(coordSys) {\n var radiusAxis = coordSys.getRadiusAxis();\n var angleAxis = coordSys.getAngleAxis();\n var radius = radiusAxis.getExtent();\n radius[0] > radius[1] && radius.reverse();\n return {\n coordSys: {\n type: 'polar',\n cx: coordSys.cx,\n cy: coordSys.cy,\n r: radius[1],\n r0: radius[0]\n },\n api: {\n coord: function (data) {\n var radius = radiusAxis.dataToRadius(data[0]);\n var angle = angleAxis.dataToAngle(data[1]);\n var coord = coordSys.coordToPoint([radius, angle]);\n coord.push(radius, angle * Math.PI / 180);\n return coord;\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function calendarPrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n var rangeInfo = coordSys.getRangeInfo();\n return {\n coordSys: {\n type: 'calendar',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n cellWidth: coordSys.getCellWidth(),\n cellHeight: coordSys.getCellHeight(),\n rangeInfo: {\n start: rangeInfo.start,\n end: rangeInfo.end,\n weeks: rangeInfo.weeks,\n dayCount: rangeInfo.allDay\n }\n },\n api: {\n coord: function (data, clamp) {\n return coordSys.dataToPoint(data, clamp);\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, hasOwn } from 'zrender/lib/core/util';\nvar deprecatedLogs = {};\n/**\n * Whether need to call `convertEC4CompatibleStyle`.\n */\n\nexport function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n // Since echarts5, `RectText` is separated from its host element and style.text\n // does not exist any more. The compat work brings some extra burden on performance.\n // So we provide:\n // `legacy: true` force make compat.\n // `legacy: false`, force do not compat.\n // `legacy` not set: auto detect wheter legacy.\n // But in this case we do not compat (difficult to detect and rare case):\n // Becuse custom series and graphic component support \"merge\", users may firstly\n // only set `textStrokeWidth` style or secondly only set `text`.\n return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' // Difficult to detect whether legacy for a \"text\" el.\n && (elType === 'text' || hasOwn(style, 'text')));\n}\n/**\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\n * @param hostStyle The properties might be modified.\n * @return If be text el, `textContentStyle` and `textConfig` will not be retured.\n * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\n * retried from the `hostStyle`.\n */\n\nexport function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\n var srcStyle = hostStyle;\n var textConfig;\n var textContent;\n var textContentStyle;\n\n if (elType === 'text') {\n textContentStyle = srcStyle;\n } else {\n textContentStyle = {};\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\n textContent = {\n type: 'text',\n style: textContentStyle,\n // ec4 do not support rectText trigger.\n // And when text postion is different in normal and emphasis\n // => hover text trigger emphasis;\n // => text position changed, leave mouse pointer immediately;\n // That might cause state incorrect.\n silent: true\n };\n textConfig = {};\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\n\n if (isNormal) {\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\n } else {\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\n }\n\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\n }\n\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\n each(textContentStyle.rich, function (richItem) {\n convertEC4CompatibleRichItem(richItem, richItem);\n });\n return {\n textConfig: textConfig,\n textContent: textContent\n };\n}\n/**\n * The result will be set to `out`.\n */\n\nfunction convertEC4CompatibleRichItem(out, richItem) {\n if (!richItem) {\n return;\n } // (1) For simplicity, make textXXX properties (deprecated since ec5) has\n // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\n // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\n // richText in ec5.\n // (2) `out === richItem` if and only if `out` is text el or rich item.\n // So we can overwite existing props in `out` since textXXX has higher priority.\n\n\n richItem.font = richItem.textFont || richItem.font;\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\n}\n/**\n * Convert to pure echarts4 format style.\n * `itemStyle` will be modified, added with ec4 style properties from\n * `textStyle` and `textConfig`.\n *\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\n */\n\n\nexport function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\n var out = itemStl; // See `custom.ts`, a trick to set extra `textPosition` firstly.\n\n out.textPosition = out.textPosition || txCfg.position || 'inside';\n txCfg.offset != null && (out.textOffset = txCfg.offset);\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\n txCfg.distance != null && (out.textDistance = txCfg.distance);\n var isInside = out.textPosition.indexOf('inside') >= 0;\n var hostFill = itemStl.fill || '#000';\n convertToEC4RichItem(out, txStl);\n var textFillNotSet = out.textFill == null;\n\n if (isInside) {\n if (textFillNotSet) {\n out.textFill = txCfg.insideFill || '#fff';\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\n !out.textStroke && (out.textStroke = hostFill);\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\n }\n } else {\n if (textFillNotSet) {\n out.textFill = itemStl.fill || txCfg.outsideFill || '#000';\n }\n\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\n }\n\n out.text = txStl.text;\n out.rich = txStl.rich;\n each(txStl.rich, function (richItem) {\n convertToEC4RichItem(richItem, richItem);\n });\n return out;\n}\n\nfunction convertToEC4RichItem(out, richItem) {\n if (!richItem) {\n return;\n }\n\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\n hasOwn(richItem, 'font') && (out.font = richItem.font);\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\n}\n\nexport function warnDeprecated(deprecated, insteadApproach) {\n if (process.env.NODE_ENV !== 'production') {\n var key = deprecated + '^_^' + insteadApproach;\n\n if (!deprecatedLogs[key]) {\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\n deprecatedLogs[key] = true;\n }\n }\n}","import PathProxy from '../core/PathProxy';\nimport { cubicSubdivide } from '../core/curve';\nimport { defaults, assert, noop, clone } from '../core/util';\nimport { lerp } from '../core/vector';\nimport Rect from '../graphic/shape/Rect';\nimport Sector from '../graphic/shape/Sector';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar PROP_XY = ['x', 'y'];\nvar PROP_WH = ['width', 'height'];\nvar tmpArr = [];\nfunction aroundEqual(a, b) {\n return Math.abs(a - b) < 1e-5;\n}\nexport function pathToBezierCurves(path) {\n var data = path.data;\n var len = path.len();\n var bezierArray = [];\n var currentSubpath;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n function createNewSubpath(x, y) {\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArray.push(currentSubpath);\n }\n currentSubpath = [x, y];\n }\n function addLine(x0, y0, x1, y1) {\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\n }\n }\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\n var delta = Math.abs(endAngle - startAngle);\n var len = Math.tan(delta / 4) * 4 / 3;\n var dir = endAngle < startAngle ? -1 : 1;\n var c1 = Math.cos(startAngle);\n var s1 = Math.sin(startAngle);\n var c2 = Math.cos(endAngle);\n var s2 = Math.sin(endAngle);\n var x1 = c1 * rx + cx;\n var y1 = s1 * ry + cy;\n var x4 = c2 * rx + cx;\n var y4 = s2 * ry + cy;\n var hx = rx * len * dir;\n var hy = ry * len * dir;\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\n }\n var x1;\n var y1;\n var x2;\n var y2;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n currentSubpath = [x0, y0];\n }\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n createNewSubpath(x0, y0);\n break;\n case CMD.L:\n x1 = data[i++];\n y1 = data[i++];\n addLine(xi, yi, x1, y1);\n xi = x1;\n yi = y1;\n break;\n case CMD.C:\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\n break;\n case CMD.Q:\n x1 = data[i++];\n y1 = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\n xi = x2;\n yi = y2;\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n x1 = Math.cos(startAngle) * rx + cx;\n y1 = Math.sin(startAngle) * ry + cy;\n if (isFirst) {\n x0 = x1;\n y0 = y1;\n createNewSubpath(x0, y0);\n }\n else {\n addLine(xi, yi, x1, y1);\n }\n xi = Math.cos(endAngle) * rx + cx;\n yi = Math.sin(endAngle) * ry + cy;\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n : Math.min(angle + step, endAngle);\n addArc(angle, nextAngle, cx, cy, rx, ry);\n }\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n x1 = x0 + data[i++];\n y1 = y0 + data[i++];\n createNewSubpath(x1, y0);\n addLine(x1, y0, x1, y1);\n addLine(x1, y1, x0, y1);\n addLine(x0, y1, x0, y0);\n addLine(x0, y0, x1, y0);\n break;\n case CMD.Z:\n currentSubpath && addLine(xi, yi, x0, y0);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArray.push(currentSubpath);\n }\n return bezierArray;\n}\nfunction alignSubpath(subpath1, subpath2) {\n var len1 = subpath1.length;\n var len2 = subpath2.length;\n if (len1 === len2) {\n return [subpath1, subpath2];\n }\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\n var shorterLen = Math.min(len1, len2);\n var diff = Math.abs(len2 - len1) / 6;\n var shorterBezierCount = (shorterLen - 2) / 6;\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n var newSubpath = [shorterPath[0], shorterPath[1]];\n var remained = diff;\n var tmpSegX = [];\n var tmpSegY = [];\n for (var i = 2; i < shorterLen;) {\n var x0 = shorterPath[i - 2];\n var y0 = shorterPath[i - 1];\n var x1 = shorterPath[i++];\n var y1 = shorterPath[i++];\n var x2 = shorterPath[i++];\n var y2 = shorterPath[i++];\n var x3 = shorterPath[i++];\n var y3 = shorterPath[i++];\n if (remained <= 0) {\n newSubpath.push(x1, y1, x2, y2, x3, y3);\n continue;\n }\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n for (var k = 1; k <= actualSubDivCount; k++) {\n var p = k / actualSubDivCount;\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n x0 = tmpSegX[3];\n y0 = tmpSegY[3];\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n x1 = tmpSegX[5];\n y1 = tmpSegY[5];\n x2 = tmpSegX[6];\n y2 = tmpSegY[6];\n }\n remained -= actualSubDivCount - 1;\n }\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\n var len = lastSubpathSubpath.length;\n var lastX = lastSubpathSubpath[len - 2];\n var lastY = lastSubpathSubpath[len - 1];\n var newSubpath = [];\n for (var i = 0; i < otherSubpath.length;) {\n newSubpath[i++] = lastX;\n newSubpath[i++] = lastY;\n }\n return newSubpath;\n}\nexport function alignBezierCurves(array1, array2) {\n var _a;\n var lastSubpath1;\n var lastSubpath2;\n var newArray1 = [];\n var newArray2 = [];\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\n var subpath1 = array1[i];\n var subpath2 = array2[i];\n var newSubpath1 = void 0;\n var newSubpath2 = void 0;\n if (!subpath1) {\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n newSubpath2 = subpath2;\n }\n else if (!subpath2) {\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n newSubpath1 = subpath1;\n }\n else {\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\n lastSubpath1 = newSubpath1;\n lastSubpath2 = newSubpath2;\n }\n newArray1.push(newSubpath1);\n newArray2.push(newSubpath2);\n }\n return [newArray1, newArray2];\n}\nexport function centroid(array) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = array.length;\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\n var x0 = array[j];\n var y0 = array[j + 1];\n var x1 = array[i];\n var y1 = array[i + 1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n }\n if (signedArea === 0) {\n return [array[0] || 0, array[1] || 0];\n }\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\n var bezierCount = (fromSubBeziers.length - 2) / 6;\n var bestScore = Infinity;\n var bestOffset = 0;\n var len = fromSubBeziers.length;\n var len2 = len - 2;\n for (var offset = 0; offset < bezierCount; offset++) {\n var cursorOffset = offset * 6;\n var score = 0;\n for (var k = 0; k < len; k += 2) {\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n var x0 = fromSubBeziers[idx] - fromCp[0];\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\n var x1 = toSubBeziers[k] - toCp[0];\n var y1 = toSubBeziers[k + 1] - toCp[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestOffset = offset;\n }\n }\n return bestOffset;\n}\nfunction reverse(array) {\n var newArr = [];\n var len = array.length;\n for (var i = 0; i < len; i += 2) {\n newArr[i] = array[len - i - 2];\n newArr[i + 1] = array[len - i - 1];\n }\n return newArr;\n}\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\n var result = [];\n var fromNeedsReverse;\n for (var i = 0; i < fromArr.length; i++) {\n var fromSubpathBezier = fromArr[i];\n var toSubpathBezier = toArr[i];\n var fromCp = centroid(fromSubpathBezier);\n var toCp = centroid(toSubpathBezier);\n if (fromNeedsReverse == null) {\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n }\n var newFromSubpathBezier = [];\n var newToSubpathBezier = [];\n var bestAngle = 0;\n var bestScore = Infinity;\n var tmpArr_1 = [];\n var len = fromSubpathBezier.length;\n if (fromNeedsReverse) {\n fromSubpathBezier = reverse(fromSubpathBezier);\n }\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n var len2 = len - 2;\n for (var k = 0; k < len2; k += 2) {\n var idx = (offset + k) % len2 + 2;\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n }\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n if (searchAngleIteration > 0) {\n var step = searchAngleRange / searchAngleIteration;\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n var score = 0;\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\n var x0 = newFromSubpathBezier[k];\n var y0 = newFromSubpathBezier[k + 1];\n var x1 = toSubpathBezier[k] - toCp[0];\n var y1 = toSubpathBezier[k + 1] - toCp[1];\n var newX1 = x1 * ca - y1 * sa;\n var newY1 = x1 * sa + y1 * ca;\n tmpArr_1[k] = newX1;\n tmpArr_1[k + 1] = newY1;\n var dx = newX1 - x0;\n var dy = newY1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestAngle = angle;\n for (var m = 0; m < tmpArr_1.length; m++) {\n newToSubpathBezier[m] = tmpArr_1[m];\n }\n }\n }\n }\n else {\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\n }\n }\n result.push({\n from: newFromSubpathBezier,\n to: newToSubpathBezier,\n fromCp: fromCp,\n toCp: toCp,\n rotation: -bestAngle\n });\n }\n return result;\n}\nexport function morphPath(fromPath, toPath, animationOpts) {\n var fromPathProxy;\n var toPathProxy;\n if (!fromPath || !toPath) {\n return toPath;\n }\n !fromPath.path && fromPath.createPathProxy();\n fromPathProxy = fromPath.path;\n fromPathProxy.beginPath();\n fromPath.buildPath(fromPathProxy, fromPath.shape);\n !toPath.path && toPath.createPathProxy();\n toPathProxy = toPath.path;\n toPathProxy === fromPathProxy && (toPathProxy = new PathProxy(false));\n toPathProxy.beginPath();\n if (isIndividualMorphingPath(toPath)) {\n toPath.__oldBuildPath(toPathProxy, toPath.shape);\n }\n else {\n toPath.buildPath(toPathProxy, toPath.shape);\n }\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n becomeIndividualMorphingPath(toPath, morphingData, 0);\n var oldDone = animationOpts && animationOpts.done;\n var oldAborted = animationOpts && animationOpts.aborted;\n var oldDuring = animationOpts && animationOpts.during;\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n toPath.dirtyShape();\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreIndividualMorphingPath(toPath);\n toPath.createPathProxy();\n toPath.dirtyShape();\n oldDone && oldDone();\n },\n aborted: function () {\n oldAborted && oldAborted();\n }\n }, animationOpts));\n return toPath;\n}\nfunction morphingPathBuildPath(path) {\n var morphingData = this.__morphingData;\n var t = this.__morphT;\n var onet = 1 - t;\n var newCp = [];\n for (var i = 0; i < morphingData.length; i++) {\n var item = morphingData[i];\n var from = item.from;\n var to = item.to;\n var angle = item.rotation * t;\n var fromCp = item.fromCp;\n var toCp = item.toCp;\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n lerp(newCp, fromCp, toCp, t);\n for (var m = 0; m < from.length; m += 2) {\n var x0 = from[m];\n var y0 = from[m + 1];\n var x1 = to[m];\n var y1 = to[m + 1];\n var x = x0 * onet + x1 * t;\n var y = y0 * onet + y1 * t;\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n }\n for (var m = 0; m < from.length;) {\n if (m === 0) {\n path.moveTo(tmpArr[m++], tmpArr[m++]);\n }\n path.bezierCurveTo(tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++]);\n }\n }\n}\n;\nfunction becomeIndividualMorphingPath(path, morphingData, morphT) {\n if (isIndividualMorphingPath(path)) {\n updateIndividualMorphingPath(path, morphingData, morphT);\n return;\n }\n var morphingPath = path;\n morphingPath.__oldBuildPath = morphingPath.buildPath;\n morphingPath.buildPath = morphingPathBuildPath;\n updateIndividualMorphingPath(morphingPath, morphingData, morphT);\n}\nfunction updateIndividualMorphingPath(morphingPath, morphingData, morphT) {\n morphingPath.__morphingData = morphingData;\n morphingPath.__morphT = morphT;\n}\nfunction restoreIndividualMorphingPath(path) {\n if (isIndividualMorphingPath(path)) {\n path.buildPath = path.__oldBuildPath;\n path.__oldBuildPath = path.__morphingData = null;\n }\n}\nfunction isIndividualMorphingPath(path) {\n return path.__oldBuildPath != null;\n}\nexport function isCombiningPath(path) {\n return !!path.__combiningSubList;\n}\nexport function isInAnyMorphing(path) {\n return isIndividualMorphingPath(path) || isCombiningPath(path);\n}\nexport function combine(fromPathList, toPath, animationOpts, copyPropsIfDivided) {\n var fromIndividuals = [];\n var separateCount = 0;\n for (var i = 0; i < fromPathList.length; i++) {\n var fromPath = fromPathList[i];\n if (isCombiningPath(fromPath)) {\n var fromCombiningSubList = fromPath.__combiningSubList;\n for (var j = 0; j < fromCombiningSubList.length; j++) {\n fromIndividuals.push(fromCombiningSubList[j]);\n }\n separateCount += fromCombiningSubList.length;\n }\n else {\n fromIndividuals.push(fromPath);\n separateCount++;\n }\n }\n if (!separateCount) {\n return;\n }\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\n var toPathSplittedList = divideShape(toPath, separateCount, dividingMethod);\n assert(toPathSplittedList.length === separateCount);\n var oldDone = animationOpts && animationOpts.done;\n var oldAborted = animationOpts && animationOpts.aborted;\n var oldDuring = animationOpts && animationOpts.during;\n var doneCount = 0;\n var abortedCalled = false;\n var morphAnimationOpts = defaults({\n during: function (p) {\n oldDuring && oldDuring(p);\n },\n done: function () {\n doneCount++;\n if (doneCount === toPathSplittedList.length) {\n restoreCombiningPath(toPath);\n oldDone && oldDone();\n }\n },\n aborted: function () {\n if (!abortedCalled) {\n abortedCalled = true;\n oldAborted && oldAborted();\n }\n }\n }, animationOpts);\n for (var i = 0; i < separateCount; i++) {\n var from = fromIndividuals[i];\n var to = toPathSplittedList[i];\n copyPropsIfDivided && copyPropsIfDivided(toPath, to, true);\n morphPath(from, to, morphAnimationOpts);\n }\n becomeCombiningPath(toPath, toPathSplittedList);\n return {\n fromIndividuals: fromIndividuals,\n toIndividuals: toPathSplittedList,\n count: separateCount\n };\n}\nfunction becomeCombiningPath(path, combiningSubList) {\n if (isCombiningPath(path)) {\n updateCombiningPathSubList(path, combiningSubList);\n return;\n }\n var combiningPath = path;\n updateCombiningPathSubList(combiningPath, combiningSubList);\n combiningPath.__oldAddSelfToZr = path.addSelfToZr;\n combiningPath.__oldRemoveSelfFromZr = path.removeSelfFromZr;\n combiningPath.addSelfToZr = combiningAddSelfToZr;\n combiningPath.removeSelfFromZr = combiningRemoveSelfFromZr;\n combiningPath.__oldBuildPath = combiningPath.buildPath;\n combiningPath.buildPath = noop;\n combiningPath.childrenRef = combiningChildrenRef;\n}\nfunction restoreCombiningPath(path) {\n if (!isCombiningPath(path)) {\n return;\n }\n var combiningPath = path;\n updateCombiningPathSubList(combiningPath, null);\n combiningPath.addSelfToZr = combiningPath.__oldAddSelfToZr;\n combiningPath.removeSelfFromZr = combiningPath.__oldRemoveSelfFromZr;\n combiningPath.buildPath = combiningPath.__oldBuildPath;\n combiningPath.childrenRef =\n combiningPath.__combiningSubList =\n combiningPath.__oldAddSelfToZr =\n combiningPath.__oldRemoveSelfFromZr =\n combiningPath.__oldBuildPath = null;\n}\nfunction updateCombiningPathSubList(combiningPath, combiningSubList) {\n if (combiningPath.__combiningSubList !== combiningSubList) {\n combiningPathSubListAddRemoveWithZr(combiningPath, 'removeSelfFromZr');\n combiningPath.__combiningSubList = combiningSubList;\n if (combiningSubList) {\n for (var i = 0; i < combiningSubList.length; i++) {\n combiningSubList[i].parent = combiningPath;\n }\n }\n combiningPathSubListAddRemoveWithZr(combiningPath, 'addSelfToZr');\n }\n}\nfunction combiningAddSelfToZr(zr) {\n this.__oldAddSelfToZr(zr);\n combiningPathSubListAddRemoveWithZr(this, 'addSelfToZr');\n}\nfunction combiningPathSubListAddRemoveWithZr(path, method) {\n var combiningSubList = path.__combiningSubList;\n var zr = path.__zr;\n if (combiningSubList && zr) {\n for (var i = 0; i < combiningSubList.length; i++) {\n var child = combiningSubList[i];\n child[method](zr);\n }\n }\n}\nfunction combiningRemoveSelfFromZr(zr) {\n this.__oldRemoveSelfFromZr(zr);\n var combiningSubList = this.__combiningSubList;\n for (var i = 0; i < combiningSubList.length; i++) {\n var child = combiningSubList[i];\n child.removeSelfFromZr(zr);\n }\n}\nfunction combiningChildrenRef() {\n return this.__combiningSubList;\n}\nexport function separate(fromPath, toPathList, animationOpts, copyPropsIfDivided) {\n var toPathListLen = toPathList.length;\n var fromPathList;\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\n var copyProps = false;\n if (isCombiningPath(fromPath)) {\n var fromCombiningSubList = fromPath.__combiningSubList;\n if (fromCombiningSubList.length === toPathListLen) {\n fromPathList = fromCombiningSubList;\n }\n else {\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\n copyProps = true;\n }\n }\n else {\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\n copyProps = true;\n }\n assert(fromPathList.length === toPathListLen);\n for (var i = 0; i < toPathListLen; i++) {\n if (copyProps && copyPropsIfDivided) {\n copyPropsIfDivided(fromPath, fromPathList[i], false);\n }\n morphPath(fromPathList[i], toPathList[i], animationOpts);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toPathList,\n count: toPathListLen\n };\n}\nfunction divideShape(path, separateCount, dividingMethod) {\n return dividingMethod === 'duplicate'\n ? duplicateShape(path, separateCount)\n : splitShape(path, separateCount);\n}\nfunction splitShape(path, separateCount) {\n var resultPaths = [];\n if (separateCount <= 0) {\n return resultPaths;\n }\n if (separateCount === 1) {\n return duplicateShape(path, separateCount);\n }\n if (path instanceof Rect) {\n var toPathShape = path.shape;\n var splitPropIdx = toPathShape.height > toPathShape.width ? 1 : 0;\n var propWH = PROP_WH[splitPropIdx];\n var propXY = PROP_XY[splitPropIdx];\n var subWH = toPathShape[propWH] / separateCount;\n var xyCurr = toPathShape[propXY];\n for (var i = 0; i < separateCount; i++, xyCurr += subWH) {\n var subShape = {\n x: toPathShape.x,\n y: toPathShape.y,\n width: toPathShape.width,\n height: toPathShape.height\n };\n subShape[propXY] = xyCurr;\n subShape[propWH] = i < separateCount - 1\n ? subWH\n : toPathShape[propXY] + toPathShape[propWH] - xyCurr;\n var splitted = new Rect({ shape: subShape });\n resultPaths.push(splitted);\n }\n }\n else if (path instanceof Sector) {\n var toPathShape = path.shape;\n var clockwise = toPathShape.clockwise;\n var startAngle = toPathShape.startAngle;\n var endAngle = toPathShape.endAngle;\n var endAngleNormalized = normalizeRadian(startAngle, toPathShape.endAngle, clockwise);\n var step = (endAngleNormalized - startAngle) / separateCount;\n var angleCurr = startAngle;\n for (var i = 0; i < separateCount; i++, angleCurr += step) {\n var splitted = new Sector({\n shape: {\n cx: toPathShape.cx,\n cy: toPathShape.cy,\n r: toPathShape.r,\n r0: toPathShape.r0,\n clockwise: clockwise,\n startAngle: angleCurr,\n endAngle: i === separateCount - 1 ? endAngle : angleCurr + step\n }\n });\n resultPaths.push(splitted);\n }\n }\n else {\n return duplicateShape(path, separateCount);\n }\n return resultPaths;\n}\nfunction duplicateShape(path, separateCount) {\n var resultPaths = [];\n if (separateCount <= 0) {\n return resultPaths;\n }\n var ctor = path.constructor;\n for (var i = 0; i < separateCount; i++) {\n var sub = new ctor({\n shape: clone(path.shape)\n });\n resultPaths.push(sub);\n }\n return resultPaths;\n}\nfunction normalizeRadian(start, end, clockwise) {\n return end + PI2 * (Math[clockwise ? 'ceil' : 'floor']((start - end) / PI2));\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, keys, isArrayLike, bind, isFunction, eqNaN, indexOf, clone } from 'zrender/lib/core/util';\nimport * as graphicUtil from '../../util/graphic';\nimport { setDefaultStateProxy, enableHoverEmphasis } from '../../util/states';\nimport * as labelStyleHelper from '../../label/labelStyle';\nimport { getDefaultLabel } from '../helper/labelHelper';\nimport createListFromArray from '../helper/createListFromArray';\nimport { getLayoutOnAxis } from '../../layout/barGrid';\nimport DataDiffer from '../../data/DataDiffer';\nimport SeriesModel from '../../model/Series';\nimport ChartView from '../../view/Chart';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom';\nimport prepareGeo from '../../coord/geo/prepareCustom';\nimport prepareSingleAxis from '../../coord/single/prepareCustom';\nimport preparePolar from '../../coord/polar/prepareCustom';\nimport prepareCalendar from '../../coord/calendar/prepareCustom';\nimport { makeInner, normalizeToArray } from '../../util/model';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat';\nimport Transformable from 'zrender/lib/core/Transformable';\nimport { cloneValue } from 'zrender/lib/animation/Animator';\nimport { warn, throwError } from '../../util/log';\nimport { combine, isInAnyMorphing, morphPath, isCombiningPath, separate } from 'zrender/lib/tool/morphPath';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\nvar inner = makeInner();\nvar TRANSFORM_PROPS = {\n x: 1,\n y: 1,\n scaleX: 1,\n scaleY: 1,\n originX: 1,\n originY: 1,\n rotation: 1\n};\nvar transformPropNamesStr = keys(TRANSFORM_PROPS).join(', ');\n; // Also compat with ec4, where\n// `visual('color') visual('borderColor')` is supported.\n\nvar STYLE_VISUAL_TYPE = {\n color: 'fill',\n borderColor: 'stroke'\n};\nvar NON_STYLE_VISUAL_PROPS = {\n symbol: 1,\n symbolSize: 1,\n symbolKeepAspect: 1,\n legendSymbol: 1,\n visualMeta: 1,\n liftZ: 1,\n decal: 1\n};\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n}; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\nvar LEGACY_TRANSFORM_PROPS = {\n position: ['x', 'y'],\n scale: ['scaleX', 'scaleY'],\n origin: ['originX', 'originY']\n};\nvar tmpTransformable = new Transformable();\n/**\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n * @return {Object} {coordSys: {...}, api: {\n * coord: function (data, clamp) {}, // return point in global.\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n * }}\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n singleAxis: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\n\nvar CustomSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CustomSeriesModel, _super);\n\n function CustomSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomSeriesModel.type;\n return _this;\n }\n\n CustomSeriesModel.prototype.optionUpdated = function () {\n this.currentZLevel = this.get('zlevel', true);\n this.currentZ = this.get('z', true);\n };\n\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n };\n\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n el && (params.info = inner(el).info);\n return params;\n };\n\n CustomSeriesModel.type = 'series.custom';\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n CustomSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Custom series will not clip by default.\n // Some case will use custom series to draw label\n // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\n clip: false // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n\n };\n return CustomSeriesModel;\n}(SeriesModel);\n\nvar CustomSeriesView =\n/** @class */\nfunction (_super) {\n __extends(CustomSeriesView, _super);\n\n function CustomSeriesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomSeriesView.type;\n return _this;\n }\n\n CustomSeriesView.prototype.render = function (customSeries, ecModel, api, payload) {\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api); // By default, merge mode is applied. In most cases, custom series is\n // used in the scenario that data amount is not large but graphic elements\n // is complicated, where merge mode is probably necessary for optimization.\n // For example, reuse graphic elements and only update the transform when\n // roam or data zoom according to `actionType`.\n\n var transOpt = customSeries.__transientTransitionOpt; // Enable user to disable transition animation by both set\n // `from` and `to` dimension as `null`/`undefined`.\n\n if (transOpt && (transOpt.from == null || transOpt.to == null)) {\n oldData && oldData.each(function (oldIdx) {\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\n });\n data.each(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\n });\n } else {\n var morphPreparation_1 = new MorphPreparation(customSeries, transOpt);\n var diffMode = transOpt ? 'multiple' : 'oneToOne';\n new DataDiffer(oldData ? oldData.getIndices() : [], data.getIndices(), createGetKey(oldData, diffMode, transOpt && transOpt.from), createGetKey(data, diffMode, transOpt && transOpt.to), null, diffMode).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\n }).remove(function (oldIdx) {\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\n }).update(function (newIdx, oldIdx) {\n morphPreparation_1.reset('oneToOne');\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n morphPreparation_1.findAndAddFrom(oldEl); // PENDING:\n // if may morph, currently we alway recreate the whole el.\n // because if reuse some of the el in the group tree, the old el has to\n // be removed from the group, and consequently we can not calculate\n // the \"global transition\" of the old element.\n // But is there performance issue?\n\n if (morphPreparation_1.hasFrom()) {\n removeElementDirectly(oldEl, group);\n oldEl = null;\n }\n\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\n morphPreparation_1.applyMorphing();\n }).updateManyToOne(function (newIdx, oldIndices) {\n morphPreparation_1.reset('manyToOne');\n\n for (var i = 0; i < oldIndices.length; i++) {\n var oldEl = oldData.getItemGraphicEl(oldIndices[i]);\n morphPreparation_1.findAndAddFrom(oldEl);\n removeElementDirectly(oldEl, group);\n }\n\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\n morphPreparation_1.applyMorphing();\n }).updateOneToMany(function (newIndices, oldIdx) {\n morphPreparation_1.reset('oneToMany');\n var newLen = newIndices.length;\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n morphPreparation_1.findAndAddFrom(oldEl);\n removeElementDirectly(oldEl, group);\n\n for (var i = 0; i < newLen; i++) {\n createOrUpdateItem(api, null, newIndices[i], renderItem(newIndices[i], payload), customSeries, group, data, morphPreparation_1);\n }\n\n morphPreparation_1.applyMorphing();\n }).execute();\n } // Do clipping\n\n\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n\n this._data = data;\n };\n\n CustomSeriesView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n\n CustomSeriesView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data, null);\n el.traverse(setIncrementalAndHoverLayer);\n }\n };\n\n CustomSeriesView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that triggerd by its descendents.\n\n\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n };\n\n CustomSeriesView.type = 'custom';\n return CustomSeriesView;\n}(ChartView);\n\nfunction createGetKey(data, diffMode, dimension) {\n if (!data) {\n return;\n }\n\n if (diffMode === 'oneToOne') {\n return function (rawIdx, dataIndex) {\n return data.getId(dataIndex);\n };\n }\n\n var diffByDimName = data.getDimension(dimension);\n var dimInfo = data.getDimensionInfo(diffByDimName);\n\n if (!dimInfo) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = dimension + \" is not a valid dimension.\";\n }\n\n throwError(errMsg);\n }\n\n var ordinalMeta = dimInfo.ordinalMeta;\n return function (rawIdx, dataIndex) {\n var key = data.get(diffByDimName, dataIndex);\n\n if (ordinalMeta) {\n key = ordinalMeta.categories[key];\n }\n\n return key == null || eqNaN(key) ? rawIdx + '' : '_ec_' + key;\n };\n}\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el; // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n inner(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n inner(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({}); // inner(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n\n if (!Clz) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n\n throwError(errMsg);\n }\n\n el = new Clz();\n }\n\n inner(el).customGraphicType = graphicType;\n el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\n/**\n * ----------------------------------------------------------\n * [STRATEGY_MERGE] Merge properties or erase all properties:\n *\n * Based on the fact that the existing zr element probably be reused, we now consider whether\n * merge or erase all properties to the exsiting elements.\n * That is, if a certain props is not specified in the lastest return of `renderItem`:\n * + \"Merge\" means that do not modify the value on the existing element.\n * + \"Erase all\" means that use a default value to the existing element.\n *\n * \"Merge\" might bring some unexpected state retaining for users and \"erase all\" seams to be\n * more safe. \"erase all\" force users to specify all of the props each time, which is recommanded\n * in most cases.\n * But \"erase all\" theoretically disables the chance of performance optimization (e.g., just\n * generete shape and style at the first time rather than always do that).\n * So we still use \"merge\" rather than \"erase all\". If users need \"erase all\", they can\n * simple always set all of the props each time.\n * Some \"object-like\" config like `textConfig`, `textContent`, `style` which are not needed for\n * every elment, so we replace them only when user specify them. And the that is a total replace.\n *\n * TODO: there is no hint of 'isFirst' to users. So the performance enhancement can not be\n * performed yet. Consider the case:\n * (1) setOption to \"mergeChildren\" with a smaller children count\n * (2) Use dataZoom to make an item disappear.\n * (3) User dataZoom to make the item display again. At that time, renderItem need to return the\n * full option rather than partial option to recreate the element.\n *\n * ----------------------------------------------\n * [STRATEGY_NULL] `hasOwnProperty` or `== null`:\n *\n * Ditinguishing \"own property\" probably bring little trouble to user when make el options.\n * So we trade a {xx: null} or {xx: undefined} as \"not specified\" if possible rather than\n * \"set them to null/undefined\". In most cases, props can not be cleared. Some typicall\n * clearable props like `style`/`textConfig`/`textContent` we enable `false` to means\n * \"clear\". In some othere special cases that the prop is able to set as null/undefined,\n * but not suitable to use `false`, `hasOwnProperty` is checked.\n *\n * ---------------------------------------------\n * [STRATEGY_TRANSITION] The rule of transition:\n * + For props on the root level of a element:\n * If there is no `transition` specified, tansform props will be transitioned by default,\n * which is the same as the previous setting in echarts4 and suitable for the scenario\n * of dataZoom change.\n * If `transition` specified, only the specified props will be transitioned.\n * + For props in `shape` and `style`:\n * Only props specified in `transition` will be transitioned.\n * + Break:\n * Since ec5, do not make transition to shape by default, because it might result in\n * performance issue (especially `points` of polygon) and do not necessary in most cases.\n *\n * @return if `isMorphTo`, return `allPropsFinal`.\n */\n\n\nfunction updateElNormal( // Can be null/undefined\napi, el, // Whether be a morph target.\nisMorphTo, dataIndex, elOption, styleOpt, attachedTxInfo, seriesModel, isInit, isTextContent) {\n var transFromProps = {};\n var allPropsFinal = {};\n var elDisplayable = el.isGroup ? null : el; // If be \"morph to\", delay the `updateElNormal` when all of the els in\n // this data item processed. Because at that time we can get all of the\n // \"morph from\" and make correct separate/combine.\n\n !isMorphTo && prepareShapeOrExtraTransitionFrom('shape', el, null, elOption, transFromProps, isInit);\n prepareShapeOrExtraAllPropsFinal('shape', elOption, allPropsFinal);\n !isMorphTo && prepareShapeOrExtraTransitionFrom('extra', el, null, elOption, transFromProps, isInit);\n prepareShapeOrExtraAllPropsFinal('extra', elOption, allPropsFinal);\n !isMorphTo && prepareTransformTransitionFrom(el, null, elOption, transFromProps, isInit);\n prepareTransformAllPropsFinal(elOption, allPropsFinal);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n }\n\n if (el.type === 'text' && styleOpt) {\n var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n\n if (styleOpt) {\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n } // Always overwrite in case user specify this prop.\n\n\n styleOpt.__decalPattern = decalPattern;\n }\n\n !isMorphTo && prepareStyleTransitionFrom(el, null, elOption, styleOpt, transFromProps, isInit);\n\n if (elDisplayable) {\n hasOwn(elOption, 'invisible') && (elDisplayable.invisible = elOption.invisible);\n } // If `isMorphTo`, we should not update these props to el directly, otherwise,\n // when applying morph finally, the original prop are missing for making \"animation from\".\n\n\n if (!isMorphTo) {\n applyPropsFinal(el, allPropsFinal, styleOpt);\n applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit);\n } // Merge by default.\n\n\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\n\n if (!isTextContent) {\n // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n hasOwn(elOption, 'info') && (inner(el).info = elOption.info);\n }\n\n styleOpt ? el.dirty() : el.markRedraw();\n return isMorphTo ? allPropsFinal : null;\n}\n\nfunction applyPropsFinal(el, // Can be null/undefined\nallPropsFinal, styleOpt) {\n var elDisplayable = el.isGroup ? null : el;\n\n if (elDisplayable && styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n var originalDecalObj = void 0;\n\n if (decalPattern) {\n originalDecalObj = styleOpt.decal;\n styleOpt.decal = decalPattern;\n } // PENDING: here the input style object is used directly.\n // Good for performance but bad for compatibility control.\n\n\n elDisplayable.useStyle(styleOpt);\n\n if (decalPattern) {\n styleOpt.decal = originalDecalObj;\n } // When style object changed, how to trade the existing animation?\n // It is probably conplicated and not needed to cover all the cases.\n // But still need consider the case:\n // (1) When using init animation on `style.opacity`, and before the animation\n // ended users triggers an update by mousewhell. At that time the init\n // animation should better be continued rather than terminated.\n // So after `useStyle` called, we should change the animation target manually\n // to continue the effect of the init animation.\n // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\n // to update the value to `val2` and no animation declared, should be terminate\n // the previous animation or just modify the target of the animation?\n // Therotically That will happen not only on `style` but also on `shape` and\n // `transfrom` props. But we haven't handle this case at present yet.\n // (3) PENDING: Is it proper to visit `animators` and `targetName`?\n\n\n var animators = elDisplayable.animators;\n\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i]; // targetName is the \"topKey\".\n\n if (animator.targetName === 'style') {\n animator.changeTarget(elDisplayable.style);\n }\n }\n } // Set el to the final state firstly.\n\n\n allPropsFinal && el.attr(allPropsFinal);\n}\n\nfunction applyTransitionFrom(el, dataIndex, elOption, seriesModel, // Can be null/undefined\ntransFromProps, isInit) {\n if (transFromProps) {\n // Do not use `el.updateDuringAnimation` here becuase `el.updateDuringAnimation` will\n // be called mutiple time in each animation frame. For example, if both \"transform\" props\n // and shape props and style props changed, it will generate three animator and called\n // one-by-one in each animation frame.\n // We use the during in `animateTo/From` params.\n var userDuring = elOption.during; // For simplicity, if during not specified, the previous during will not work any more.\n\n inner(el).userDuring = userDuring;\n var cfgDuringCall = userDuring ? bind(duringCall, {\n el: el,\n userDuring: userDuring\n }) : null;\n var cfg = {\n dataIndex: dataIndex,\n isFrom: true,\n during: cfgDuringCall\n };\n isInit ? graphicUtil.initProps(el, transFromProps, seriesModel, cfg) : graphicUtil.updateProps(el, transFromProps, seriesModel, cfg);\n }\n} // See [STRATEGY_TRANSITION]\n\n\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, el, morphFromEl, elOption, transFromProps, isInit) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var elPropsInAttr = el[mainAttr];\n var transFromPropsInAttr;\n var enterFrom = attrOpt.enterFrom;\n\n if (isInit && enterFrom) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var enterFromKeys = keys(enterFrom);\n\n for (var i = 0; i < enterFromKeys.length; i++) {\n // `enterFrom` props are not necessarily also declared in `shape`/`style`/...,\n // for example, `opacity` can only declared in `enterFrom` but not in `style`.\n var key = enterFromKeys[i]; // Do not clone, animator will perform that clone.\n\n transFromPropsInAttr[key] = enterFrom[key];\n }\n }\n\n if (!isInit && elPropsInAttr // Just ignore shape animation in morphing.\n && !(morphFromEl != null && mainAttr === 'shape')) {\n if (attrOpt.transition) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var transitionKeys = normalizeToArray(attrOpt.transition);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = elPropsInAttr[key];\n\n if (process.env.NODE_ENV !== 'production') {\n checkNonStyleTansitionRefer(key, attrOpt[key], elVal);\n } // Do not clone, see `checkNonStyleTansitionRefer`.\n\n\n transFromPropsInAttr[key] = elVal;\n }\n } else if (indexOf(elOption.transition, mainAttr) >= 0) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var elPropsInAttrKeys = keys(elPropsInAttr);\n\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\n var key = elPropsInAttrKeys[i];\n var elVal = elPropsInAttr[key];\n\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\n transFromPropsInAttr[key] = elVal;\n }\n }\n }\n }\n\n var leaveTo = attrOpt.leaveTo;\n\n if (leaveTo) {\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\n var leaveToPropsInAttr = leaveToProps[mainAttr] || (leaveToProps[mainAttr] = {});\n var leaveToKeys = keys(leaveTo);\n\n for (var i = 0; i < leaveToKeys.length; i++) {\n var key = leaveToKeys[i];\n leaveToPropsInAttr[key] = leaveTo[key];\n }\n }\n}\n\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var allPropsInAttr = allProps[mainAttr] = {};\n var keysInAttr = keys(attrOpt);\n\n for (var i = 0; i < keysInAttr.length; i++) {\n var key = keysInAttr[i]; // To avoid share one object with different element, and\n // to avoid user modify the object inexpectedly, have to clone.\n\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\n }\n} // See [STRATEGY_TRANSITION].\n\n\nfunction prepareTransformTransitionFrom(el, morphFromEl, elOption, transFromProps, isInit) {\n var enterFrom = elOption.enterFrom;\n\n if (isInit && enterFrom) {\n var enterFromKeys = keys(enterFrom);\n\n for (var i = 0; i < enterFromKeys.length; i++) {\n var key = enterFromKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.enterFrom');\n } // Do not clone, animator will perform that clone.\n\n\n transFromProps[key] = enterFrom[key];\n }\n }\n\n if (!isInit) {\n // If morphing, force transition all transform props.\n // otherwise might have incorrect morphing animation.\n if (morphFromEl) {\n var fromTransformable = calcOldElLocalTransformBasedOnNewElParent(morphFromEl, el);\n setTransformPropToTransitionFrom(transFromProps, 'x', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'y', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'scaleX', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'scaleY', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'originX', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'originY', fromTransformable);\n setTransformPropToTransitionFrom(transFromProps, 'rotation', fromTransformable);\n } else if (elOption.transition) {\n var transitionKeys = normalizeToArray(elOption.transition);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n\n if (key === 'style' || key === 'shape' || key === 'extra') {\n continue;\n }\n\n var elVal = el[key];\n\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.transition');\n checkNonStyleTansitionRefer(key, elOption[key], elVal);\n } // Do not clone, see `checkNonStyleTansitionRefer`.\n\n\n transFromProps[key] = elVal;\n }\n } // This default transition see [STRATEGY_TRANSITION]\n else {\n setTransformPropToTransitionFrom(transFromProps, 'x', el);\n setTransformPropToTransitionFrom(transFromProps, 'y', el);\n }\n }\n\n var leaveTo = elOption.leaveTo;\n\n if (leaveTo) {\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\n var leaveToKeys = keys(leaveTo);\n\n for (var i = 0; i < leaveToKeys.length; i++) {\n var key = leaveToKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.leaveTo');\n }\n\n leaveToProps[key] = leaveTo[key];\n }\n }\n}\n\nfunction prepareTransformAllPropsFinal(elOption, allProps) {\n setLagecyTransformProp(elOption, allProps, 'position');\n setLagecyTransformProp(elOption, allProps, 'scale');\n setLagecyTransformProp(elOption, allProps, 'origin');\n setTransformProp(elOption, allProps, 'x');\n setTransformProp(elOption, allProps, 'y');\n setTransformProp(elOption, allProps, 'scaleX');\n setTransformProp(elOption, allProps, 'scaleY');\n setTransformProp(elOption, allProps, 'originX');\n setTransformProp(elOption, allProps, 'originY');\n setTransformProp(elOption, allProps, 'rotation');\n} // See [STRATEGY_TRANSITION].\n\n\nfunction prepareStyleTransitionFrom(el, morphFromEl, elOption, styleOpt, transFromProps, isInit) {\n if (!styleOpt) {\n return;\n } // At present in \"many-to-one\"/\"one-to-many\" case, to not support \"many\" have\n // different styles and make style transitions. That might be a rare case.\n\n\n var fromEl = morphFromEl || el;\n var fromElStyle = fromEl.style;\n var transFromStyleProps;\n var enterFrom = styleOpt.enterFrom;\n\n if (isInit && enterFrom) {\n var enterFromKeys = keys(enterFrom);\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n\n for (var i = 0; i < enterFromKeys.length; i++) {\n var key = enterFromKeys[i]; // Do not clone, animator will perform that clone.\n\n transFromStyleProps[key] = enterFrom[key];\n }\n }\n\n if (!isInit && fromElStyle) {\n if (styleOpt.transition) {\n var transitionKeys = normalizeToArray(styleOpt.transition);\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = fromElStyle[key]; // Do not clone, see `checkNonStyleTansitionRefer`.\n\n transFromStyleProps[key] = elVal;\n }\n } else if (el.getAnimationStyleProps && indexOf(elOption.transition, 'style') >= 0) {\n var animationProps = el.getAnimationStyleProps();\n var animationStyleProps = animationProps ? animationProps.style : null;\n\n if (animationStyleProps) {\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n var styleKeys = keys(styleOpt);\n\n for (var i = 0; i < styleKeys.length; i++) {\n var key = styleKeys[i];\n\n if (animationStyleProps[key]) {\n var elVal = fromElStyle[key];\n transFromStyleProps[key] = elVal;\n }\n }\n }\n }\n }\n\n var leaveTo = styleOpt.leaveTo;\n\n if (leaveTo) {\n var leaveToKeys = keys(leaveTo);\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\n var leaveToStyleProps = leaveToProps.style || (leaveToProps.style = {});\n\n for (var i = 0; i < leaveToKeys.length; i++) {\n var key = leaveToKeys[i];\n leaveToStyleProps[key] = leaveTo[key];\n }\n }\n}\n/**\n * If make \"transform\"(x/y/scaleX/scaleY/orient/originX/originY) transition between\n * two path elements that have different hierarchy, before we retrieve the \"from\" props,\n * we have to calculate the local transition of the \"oldPath\" based on the parent of\n * the \"newPath\".\n * At present, the case only happend in \"morphing\". Without morphing, the transform\n * transition are all between elements in the same hierarchy, where this kind of process\n * is not needed.\n *\n * [CAVEAT]:\n * This method makes sense only if: (very tricky)\n * (1) \"newEl\" has been added to its final parent.\n * (2) Local transform props of \"newPath.parent\" are not at their final value but already\n * have been at the \"from value\".\n * This is currently ensured by:\n * (2.1) \"graphicUtil.animationFrom\", which will set the element to the \"from value\"\n * immediately.\n * (2.2) \"morph\" option is not allowed to be set on Group, so all of the groups have\n * been finished their \"updateElNormal\" when calling this method in morphing process.\n */\n\n\nfunction calcOldElLocalTransformBasedOnNewElParent(oldEl, newEl) {\n if (!oldEl || oldEl === newEl || oldEl.parent === newEl.parent) {\n return oldEl;\n } // Not sure oldEl is rendered (may have \"lazyUpdate\"),\n // so always call `getComputedTransform`.\n\n\n var tmpM = tmpTransformable.transform || (tmpTransformable.transform = matrix.identity([]));\n var oldGlobalTransform = oldEl.getComputedTransform();\n oldGlobalTransform ? matrix.copy(tmpM, oldGlobalTransform) : matrix.identity(tmpM);\n var newParent = newEl.parent;\n\n if (newParent) {\n newParent.getComputedTransform();\n }\n\n tmpTransformable.originX = oldEl.originX;\n tmpTransformable.originY = oldEl.originY;\n tmpTransformable.parent = newParent;\n tmpTransformable.decomposeTransform();\n return tmpTransformable;\n}\n\nvar checkNonStyleTansitionRefer;\n\nif (process.env.NODE_ENV !== 'production') {\n checkNonStyleTansitionRefer = function (propName, optVal, elVal) {\n if (!isArrayLike(optVal)) {\n assert(optVal != null && isFinite(optVal), 'Prop `' + propName + '` must refer to a finite number or ArrayLike for transition.');\n } else {\n // Try not to copy array for performance, but if user use the same object in different\n // call of `renderItem`, it will casue animation transition fail.\n assert(optVal !== elVal, 'Prop `' + propName + '` must use different Array object each time for transition.');\n }\n };\n}\n\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\n // The same as `checkNonStyleTansitionRefer`.\n return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;\n}\n\nvar checkTransformPropRefer;\n\nif (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer = function (key, usedIn) {\n assert(hasOwn(TRANSFORM_PROPS, key), 'Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS).join('`, `') + '` are permitted.');\n };\n}\n\nfunction getOrCreateLeaveToPropsFromEl(el) {\n var innerEl = inner(el);\n return innerEl.leaveToProps || (innerEl.leaveToProps = {});\n} // Use it to avoid it be exposed to user.\n\n\nvar tmpDuringScope = {};\nvar customDuringAPI = {\n // Usually other props do not need to be changed in animation during.\n setTransform: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\n }\n\n tmpDuringScope.el[key] = val;\n return this;\n },\n getTransform: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\n }\n\n return tmpDuringScope.el[key];\n },\n setShape: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var shape = tmpDuringScope.el.shape || (tmpDuringScope.el.shape = {});\n shape[key] = val;\n tmpDuringScope.isShapeDirty = true;\n return this;\n },\n getShape: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var shape = tmpDuringScope.el.shape;\n\n if (shape) {\n return shape[key];\n }\n },\n setStyle: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var style = tmpDuringScope.el.style;\n\n if (style) {\n if (process.env.NODE_ENV !== 'production') {\n if (eqNaN(val)) {\n warn('style.' + key + ' must not be assigned with NaN.');\n }\n }\n\n style[key] = val;\n tmpDuringScope.isStyleDirty = true;\n }\n\n return this;\n },\n getStyle: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var style = tmpDuringScope.el.style;\n\n if (style) {\n return style[key];\n }\n },\n setExtra: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});\n extra[key] = val;\n return this;\n },\n getExtra: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra;\n\n if (extra) {\n return extra[key];\n }\n }\n};\n\nfunction assertNotReserved(key) {\n if (process.env.NODE_ENV !== 'production') {\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\n throw new Error('key must not be \"' + key + '\"');\n }\n }\n}\n\nfunction duringCall() {\n // Do not provide \"percent\" until some requirements come.\n // Because consider thies case:\n // enterFrom: {x: 100, y: 30}, transition: 'x'.\n // And enter duration is different from update duration.\n // Thus it might be confused about the meaning of \"percent\" in during callback.\n var scope = this;\n var el = scope.el;\n\n if (!el) {\n return;\n } // If el is remove from zr by reason like legend, during still need to called,\n // becuase el will be added back to zr and the prop value should not be incorrect.\n\n\n var newstUserDuring = inner(el).userDuring;\n var scopeUserDuring = scope.userDuring; // Ensured a during is only called once in each animation frame.\n // If a during is called multiple times in one frame, maybe some users' calulation logic\n // might be wrong (not sure whether this usage exists).\n // The case of a during might be called twice can be: by default there is a animator for\n // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\n // another animators for 'style'/'shape'/'extra'.\n\n if (newstUserDuring !== scopeUserDuring) {\n // release\n scope.el = scope.userDuring = null;\n return;\n }\n\n tmpDuringScope.el = el;\n tmpDuringScope.isShapeDirty = false;\n tmpDuringScope.isStyleDirty = false; // Give no `this` to user in \"during\" calling.\n\n scopeUserDuring(customDuringAPI);\n\n if (tmpDuringScope.isShapeDirty && el.dirtyShape) {\n el.dirtyShape();\n }\n\n if (tmpDuringScope.isStyleDirty && el.dirtyStyle) {\n el.dirtyStyle();\n } // markRedraw() will be called by default in during.\n // FIXME `this.markRedraw();` directly ?\n // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\n // consider the issue that the prop might be incorrect when return to \"normal\" state.\n\n}\n\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo, isRoot, isTextContent) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation?\n\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable defaut emphasis.\n stateObj.style = styleOpt || null;\n } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n\n\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n\n setDefaultStateProxy(elDisplayable);\n }\n}\n\nfunction updateZ(el, elOption, seriesModel, attachedTxInfo) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel; // Always erase.\n\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur.\n\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\n\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\n\nfunction setLagecyTransformProp(elOption, targetProps, legacyName, fromTransformable // If provided, retrieve from the element.\n) {\n var legacyArr = elOption[legacyName];\n var xyName = LEGACY_TRANSFORM_PROPS[legacyName];\n\n if (legacyArr) {\n if (fromTransformable) {\n targetProps[xyName[0]] = fromTransformable[xyName[0]];\n targetProps[xyName[1]] = fromTransformable[xyName[1]];\n } else {\n targetProps[xyName[0]] = legacyArr[0];\n targetProps[xyName[1]] = legacyArr[1];\n }\n }\n}\n\nfunction setTransformProp(elOption, allProps, name, fromTransformable // If provided, retrieve from the element.\n) {\n if (elOption[name] != null) {\n allProps[name] = fromTransformable ? fromTransformable[name] : elOption[name];\n }\n}\n\nfunction setTransformPropToTransitionFrom(transitionFrom, name, fromTransformable // If provided, retrieve from the element.\n) {\n if (fromTransformable) {\n transitionFrom[name] = fromTransformable[name];\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n } // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n\n\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.get(data.getDimension(dim || 0), dataIndexInside);\n }\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var dimInfo = data.getDimensionInfo(dim || 0);\n\n if (!dimInfo) {\n return;\n }\n\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\n * @deprecated The orgininal intention of `api.style` is enable to set itemStyle\n * like other series. But it not necessary and not easy to give a strict definition\n * of what it return. And since echarts5 it needs to be make compat work. So\n * deprecates it since echarts5.\n *\n * By default, `visual` is applied to style (to support visualMap).\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n * it can be implemented as:\n * `api.style({stroke: api.visual('color'), fill: null})`;\n *\n * [Compat]: since ec5, RectText has been separated from its hosts el.\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\n * any more. But `series.label` config is never published in doc.\n * We still compat it in `api.style()`. But not encourage to use it and will still not\n * to pulish it to doc.\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feture of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\n * @deprecated The reason see `api.style()`\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n } // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n\n\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\n * @public\n * @return If not support, return undefined.\n */\n\n\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\n * @public\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\n * @public\n * @return font string\n */\n\n\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName, dataDimIndex) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdateItem(api, el, dataIndex, elOption, seriesModel, group, data, morphPreparation) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n removeElementDirectly(el, group);\n return;\n }\n\n el = doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, true, morphPreparation);\n el && data.setItemGraphicEl(dataIndex, el);\n enableHoverEmphasis(el, elOption.focus, elOption.blurScope);\n return el;\n}\n\nfunction doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, isRoot, morphPreparation) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n\n var toBeReplacedIdx = -1;\n\n if (el && doesElNeedRecreate(el, elOption) // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphPreparation && morphPreparation.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = group.childrenRef().indexOf(el);\n el = null;\n }\n\n var elIsNewCreated = !el;\n\n if (!el) {\n el = createEl(elOption);\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n }\n\n var canMorph = inner(el).canMorph = elOption.morph && isPath(el);\n var thisElIsMorphTo = canMorph && morphPreparation && morphPreparation.hasFrom(); // Use update animation when morph is enabled.\n\n var isInit = elIsNewCreated && !thisElIsMorphTo;\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n var pendingAllPropsFinal = updateElNormal(api, el, thisElIsMorphTo, dataIndex, elOption, elOption.style, attachedTxInfoTmp, seriesModel, isInit, false);\n\n if (thisElIsMorphTo) {\n morphPreparation.addTo(el, elOption, dataIndex, pendingAllPropsFinal);\n }\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp, isRoot, false);\n }\n }\n\n updateZ(el, elOption, seriesModel, attachedTxInfoTmp);\n\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation);\n }\n\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n\n return el;\n} // `el` must not be null/undefined.\n\n\nfunction doesElNeedRecreate(el, elOption) {\n var elInner = inner(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (// If `elOptionType` is `null`, follow the merge principle.\n elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {\n clipPath = null;\n }\n\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(clipPath instanceof graphicUtil.Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n\n el.setClipPath(clipPath);\n }\n\n updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);\n } // If not define `clipPath` in option, do nothing unnecessary.\n\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // group do not support textContent temporarily untill necessary.\n if (el.isGroup) {\n return;\n } // Normal must be called before emphasis, for `isLegacy` detection.\n\n\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sence.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n updateElNormal(null, textContent, null, dataIndex, txConOptNormal, txConStlOptNormal, null, seriesModel, isInit, true);\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null, false, true);\n }\n }\n\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\n\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n\n if (styleOpt && ( // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorret type for forward compat.\n txConOptNormal_1.type !== 'text' && assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\n\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\n\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n\n return style;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates that\n// the existing children will not be removed, and enables the feature that\n// update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will happen.\n//\n// For implementation simpleness, do not provide a direct way to remove sinlge\n// child (otherwise the total indicies of the children array have to be modified).\n// User can remove a single child by set its `ignore` as `true`.\n\n\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el,\n morphPreparation: morphPreparation\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el, false, morphPreparation);\n }\n\n for (var i = el.childCount() - 1; i >= index; i--) {\n // Do not supprot leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to contorl all of the elements.\n doRemoveEl(el.childAt(i), seriesModel, el);\n }\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group, false, context.morphPreparation);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n doRemoveEl(child, context.seriesModel, context.group);\n}\n\nfunction doRemoveEl(el, seriesModel, group) {\n if (el) {\n var leaveToProps = inner(el).leaveToProps;\n leaveToProps ? graphicUtil.updateProps(el, leaveToProps, seriesModel, {\n cb: function () {\n group.remove(el);\n }\n }) : group.remove(el);\n }\n}\n/**\n * @return SVG Path data.\n */\n\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\n}\n\nfunction isPath(el) {\n return el && el instanceof graphicUtil.Path;\n}\n\nfunction removeElementDirectly(el, group) {\n el && group.remove(el);\n}\n/**\n * Any morph-potential el should added by `morphPreparation.addTo(el)`.\n * And they may apply morph or not when `morphPreparation.applyMorphing()`.\n * But at least, all of the \"to\" elements will apply all of the updates\n * as `doCreateOrUpdateItem` did.\n */\n\n\nvar MorphPreparation =\n/** @class */\nfunction () {\n function MorphPreparation(seriesModel, transOpt) {\n this._fromList = [];\n this._toList = [];\n this._toElOptionList = [];\n this._allPropsFinalList = [];\n this._toDataIndices = []; // Key: `toDataIndex`, not `toIdx`\n\n this._morphConfigList = [];\n this._seriesModel = seriesModel;\n this._transOpt = transOpt;\n }\n\n MorphPreparation.prototype.hasFrom = function () {\n return !!this._fromList.length;\n }; // isOneToOneFrom(el: Element): boolean {\n // if (el && inner(el).canMorph) {\n // const fromList = this._fromList;\n // for (let i = 0; i < fromList.length; i++) {\n // if (fromList[i] === el) {\n // return true;\n // }\n // }\n // }\n // }\n\n\n MorphPreparation.prototype.findAndAddFrom = function (el) {\n if (!el) {\n return;\n }\n\n if (inner(el).canMorph) {\n this._fromList.push(el);\n }\n\n if (el.isGroup) {\n var children = el.childrenRef();\n\n for (var i = 0; i < children.length; i++) {\n this.findAndAddFrom(children[i]);\n }\n }\n };\n\n MorphPreparation.prototype.addTo = function (path, elOption, dataIndex, allPropsFinal) {\n if (path) {\n this._toList.push(path);\n\n this._toElOptionList.push(elOption);\n\n this._toDataIndices.push(dataIndex);\n\n this._allPropsFinalList.push(allPropsFinal);\n }\n };\n\n MorphPreparation.prototype.applyMorphing = function () {\n // [MORPHING_LOGIC_HINT]\n // Pay attention to the order:\n // (A) Apply `allPropsFinal` and `styleOption` to \"to\".\n // (Then \"to\" becomes to the final state.)\n // (B) Apply `morphPath`/`combine`/`separate`.\n // (Based on the current state of \"from\" and the final state of \"to\".)\n // (Then we may get \"from.subList\" or \"to.subList\".)\n // (C) Copy the related props from \"from\" to \"from.subList\", from \"to\" to \"to.subList\".\n // (D) Collect `transitionFromProps` for \"to\" and \"to.subList\"\n // (Based on \"from\" or \"from.subList\".)\n // (E) Apply `transitionFromProps` to \"to\" and \"to.subList\"\n // (It might change the prop values to the first frame value.)\n // Case_I:\n // If (D) should be after (C), we use sequence: A - B - C - D - E\n // Case_II:\n // If (A) should be after (D), we use sequence: D - A - B - C - E\n // [MORPHING_LOGIC_HINT]\n // zrender `morphPath`/`combine`/`separate` only manages the shape animation.\n // Other props (like transfrom, style transition) will handled in echarts).\n // [MORPHING_LOGIC_HINT]\n // Make sure `applyPropsFinal` always be called for \"to\".\n var type = this._type;\n var fromList = this._fromList;\n var toList = this._toList;\n var toListLen = toList.length;\n var fromListLen = fromList.length;\n\n if (!fromListLen || !toListLen) {\n return;\n }\n\n if (type === 'oneToOne') {\n // In one-to-one case, we by default apply a simple rule:\n // map \"from\" and \"to\" one by one.\n // For this case: old_data_item_el and new_data_item_el\n // has the same hierarchy of group tree but only some path type changed.\n for (var toIdx = 0; toIdx < toListLen; toIdx++) {\n this._oneToOneForSingleTo(toIdx, toIdx);\n }\n } else if (type === 'manyToOne') {\n // A rough strategy: if there are more than one \"to\", we simply divide \"fromList\" equally.\n var fromSingleSegLen = Math.max(1, Math.floor(fromListLen / toListLen));\n\n for (var toIdx = 0, fromIdxStart = 0; toIdx < toListLen; toIdx++, fromIdxStart += fromSingleSegLen) {\n var fromCount = toIdx + 1 >= toListLen ? fromListLen - fromIdxStart : fromSingleSegLen;\n\n this._manyToOneForSingleTo(toIdx, fromIdxStart >= fromListLen ? null : fromIdxStart, fromCount);\n }\n } else if (type === 'oneToMany') {\n // A rough strategy: if there are more than one \"from\", we simply divide \"toList\" equally.\n var toSingleSegLen = Math.max(1, Math.floor(toListLen / fromListLen));\n\n for (var toIdxStart = 0, fromIdx = 0; toIdxStart < toListLen; toIdxStart += toSingleSegLen, fromIdx++) {\n var toCount = toIdxStart + toSingleSegLen >= toListLen ? toListLen - toIdxStart : toSingleSegLen;\n\n this._oneToManyForSingleFrom(toIdxStart, toCount, fromIdx >= fromListLen ? null : fromIdx);\n }\n }\n };\n\n MorphPreparation.prototype._oneToOneForSingleTo = function ( // \"to\" must NOT be null/undefined.\n toIdx, // May `fromIdx >= this._fromList.length`\n fromIdx) {\n var to = this._toList[toIdx];\n var toElOption = this._toElOptionList[toIdx];\n var toDataIndex = this._toDataIndices[toIdx];\n var allPropsFinal = this._allPropsFinalList[toIdx];\n var from = this._fromList[fromIdx];\n\n var elAnimationConfig = this._getOrCreateMorphConfig(toDataIndex);\n\n var morphDuration = elAnimationConfig.duration;\n\n if (from && isCombiningPath(from)) {\n applyPropsFinal(to, allPropsFinal, toElOption.style);\n\n if (morphDuration) {\n var combineResult = combine([from], to, elAnimationConfig, copyPropsWhenDivided);\n\n this._processResultIndividuals(combineResult, toIdx, null);\n } // The target el will not be displayed and transition from multiple path.\n // transition on the target el does not make sense.\n\n } else {\n var morphFrom = morphDuration // from === to usually happen in scenarios where internal update like\n // \"dataZoom\", \"legendToggle\" happen. If from is not in any morphing,\n // we do not need to call `morphPath`.\n && from && (from !== to || isInAnyMorphing(from)) ? from : null; // See [Case_II] above.\n // In this case, there is probably `from === to`. And the `transitionFromProps` collecting\n // does not depends on morphing. So we collect `transitionFromProps` first.\n\n var transFromProps = {};\n prepareShapeOrExtraTransitionFrom('shape', to, morphFrom, toElOption, transFromProps, false);\n prepareShapeOrExtraTransitionFrom('extra', to, morphFrom, toElOption, transFromProps, false);\n prepareTransformTransitionFrom(to, morphFrom, toElOption, transFromProps, false);\n prepareStyleTransitionFrom(to, morphFrom, toElOption, toElOption.style, transFromProps, false);\n applyPropsFinal(to, allPropsFinal, toElOption.style);\n\n if (morphFrom) {\n morphPath(morphFrom, to, elAnimationConfig);\n }\n\n applyTransitionFrom(to, toDataIndex, toElOption, this._seriesModel, transFromProps, false);\n }\n };\n\n MorphPreparation.prototype._manyToOneForSingleTo = function ( // \"to\" must NOT be null/undefined.\n toIdx, // May be null.\n fromIdxStart, fromCount) {\n var to = this._toList[toIdx];\n var toElOption = this._toElOptionList[toIdx];\n var allPropsFinal = this._allPropsFinalList[toIdx];\n applyPropsFinal(to, allPropsFinal, toElOption.style);\n\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdx]);\n\n if (elAnimationConfig.duration && fromIdxStart != null) {\n var combineFromList = [];\n\n for (var fromIdx = fromIdxStart; fromIdx < fromCount; fromIdx++) {\n combineFromList.push(this._fromList[fromIdx]);\n }\n\n var combineResult = combine(combineFromList, to, elAnimationConfig, copyPropsWhenDivided);\n\n this._processResultIndividuals(combineResult, toIdx, null);\n }\n };\n\n MorphPreparation.prototype._oneToManyForSingleFrom = function ( // \"to\" must NOT be null/undefined.\n toIdxStart, toCount, // May be null\n fromIdx) {\n var from = fromIdx == null ? null : this._fromList[fromIdx];\n var toList = this._toList;\n var separateToList = [];\n\n for (var toIdx = toIdxStart; toIdx < toCount; toIdx++) {\n var to = toList[toIdx];\n applyPropsFinal(to, this._allPropsFinalList[toIdx], this._toElOptionList[toIdx].style);\n separateToList.push(to);\n }\n\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdxStart]);\n\n if (elAnimationConfig.duration && from) {\n var separateResult = separate(from, separateToList, elAnimationConfig, copyPropsWhenDivided);\n\n this._processResultIndividuals(separateResult, toIdxStart, toCount);\n }\n };\n\n MorphPreparation.prototype._processResultIndividuals = function (combineSeparateResult, toIdxStart, toCount) {\n var isSeparate = toCount != null;\n\n for (var i = 0; i < combineSeparateResult.count; i++) {\n var fromIndividual = combineSeparateResult.fromIndividuals[i];\n var toIndividual = combineSeparateResult.toIndividuals[i]; // Here it's a trick:\n // For \"combine\" case, all of the `toIndividuals` map to the same `toIdx`.\n // For \"separate\" case, the `toIndividuals` map to some certain segment of `_toList` accurately.\n\n var toIdx = toIdxStart + (isSeparate ? i : 0);\n var toElOption = this._toElOptionList[toIdx];\n var dataIndex = this._toDataIndices[toIdx];\n var transFromProps = {};\n prepareTransformTransitionFrom(toIndividual, fromIndividual, toElOption, transFromProps, false);\n prepareStyleTransitionFrom(toIndividual, fromIndividual, toElOption, toElOption.style, transFromProps, false);\n applyTransitionFrom(toIndividual, dataIndex, toElOption, this._seriesModel, transFromProps, false);\n }\n };\n\n MorphPreparation.prototype._getOrCreateMorphConfig = function (dataIndex) {\n var morphConfigList = this._morphConfigList;\n var config = morphConfigList[dataIndex];\n\n if (config) {\n return config;\n }\n\n var duration;\n var easing;\n var delay;\n var seriesModel = this._seriesModel;\n var transOpt = this._transOpt;\n\n if (seriesModel.isAnimationEnabled()) {\n // PENDING: refactor? this is the same logic as `src/util/graphic.ts#animateOrSetProps`.\n var animationPayload = void 0;\n\n if (seriesModel && seriesModel.ecModel) {\n var updatePayload = seriesModel.ecModel.getUpdatePayload();\n animationPayload = updatePayload && updatePayload.animation;\n }\n\n if (animationPayload) {\n duration = animationPayload.duration || 0;\n easing = animationPayload.easing || 'cubicOut';\n delay = animationPayload.delay || 0;\n } else {\n easing = seriesModel.get('animationEasingUpdate');\n var delayOption = seriesModel.get('animationDelayUpdate');\n delay = isFunction(delayOption) ? delayOption(dataIndex) : delayOption;\n var durationOption = seriesModel.get('animationDurationUpdate');\n duration = isFunction(durationOption) ? durationOption(dataIndex) : durationOption;\n }\n }\n\n config = {\n duration: duration || 0,\n delay: delay,\n easing: easing,\n dividingMethod: transOpt ? transOpt.dividingMethod : null\n };\n morphConfigList[dataIndex] = config;\n return config;\n };\n\n MorphPreparation.prototype.reset = function (type) {\n // `this._morphConfigList` can be kept. It only related to `dataIndex`.\n this._type = type;\n this._fromList.length = this._toList.length = this._toElOptionList.length = this._allPropsFinalList.length = this._toDataIndices.length = 0;\n };\n\n return MorphPreparation;\n}();\n\nfunction copyPropsWhenDivided(srcPath, tarPath, willClone) {\n // Do not copy transform props.\n // Sub paths are transfrom based on their host path.\n // tarPath.x = srcPath.x;\n // tarPath.y = srcPath.y;\n // tarPath.scaleX = srcPath.scaleX;\n // tarPath.scaleY = srcPath.scaleY;\n // tarPath.originX = srcPath.originX;\n // tarPath.originY = srcPath.originY;\n // If just carry the style, will not be modifed, so do not copy.\n tarPath.style = willClone ? clone(srcPath.style) : srcPath.style;\n tarPath.zlevel = srcPath.zlevel;\n tarPath.z = srcPath.z;\n tarPath.z2 = srcPath.z2;\n}\n\nexport function install(registers) {\n registers.registerChartView(CustomSeriesView);\n registers.registerSeriesModel(CustomSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport * as axisPointerModelHelper from './modelHelper';\nimport * as eventTool from 'zrender/lib/core/event';\nimport * as throttleUtil from '../../util/throttle';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\n * Base axis pointer class in 2D.\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n */\n\n this.animationThreshold = 15;\n }\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\n * @implement\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Shoule be implemenented by sub-class.\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // Fot mobile devicem, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\n * Throttled method.\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\n * @private\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n };\n /**\n * @protected\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport * as textContain from 'zrender/lib/contain/text';\nimport * as formatUtil from '../../util/format';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as axisHelper from '../../coord/axisHelper';\nimport AxisBuilder from '../axis/AxisBuilder';\nimport { createTextStyle } from '../../label/labelStyle';\nexport function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n\n return style;\n}\n/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */\n\nexport function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\n var value = axisPointerModel.get('value');\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n });\n var labelModel = axisPointerModel.getModel('label');\n var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\n var font = labelModel.getFont();\n var textRect = textContain.getBoundingRect(text, font);\n var position = labelPos.position;\n var width = textRect.width + paddings[1] + paddings[3];\n var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align.\n\n var align = labelPos.align;\n align === 'right' && (position[0] -= width);\n align === 'center' && (position[0] -= width / 2);\n var verticalAlign = labelPos.verticalAlign;\n verticalAlign === 'bottom' && (position[1] -= height);\n verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container\n\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\n\n elOption.label = {\n // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\n x: position[0],\n y: position[1],\n style: createTextStyle(labelModel, {\n text: text,\n font: font,\n fill: labelModel.getTextColor(),\n padding: paddings,\n backgroundColor: bgColor\n }),\n // Lable should be over axisPointer.\n z2: 10\n };\n} // Do not overflow ec container\n\nfunction confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}\n\nexport function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\n value = axis.scale.parse(value);\n var text = axis.scale.getLabel({\n value: value\n }, {\n // If `precision` is set, width can be fixed (like '12.00500'), which\n // helps to debounce when when moving label.\n precision: opt.precision\n });\n var formatter = opt.formatter;\n\n if (formatter) {\n var params_1 = {\n value: axisHelper.getAxisRawValue(axis, {\n value: value\n }),\n axisDimension: axis.dim,\n axisIndex: axis.index,\n seriesData: []\n };\n zrUtil.each(seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var dataParams = series && series.getDataParams(dataIndex);\n dataParams && params_1.seriesData.push(dataParams);\n });\n\n if (zrUtil.isString(formatter)) {\n text = formatter.replace('{value}', text);\n } else if (zrUtil.isFunction(formatter)) {\n text = formatter(params_1);\n }\n }\n\n return text;\n}\nexport function getTransformedPosition(axis, value, layoutInfo) {\n var transform = matrix.create();\n matrix.rotate(transform, transform, layoutInfo.rotation);\n matrix.translate(transform, transform, layoutInfo.position);\n return graphic.applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);\n}\nexport function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\n // @ts-ignore\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\n align: textLayout.textAlign,\n verticalAlign: textLayout.textVerticalAlign\n });\n}\nexport function makeLineShape(p1, p2, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x1: p1[xDimIndex],\n y1: p1[1 - xDimIndex],\n x2: p2[xDimIndex],\n y2: p2[1 - xDimIndex]\n };\n}\nexport function makeRectShape(xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n}\nexport function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: true\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer';\nimport * as viewHelper from './viewHelper';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';\n\nvar CartesianAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisPointer, _super);\n\n function CartesianAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n\n\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\n * @override\n */\n\n\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: pos[0],\n y: pos[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\n * @override\n */\n\n\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n };\n\n return CartesianAxisPointer;\n}(BaseAxisPointer);\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nexport default CartesianAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar AxisPointerModel =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerModel, _super);\n\n function AxisPointerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerModel.type;\n return _this;\n }\n\n AxisPointerModel.type = 'axisPointer';\n AxisPointerModel.defaultOption = {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n zlevel: 0,\n z: 50,\n type: 'line',\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n value: null,\n status: null,\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#B9BEC9',\n width: 1,\n type: 'dashed'\n },\n shadowStyle: {\n color: 'rgba(210,219,238,0.2)'\n },\n label: {\n show: true,\n formatter: null,\n precision: 'auto',\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n borderColor: null,\n borderWidth: 0,\n borderRadius: 3\n },\n handle: {\n show: false,\n // eslint-disable-next-line\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n };\n return AxisPointerModel;\n}(ComponentModel);\n\nexport default AxisPointerModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.<number>} point\n */\n\nexport function register(key, api, handler) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\n\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave);\n\n useHandler('globalout', onLeave);\n\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\n\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\n\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\n\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\n\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n }; // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\n\nexport function unregister(key, api) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n\n if (record) {\n inner(zr).records[key] = null;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener';\nimport ComponentView from '../../view/Component';\n\nvar AxisPointerView =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerView, _super);\n\n function AxisPointerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerView.type;\n return _this;\n }\n\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable\n // AxisPointerView to be independent to Tooltip.\n\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n };\n\n AxisPointerView.prototype.remove = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.prototype.dispose = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.type = 'axisPointer';\n return AxisPointerView;\n}(ComponentView);\n\nexport default AxisPointerView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\n/**\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param ecModel\n * @return {point: [x, y], el: ...} point Will not be null.\n */\n\nexport default function findPointFromSeries(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n if (finder.isStacked) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueAxisDim = valueAxis.dim;\n var baseAxisDim = baseAxis.dim;\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var baseDim = data.mapDimension(baseAxisDim);\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\n point = coordSys.dataToPoint(stackedData) || [];\n } else {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex)) || [];\n }\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n\n return {\n point: point,\n el: el\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model';\nimport * as modelHelper from './modelHelper';\nimport findPointFromSeries from './findPointFromSeries';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util';\nvar inner = makeInner();\n/**\n * Basic logic: check all axis, if they do not demand show/highlight,\n * then hide/downplay them.\n *\n * @return content of event obj for echarts.connect.\n */\n\nexport default function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}\n\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n var axis = axisInfo.axis;\n\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n } // Heavy calculation. So put it after axis.containData checking.\n\n\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect.\n // By default use the first involved series data as a sample to connect.\n\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n extend(outputFinder, payloadBatch[0]);\n } // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n\n\n if (!noSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n\n updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\n\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimensionsAll(dim);\n var seriesNestestValue;\n var dataIndices;\n\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex\n // when data length is not same.\n // false,\n axis.type === 'category' ? 0.5 : null);\n\n if (!dataIndices.length) {\n return;\n }\n\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff); // Consider category case\n\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\n\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\n\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n // depends that all models have been updated. So it should not be performed\n // here. Considering axisPointerModel used here is volatile, which is hard\n // to be retrieve in TooltipView, we prepare parameters here.\n valueLabelOpt: {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\n\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value; // For label formatter param and highlight.\n\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n } // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n } // If status is 'hide', should be no info in payload.\n\n\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\n\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n } // In most case only one axis (or event one series is used). It is\n // convinient to fetch payload.seriesIndex and payload.dataIndex\n // dirtectly. So put the first seriesIndex and dataIndex of the first\n // axis on the payload.\n\n\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\n\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification shoule be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n }); // Diff.\n\n var toHighlight = [];\n var toDownplay = [];\n each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toHighlight\n });\n}\n\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\n\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\n\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport AxisView from '../axis/AxisView';\nimport CartesianAxisPointer from './CartesianAxisPointer';\nimport AxisPointerModel from './AxisPointerModel';\nimport AxisPointerView from './AxisPointerView';\nimport { isArray } from 'zrender/lib/core/util';\nimport { collect } from './modelHelper';\nimport axisTrigger from './axisTrigger';\nexport function install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n registers.registerComponentModel(AxisPointerModel);\n registers.registerComponentView(AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !isArray(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installSimple } from './installSimple';\nimport { install as installAxisPointer } from '../axisPointer/install';\nimport { use } from '../../extension';\nexport function install(registers) {\n use(installSimple);\n use(installAxisPointer);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer';\nimport * as graphic from '../../util/graphic';\nimport * as viewHelper from './viewHelper';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport AxisBuilder from '../axis/AxisBuilder';\n\nvar PolarAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisPointer, _super);\n\n function PolarAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n\n\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n\n if (axis.dim === 'angle') {\n this.animationThreshold = Math.PI / 18;\n }\n\n var polar = axis.polar;\n var otherAxis = polar.getOtherAxis(axis);\n var otherExtent = otherAxis.getExtent();\n var coordValue = axis.dataToCoord(value);\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var labelMargin = axisPointerModel.get(['label', 'margin']);\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n };\n\n return PolarAxisPointer;\n}(BaseAxisPointer);\n\n;\n\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n var axis = axisModel.axis;\n var coord = axis.dataToCoord(value);\n var axisAngle = polar.getAngleAxis().getExtent()[0];\n axisAngle = axisAngle / 180 * Math.PI;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var position;\n var align;\n var verticalAlign;\n\n if (axis.dim === 'radius') {\n var transform = matrix.create();\n matrix.rotate(transform, transform, axisAngle);\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\n position = graphic.applyTransform([coord, -labelMargin], transform);\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; // @ts-ignore\n\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n align = labelLayout.textAlign;\n verticalAlign = labelLayout.textVerticalAlign;\n } else {\n // angle axis\n var r = radiusExtent[1];\n position = polar.coordToPoint([r + labelMargin, coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n }\n\n return {\n position: position,\n align: align,\n verticalAlign: verticalAlign\n };\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, polar, coordValue, otherExtent) {\n return axis.dim === 'angle' ? {\n type: 'Line',\n shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n } : {\n type: 'Circle',\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: coordValue\n }\n };\n },\n shadow: function (axis, polar, coordValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var radian = Math.PI / 180;\n return axis.dim === 'angle' ? {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive\n (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n } : {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n };\n }\n};\nexport default PolarAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar PolarModel =\n/** @class */\nfunction (_super) {\n __extends(PolarModel, _super);\n\n function PolarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarModel.type;\n return _this;\n }\n\n PolarModel.prototype.findAxisModel = function (axisType) {\n var foundAxisModel;\n var ecModel = this.ecModel;\n ecModel.eachComponent(axisType, function (axisModel) {\n if (axisModel.getCoordSysModel() === this) {\n foundAxisModel = axisModel;\n }\n }, this);\n return foundAxisModel;\n };\n\n PolarModel.type = 'polar';\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n PolarModel.defaultOption = {\n zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '80%'\n };\n return PolarModel;\n}(ComponentModel);\n\nexport default PolarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nvar PolarAxisModel =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisModel, _super);\n\n function PolarAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n PolarAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n };\n\n PolarAxisModel.type = 'polarAxis';\n return PolarAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\n\nvar AngleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisModel, _super);\n\n function AngleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisModel.type;\n return _this;\n }\n\n AngleAxisModel.type = 'angleAxis';\n return AngleAxisModel;\n}(PolarAxisModel);\n\nexport { AngleAxisModel };\n\nvar RadiusAxisModel =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisModel, _super);\n\n function RadiusAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisModel.type;\n return _this;\n }\n\n RadiusAxisModel.type = 'radiusAxis';\n return RadiusAxisModel;\n}(PolarAxisModel);\n\nexport { RadiusAxisModel };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar RadiusAxis =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxis, _super);\n\n function RadiusAxis(scale, radiusExtent) {\n return _super.call(this, 'radius', scale, radiusExtent) || this;\n }\n\n RadiusAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n\n return RadiusAxis;\n}(Axis);\n\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text';\nimport Axis from '../Axis';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\n\nvar AngleAxis =\n/** @class */\nfunction (_super) {\n __extends(AngleAxis, _super);\n\n function AngleAxis(scale, angleExtent) {\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n }\n\n AngleAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n /**\n * Only be called in category axis.\n * Angle axis uses text height to decide interval\n *\n * @override\n * @return {number} Auto interval for cateogry axis tick and label\n */\n\n\n AngleAxis.prototype.calculateCategoryInterval = function () {\n var axis = this;\n var labelModel = axis.getLabelModel();\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitH = Math.abs(unitSpan); // Not precise, just use height as text width\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n var maxH = Math.max(rect.height, 7);\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(dh));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n };\n\n return AngleAxis;\n}(Axis);\n\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadiusAxis from './RadiusAxis';\nimport AngleAxis from './AngleAxis';\n\nvar Polar =\n/** @class */\nfunction () {\n function Polar(name) {\n this.dimensions = ['radius', 'angle'];\n this.type = 'polar';\n /**\n * x of polar center\n */\n\n this.cx = 0;\n /**\n * y of polar center\n */\n\n this.cy = 0;\n this._radiusAxis = new RadiusAxis();\n this._angleAxis = new AngleAxis();\n this.axisPointerEnabled = true;\n this.name = name || '';\n this._radiusAxis.polar = this._angleAxis.polar = this;\n }\n /**\n * If contain coord\n */\n\n\n Polar.prototype.containPoint = function (point) {\n var coord = this.pointToCoord(point);\n return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n };\n /**\n * If contain data\n */\n\n\n Polar.prototype.containData = function (data) {\n return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n };\n\n Polar.prototype.getAxis = function (dim) {\n var key = '_' + dim + 'Axis';\n return this[key];\n };\n\n Polar.prototype.getAxes = function () {\n return [this._radiusAxis, this._angleAxis];\n };\n /**\n * Get axes by type of scale\n */\n\n\n Polar.prototype.getAxesByScale = function (scaleType) {\n var axes = [];\n var angleAxis = this._angleAxis;\n var radiusAxis = this._radiusAxis;\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n return axes;\n };\n\n Polar.prototype.getAngleAxis = function () {\n return this._angleAxis;\n };\n\n Polar.prototype.getRadiusAxis = function () {\n return this._radiusAxis;\n };\n\n Polar.prototype.getOtherAxis = function (axis) {\n var angleAxis = this._angleAxis;\n return axis === angleAxis ? this._radiusAxis : angleAxis;\n };\n /**\n * Base axis will be used on stacking.\n *\n */\n\n\n Polar.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n };\n\n Polar.prototype.getTooltipAxes = function (dim) {\n var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n return {\n baseAxes: [baseAxis],\n otherAxes: [this.getOtherAxis(baseAxis)]\n };\n };\n /**\n * Convert a single data item to (x, y) point.\n * Parameter data is an array which the first element is radius and the second is angle\n */\n\n\n Polar.prototype.dataToPoint = function (data, clamp) {\n return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);\n };\n /**\n * Convert a (x, y) point to data\n */\n\n\n Polar.prototype.pointToData = function (point, clamp) {\n var coord = this.pointToCoord(point);\n return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];\n };\n /**\n * Convert a (x, y) point to (radius, angle) coord\n */\n\n\n Polar.prototype.pointToCoord = function (point) {\n var dx = point[0] - this.cx;\n var dy = point[1] - this.cy;\n var angleAxis = this.getAngleAxis();\n var extent = angleAxis.getExtent();\n var minAngle = Math.min(extent[0], extent[1]);\n var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator\n // FIXME\n\n angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent\n\n var dir = radian < minAngle ? 1 : -1;\n\n while (radian < minAngle || radian > maxAngle) {\n radian += dir * 360;\n }\n\n return [radius, radian];\n };\n /**\n * Convert a (radius, angle) coord to (x, y) point\n */\n\n\n Polar.prototype.coordToPoint = function (coord) {\n var radius = coord[0];\n var radian = coord[1] / 180 * Math.PI;\n var x = Math.cos(radian) * radius + this.cx; // Inverse the y\n\n var y = -Math.sin(radian) * radius + this.cy;\n return [x, y];\n };\n /**\n * Get ring area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n\n\n Polar.prototype.getArea = function () {\n var angleAxis = this.getAngleAxis();\n var radiusAxis = this.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180;\n return {\n cx: this.cx,\n cy: this.cy,\n r0: radiusExtent[0],\n r: radiusExtent[1],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse,\n contain: function (x, y) {\n // It's a ring shape.\n // Start angle and end angle don't matter\n var dx = x - this.cx;\n var dy = y - this.cy;\n var d2 = dx * dx + dy * dy;\n var r = this.r;\n var r0 = this.r0;\n return d2 <= r * r && d2 >= r0 * r0;\n }\n };\n };\n\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Polar;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var polarModel = finder.polarModel;\n return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Polar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Polar from './Polar';\nimport { parsePercent } from '../../util/number';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Resize method bound to the polar\n */\n\nfunction resizePolar(polar, polarModel, api) {\n var center = polarModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n polar.cx = parsePercent(center[0], width);\n polar.cy = parsePercent(center[1], height);\n var radiusAxis = polar.getRadiusAxis();\n var size = Math.min(width, height) / 2;\n var radius = polarModel.get('radius');\n\n if (radius == null) {\n radius = [0, '100%'];\n } else if (!zrUtil.isArray(radius)) {\n // r0 = 0\n radius = [0, radius];\n }\n\n var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\n * Update polar\n */\n\n\nfunction updatePolarScale(ecModel, api) {\n var polar = this;\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis(); // Reset scale\n\n angleAxis.scale.setExtent(Infinity, -Infinity);\n radiusAxis.scale.setExtent(Infinity, -Infinity);\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === polar) {\n var data_1 = seriesModel.getData();\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n radiusAxis.scale.unionExtentFromData(data_1, dim);\n });\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n angleAxis.scale.unionExtentFromData(data_1, dim);\n });\n }\n });\n niceScaleExtent(angleAxis.scale, angleAxis.model);\n niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis\n\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\n var extent = angleAxis.getExtent();\n var diff = 360 / angleAxis.scale.count();\n angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n angleAxis.setExtent(extent[0], extent[1]);\n }\n}\n\nfunction isAngleAxisModel(axisModel) {\n return axisModel.mainType === 'angleAxis';\n}\n/**\n * Set common axis properties\n */\n\n\nfunction setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}\n\nvar polarCreator = {\n dimensions: Polar.prototype.dimensions,\n create: function (ecModel, api) {\n var polarList = [];\n ecModel.eachComponent('polar', function (polarModel, idx) {\n var polar = new Polar(idx + ''); // Inject resize and update method\n\n polar.update = updatePolarScale;\n var radiusAxis = polar.getRadiusAxis();\n var angleAxis = polar.getAngleAxis();\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n setAxis(radiusAxis, radiusAxisModel);\n setAxis(angleAxis, angleAxisModel);\n resizePolar(polar, polarModel, api);\n polarList.push(polar);\n polarModel.coordinateSystem = polar;\n polar.model = polarModel;\n }); // Inject coordinateSystem to series\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'polar') {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!polarModel) {\n throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n }\n }\n\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\n }\n });\n return polarList;\n }\n};\nexport default polarCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { createTextStyle } from '../../label/labelStyle';\nimport Model from '../../model/Model';\nimport AxisView from './AxisView';\nimport AxisBuilder from './AxisBuilder';\nimport { getECData } from '../../util/innerStore';\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];\n\nfunction getAxisLineShape(polar, rExtent, angle) {\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n var start = polar.coordToPoint([rExtent[0], angle]);\n var end = polar.coordToPoint([rExtent[1], angle]);\n return {\n x1: start[0],\n y1: start[1],\n x2: end[0],\n y2: end[1]\n };\n}\n\nfunction getRadiusIdx(polar) {\n var radiusAxis = polar.getRadiusAxis();\n return radiusAxis.inverse ? 0 : 1;\n} // Remove the last tick which will overlap the first tick\n\n\nfunction fixAngleOverlap(list) {\n var firstItem = list[0];\n var lastItem = list[list.length - 1];\n\n if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n list.pop();\n }\n}\n\nvar AngleAxisView =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisView, _super);\n\n function AngleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!angleAxisModel.get('show')) {\n return;\n }\n\n var angleAxis = angleAxisModel.axis;\n var polar = angleAxis.polar;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var ticksAngles = angleAxis.getTicksCoords();\n var minorTickAngles = angleAxis.getMinorTicksCoords();\n var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n labelItem = zrUtil.clone(labelItem);\n var scale = angleAxis.scale;\n var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n labelItem.coord = angleAxis.dataToCoord(tickValue);\n return labelItem;\n });\n fixAngleOverlap(labels);\n fixAngleOverlap(ticksAngles);\n zrUtil.each(elementList, function (name) {\n if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\n }\n }, this);\n };\n\n AngleAxisView.type = 'angleAxis';\n return AngleAxisView;\n}(AxisView);\n\nvar angelAxisElementsBuilders = {\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); // extent id of the axis radius (r0 and r)\n\n var rId = getRadiusIdx(polar);\n var r0Id = rId ? 0 : 1;\n var shape;\n\n if (radiusExtent[r0Id] === 0) {\n shape = new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n } else {\n shape = new graphic.Ring({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId],\n r0: radiusExtent[r0Id]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n }\n\n shape.style.fill = null;\n group.add(shape);\n },\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var tickModel = angleAxisModel.getModel('axisTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n return new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n });\n });\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n })\n }));\n },\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var tickModel = angleAxisModel.getModel('axisTick');\n var minorTickModel = angleAxisModel.getModel('minorTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n }))\n }));\n },\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\n var rawCategoryData = angleAxisModel.getCategories(true);\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\n var labelMargin = commonLabelModel.get('margin');\n var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n\n zrUtil.each(labels, function (labelItem, idx) {\n var labelModel = commonLabelModel;\n var tickValue = labelItem.tickValue;\n var r = radiusExtent[getRadiusIdx(polar)];\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\n }\n }\n\n var textEl = new graphic.Text({\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\n style: createTextStyle(labelModel, {\n x: p[0],\n y: p[1],\n fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\n text: labelItem.formattedLabel,\n align: labelTextAlign,\n verticalAlign: labelTextVerticalAlign\n })\n });\n group.add(textEl); // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = labelItem.rawLabel;\n getECData(textEl).eventData = eventData;\n }\n }, this);\n },\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var splitLineModel = angleAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyleModel.getLineStyle()),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n }\n },\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: lineStyleModel.getLineStyle(),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n },\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!ticksAngles.length) {\n return;\n }\n\n var splitAreaModel = angleAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var RADIAN = Math.PI / 180;\n var prevAngle = -ticksAngles[0].coord * RADIAN;\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n var clockwise = angleAxisModel.get('clockwise');\n\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: r0,\n r: r1,\n startAngle: prevAngle,\n endAngle: -coord * RADIAN,\n clockwise: clockwise\n },\n silent: true\n }));\n prevAngle = -coord * RADIAN;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\nexport default AngleAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport AxisBuilder from './AxisBuilder';\nimport AxisView from './AxisView';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\n\nvar RadiusAxisView =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisView, _super);\n\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: ticksCoords[i].coord\n }\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\n * @inner\n */\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nexport default RadiusAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parsePercent } from '../util/number';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper';\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(polar, axis) {\n return axis.dim + polar.model.componentIndex;\n}\n\nfunction barLayoutPolar(seriesType, ecModel, api) {\n var lastStackCoords = {};\n var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\n return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';\n }));\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for polar only\n if (seriesModel.coordinateSystem.type !== 'polar') {\n return;\n }\n\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = polar.getOtherAxis(baseAxis);\n var cx = seriesModel.coordinateSystem.cx;\n var cy = seriesModel.coordinateSystem.cy;\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim\n /*, baseDim*/\n );\n var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true);\n var valueAxisStart = valueAxis.dataToCoord(0);\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n // Only ordinal axis can be stacked.\n\n if (stacked) {\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n n: valueAxisStart // Negative stack\n\n };\n } // Should also consider #4243\n\n\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n\n var r0 = void 0;\n var r = void 0;\n var startAngle = void 0;\n var endAngle = void 0; // radial sector\n\n if (valueAxis.dim === 'radius') {\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\n var angle = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(radiusSpan) < barMinHeight) {\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\n }\n\n r0 = baseCoord;\n r = baseCoord + radiusSpan;\n startAngle = angle - columnOffset;\n endAngle = startAngle - columnWidth;\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\n } // tangential sector\n else {\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\n var radius = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(angleSpan) < barMinAngle) {\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\n }\n\n r0 = radius + columnOffset;\n r = r0 + columnWidth;\n startAngle = baseCoord;\n endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring,\n // add a round to differentiate it from origin\n // let extent = angleAxis.getExtent();\n // let stackCoord = angle;\n // if (stackCoord === extent[0] && value > 0) {\n // stackCoord = extent[1];\n // }\n // else if (stackCoord === extent[1] && value < 0) {\n // stackCoord = extent[0];\n // }\n\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\n }\n\n data.setItemLayout(idx, {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n // Consider that positive angle is anti-clockwise,\n // while positive radian of sector is clockwise\n startAngle: -startAngle * Math.PI / 180,\n endAngle: -endAngle * Math.PI / 180\n });\n }\n });\n}\n/**\n * Calculate bar width and offset for radial bar charts\n */\n\n\nfunction calRadialBar(barSeries) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nexport default barLayoutPolar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension';\nimport AxisView from '../axis/AxisView';\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer';\nimport { install as installAxisPointer } from '../axisPointer/install';\nimport PolarModel from '../../coord/polar/PolarModel';\nimport axisModelCreator from '../../coord/axisModelCreator';\nimport { AngleAxisModel, RadiusAxisModel } from '../../coord/polar/AxisModel';\nimport polarCreator from '../../coord/polar/polarCreator';\nimport AngleAxisView from '../axis/AngleAxisView';\nimport RadiusAxisView from '../axis/RadiusAxisView';\nimport ComponentView from '../../view/Component';\nimport { curry } from 'zrender/lib/core/util';\nimport barLayoutPolar from '../../layout/barPolar';\nvar angleAxisExtraOption = {\n startAngle: 90,\n clockwise: true,\n splitNumber: 12,\n axisLabel: {\n rotate: 0\n }\n};\nvar radiusAxisExtraOption = {\n splitNumber: 5\n};\n\nvar PolarView =\n/** @class */\nfunction (_super) {\n __extends(PolarView, _super);\n\n function PolarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarView.type;\n return _this;\n }\n\n PolarView.type = 'polar';\n return PolarView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n registers.registerCoordinateSystem('polar', polarCreator);\n registers.registerComponentModel(PolarModel);\n registers.registerComponentView(PolarView); // Model and view for angleAxis and radiusAxis\n\n axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\n axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\n registers.registerComponentView(AngleAxisView);\n registers.registerComponentView(RadiusAxisView);\n registers.registerLayout(curry(barLayoutPolar, 'bar'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport AxisBuilder from './AxisBuilder';\nimport * as graphic from '../../util/graphic';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper';\nimport AxisView from './AxisView';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine'];\n\nvar SingleAxisView =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisView, _super);\n\n function SingleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisView.type;\n _this.axisPointerClass = 'SingleAxisPointer';\n return _this;\n }\n\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n var layout = singleAxisHelper.layout(axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n group.add(this._axisGroup);\n group.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n SingleAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n SingleAxisView.type = 'singleAxis';\n return SingleAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, group, axisGroup, axisModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var gridRect = axisModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var splitLines = [];\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n\n for (var i = 0; i < ticksCoords.length; ++i) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n subPixelOptimize: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n silent: true\n }));\n }\n\n var lineStyle = lineStyleModel.getLineStyle(['color']);\n\n for (var i = 0; i < splitLines.length; ++i) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyle),\n silent: true\n }));\n }\n },\n splitArea: function (axisView, group, axisGroup, axisModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\n }\n};\nexport default SingleAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { mixin } from 'zrender/lib/core/util';\n\nvar SingleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisModel, _super);\n\n function SingleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisModel.type;\n return _this;\n }\n\n SingleAxisModel.prototype.getCoordSysModel = function () {\n return this;\n };\n\n SingleAxisModel.type = 'singleAxis';\n SingleAxisModel.layoutMode = 'box';\n SingleAxisModel.defaultOption = {\n left: '5%',\n top: '5%',\n right: '5%',\n bottom: '5%',\n type: 'value',\n position: 'bottom',\n orient: 'horizontal',\n axisLine: {\n show: true,\n lineStyle: {\n width: 1,\n type: 'solid'\n }\n },\n // Single coordinate system and single axis is the,\n // which is used as the parent tooltip model.\n // same model, so we set default tooltip show as true.\n tooltip: {\n show: true\n },\n axisTick: {\n show: true,\n length: 6,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n interval: 'auto'\n },\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n opacity: 0.2\n }\n }\n };\n return SingleAxisModel;\n}(ComponentModel);\n\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar SingleAxis =\n/** @class */\nfunction (_super) {\n __extends(SingleAxis, _super);\n\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n /**\n * Judge the orient of the axis.\n */\n\n\n SingleAxis.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n\n SingleAxis.prototype.pointToData = function (point, clamp) {\n return this.coordinateSystem.pointToData(point)[0];\n };\n\n return SingleAxis;\n}(Axis);\n\nexport default SingleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis';\nimport * as axisHelper from '../axisHelper';\nimport { getLayoutRect } from '../../util/layout';\nimport { each } from 'zrender/lib/core/util';\n/**\n * Create a single coordinates system.\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\n * Add it just for draw tooltip.\n */\n\n this.dimensions = ['single'];\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\n * Initialize single coordinate system.\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\n * Resize the single coordinate system.\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.reverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\n * Get axis.\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\n * Get axis, add it just for draw tooltip.\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\n * If contain point.\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\n * Convert the series data to concrete point.\n * Can be [val] | val\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Single coordinate system creator.\n */\nimport Single from './Single';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Create single coordinate system and inject it into seriesModel.\n */\n\nfunction create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}\n\nvar singleCreator = {\n create: create,\n dimensions: Single.prototype.dimensions\n};\nexport default singleCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer';\nimport * as viewHelper from './viewHelper';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper';\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\n\nvar SingleAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisPointer, _super);\n\n function SingleAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n\n\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n var pixelValue = coordSys.dataToPoint(value)[0];\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = singleAxisHelper.layout(axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\n * @override\n */\n\n\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = singleAxisHelper.layout(axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: position[0],\n y: position[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\n * @override\n */\n\n\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var dimIndex = getPointDimIndex(axis);\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: {\n verticalAlign: 'middle'\n }\n };\n };\n\n return SingleAxisPointer;\n}(BaseAxisPointer);\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = axis.getBandWidth();\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n };\n }\n};\n\nfunction getPointDimIndex(axis) {\n return axis.isHorizontal() ? 0 : 1;\n}\n\nfunction getGlobalExtent(coordSys, dimIndex) {\n var rect = coordSys.getRect();\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\n\nexport default SingleAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension';\nimport ComponentView from '../../view/Component';\nimport SingleAxisView from '../axis/SingleAxisView';\nimport axisModelCreator from '../../coord/axisModelCreator';\nimport SingleAxisModel from '../../coord/single/AxisModel';\nimport singleCreator from '../../coord/single/singleCreator';\nimport { install as installAxisPointer } from '../axisPointer/install';\nimport AxisView from '../axis/AxisView';\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer';\n\nvar SingleView =\n/** @class */\nfunction (_super) {\n __extends(SingleView, _super);\n\n function SingleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleView.type;\n return _this;\n }\n\n SingleView.type = 'single';\n return SingleView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n registers.registerComponentView(SingleView); // Axis\n\n registers.registerComponentView(SingleAxisView);\n registers.registerComponentModel(SingleAxisModel);\n axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\n registers.registerCoordinateSystem('single', singleCreator);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\n * @override\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n nameMap: 'en',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n // cn en []\n nameMap: 'en',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { createTextStyle } from '../../label/labelStyle';\nimport * as formatUtil from '../../util/format';\nimport * as numberUtil from '../../util/number';\nimport ComponentView from '../../view/Component';\nvar MONTH_TEXT = {\n EN: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n CN: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']\n};\nvar WEEK_TEXT = {\n EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n CN: ['日', '一', '二', '三', '四', '五', '六']\n};\n\nvar CalendarView =\n/** @class */\nfunction (_super) {\n __extends(CalendarView, _super);\n\n function CalendarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarView.type;\n return _this;\n }\n\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n var coordSys = calendarModel.coordinateSystem; // range info\n\n var rangeData = coordSys.getRangeInfo();\n var orient = coordSys.getOrient();\n\n this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function\n\n\n this._renderLines(calendarModel, rangeData, orient, group);\n\n this._renderYearText(calendarModel, rangeData, orient, group);\n\n this._renderMonthText(calendarModel, orient, group);\n\n this._renderWeekText(calendarModel, rangeData, orient, group);\n }; // render day rect\n\n\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\n var coordSys = calendarModel.coordinateSystem;\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\n var sw = coordSys.getCellWidth();\n var sh = coordSys.getCellHeight();\n\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\n var point = coordSys.dataToRect([i], false).tl; // every rect\n\n var rect = new graphic.Rect({\n shape: {\n x: point[0],\n y: point[1],\n width: sw,\n height: sh\n },\n cursor: 'default',\n style: itemRectStyleModel\n });\n group.add(rect);\n }\n }; // render separate line\n\n\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\n var self = this;\n var coordSys = calendarModel.coordinateSystem;\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\n var show = calendarModel.get(['splitLine', 'show']);\n var lineWidth = lineStyleModel.lineWidth;\n this._tlpoints = [];\n this._blpoints = [];\n this._firstDayOfMonth = [];\n this._firstDayPoints = [];\n var firstDay = rangeData.start;\n\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\n addPoints(firstDay.formatedDate);\n\n if (i === 0) {\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\n }\n\n var date = firstDay.date;\n date.setMonth(date.getMonth() + 1);\n firstDay = coordSys.getDateInfo(date);\n }\n\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\n\n function addPoints(date) {\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\n\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\n\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\n\n self._tlpoints.push(points[0]);\n\n self._blpoints.push(points[points.length - 1]);\n\n show && self._drawSplitline(points, lineStyleModel, group);\n } // render top/left line\n\n\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line\n\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\n }; // get points at both ends\n\n\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\n var rs = [points[0].slice(), points[points.length - 1].slice()];\n var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth\n\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\n return rs;\n }; // render split line\n\n\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\n var poyline = new graphic.Polyline({\n z2: 20,\n shape: {\n points: points\n },\n style: lineStyle\n });\n group.add(poyline);\n }; // render month line of one week points\n\n\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\n var coordSys = calendarModel.coordinateSystem;\n var parsedDate = coordSys.getDateInfo(date);\n var points = [];\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\n var point = coordSys.dataToRect([tmpD.time], false);\n points[2 * tmpD.day] = point.tl;\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\n }\n\n return points;\n };\n\n CalendarView.prototype._formatterLabel = function (formatter, params) {\n if (typeof formatter === 'string' && formatter) {\n return formatUtil.formatTplSimple(formatter, params);\n }\n\n if (typeof formatter === 'function') {\n return formatter(params);\n }\n\n return params.nameMap;\n };\n\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\n var x = point[0];\n var y = point[1];\n var aligns = ['center', 'bottom'];\n\n if (position === 'bottom') {\n y += margin;\n aligns = ['center', 'top'];\n } else if (position === 'left') {\n x -= margin;\n } else if (position === 'right') {\n x += margin;\n aligns = ['center', 'top'];\n } else {\n // top\n y -= margin;\n }\n\n var rotate = 0;\n\n if (position === 'left' || position === 'right') {\n rotate = Math.PI / 2;\n }\n\n return {\n rotation: rotate,\n x: x,\n y: y,\n style: {\n align: aligns[0],\n verticalAlign: aligns[1]\n }\n };\n }; // render year\n\n\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\n var yearLabel = calendarModel.getModel('yearLabel');\n\n if (!yearLabel.get('show')) {\n return;\n }\n\n var margin = yearLabel.get('margin');\n var pos = yearLabel.get('position');\n\n if (!pos) {\n pos = orient !== 'horizontal' ? 'top' : 'left';\n }\n\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\n var xc = (points[0][0] + points[1][0]) / 2;\n var yc = (points[0][1] + points[1][1]) / 2;\n var idx = orient === 'horizontal' ? 0 : 1;\n var posPoints = {\n top: [xc, points[idx][1]],\n bottom: [xc, points[1 - idx][1]],\n left: [points[1 - idx][0], yc],\n right: [points[idx][0], yc]\n };\n var name = rangeData.start.y;\n\n if (+rangeData.end.y > +rangeData.start.y) {\n name = name + '-' + rangeData.end.y;\n }\n\n var formatter = yearLabel.get('formatter');\n var params = {\n start: rangeData.start.y,\n end: rangeData.end.y,\n nameMap: name\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var yearText = new graphic.Text({\n z2: 30,\n style: createTextStyle(yearLabel, {\n text: content\n })\n });\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\n group.add(yearText);\n };\n\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\n var align = 'left';\n var vAlign = 'top';\n var x = point[0];\n var y = point[1];\n\n if (orient === 'horizontal') {\n y = y + margin;\n\n if (isCenter) {\n align = 'center';\n }\n\n if (position === 'start') {\n vAlign = 'bottom';\n }\n } else {\n x = x + margin;\n\n if (isCenter) {\n vAlign = 'middle';\n }\n\n if (position === 'start') {\n align = 'right';\n }\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render month and year text\n\n\n CalendarView.prototype._renderMonthText = function (calendarModel, orient, group) {\n var monthLabel = calendarModel.getModel('monthLabel');\n\n if (!monthLabel.get('show')) {\n return;\n }\n\n var nameMap = monthLabel.get('nameMap');\n var margin = monthLabel.get('margin');\n var pos = monthLabel.get('position');\n var align = monthLabel.get('align');\n var termPoints = [this._tlpoints, this._blpoints];\n\n if (zrUtil.isString(nameMap)) {\n nameMap = MONTH_TEXT[nameMap.toUpperCase()] || [];\n }\n\n var idx = pos === 'start' ? 0 : 1;\n var axis = orient === 'horizontal' ? 0 : 1;\n margin = pos === 'start' ? -margin : margin;\n var isCenter = align === 'center';\n\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\n var tmp = termPoints[idx][i].slice();\n var firstDay = this._firstDayOfMonth[i];\n\n if (isCenter) {\n var firstDayPoints = this._firstDayPoints[i];\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\n }\n\n var formatter = monthLabel.get('formatter');\n var name_1 = nameMap[+firstDay.m - 1];\n var params = {\n yyyy: firstDay.y,\n yy: (firstDay.y + '').slice(2),\n MM: firstDay.m,\n M: +firstDay.m,\n nameMap: name_1\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var monthText = new graphic.Text({\n z2: 30,\n style: zrUtil.extend(createTextStyle(monthLabel, {\n text: content\n }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\n });\n group.add(monthText);\n }\n };\n\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\n var align = 'center';\n var vAlign = 'middle';\n var x = point[0];\n var y = point[1];\n var isStart = position === 'start';\n\n if (orient === 'horizontal') {\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\n align = isStart ? 'right' : 'left';\n } else {\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\n vAlign = isStart ? 'bottom' : 'top';\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render weeks\n\n\n CalendarView.prototype._renderWeekText = function (calendarModel, rangeData, orient, group) {\n var dayLabel = calendarModel.getModel('dayLabel');\n\n if (!dayLabel.get('show')) {\n return;\n }\n\n var coordSys = calendarModel.coordinateSystem;\n var pos = dayLabel.get('position');\n var nameMap = dayLabel.get('nameMap');\n var margin = dayLabel.get('margin');\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\n\n if (zrUtil.isString(nameMap)) {\n nameMap = WEEK_TEXT[nameMap.toUpperCase()] || [];\n }\n\n var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\n margin = numberUtil.parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\n\n if (pos === 'start') {\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\n margin = -margin;\n }\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(start, i);\n var point = coordSys.dataToRect([tmpD.time], false).center;\n var day = i;\n day = Math.abs((i + firstDayOfWeek) % 7);\n var weekText = new graphic.Text({\n z2: 30,\n style: zrUtil.extend(createTextStyle(dayLabel, {\n text: nameMap[day]\n }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\n });\n group.add(weekText);\n }\n };\n\n CalendarView.type = 'calendar';\n return CalendarView;\n}(ComponentView);\n\nexport default CalendarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as layout from '../../util/layout';\nimport * as numberUtil from '../../util/number'; // (24*60*60*1000)\n\nvar PROXIMATE_ONE_DAY = 86400000;\n\nvar Calendar =\n/** @class */\nfunction () {\n function Calendar(calendarModel, ecModel, api) {\n this.type = 'calendar';\n this.dimensions = Calendar.dimensions; // Required in createListFromData\n\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\n this._model = calendarModel;\n }\n\n Calendar.getDimensionsInfo = function () {\n return [{\n name: 'time',\n type: 'time'\n }, 'value'];\n };\n\n Calendar.prototype.getRangeInfo = function () {\n return this._rangeInfo;\n };\n\n Calendar.prototype.getModel = function () {\n return this._model;\n };\n\n Calendar.prototype.getRect = function () {\n return this._rect;\n };\n\n Calendar.prototype.getCellWidth = function () {\n return this._sw;\n };\n\n Calendar.prototype.getCellHeight = function () {\n return this._sh;\n };\n\n Calendar.prototype.getOrient = function () {\n return this._orient;\n };\n /**\n * getFirstDayOfWeek\n *\n * @example\n * 0 : start at Sunday\n * 1 : start at Monday\n *\n * @return {number}\n */\n\n\n Calendar.prototype.getFirstDayOfWeek = function () {\n return this._firstDayOfWeek;\n };\n /**\n * get date info\n * }\n */\n\n\n Calendar.prototype.getDateInfo = function (date) {\n date = numberUtil.parseDate(date);\n var y = date.getFullYear();\n var m = date.getMonth() + 1;\n var mStr = m < 10 ? '0' + m : '' + m;\n var d = date.getDate();\n var dStr = d < 10 ? '0' + d : '' + d;\n var day = date.getDay();\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n return {\n y: y + '',\n m: mStr,\n d: dStr,\n day: day,\n time: date.getTime(),\n formatedDate: y + '-' + mStr + '-' + dStr,\n date: date\n };\n };\n\n Calendar.prototype.getNextNDay = function (date, n) {\n n = n || 0;\n\n if (n === 0) {\n return this.getDateInfo(date);\n }\n\n date = new Date(this.getDateInfo(date).time);\n date.setDate(date.getDate() + n);\n return this.getDateInfo(date);\n };\n\n Calendar.prototype.update = function (ecModel, api) {\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n this._orient = this._model.get('orient');\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n var weeks = this._rangeInfo.weeks || 1;\n var whNames = ['width', 'height'];\n\n var cellSize = this._model.getCellSize().slice();\n\n var layoutParams = this._model.getBoxLayoutParams();\n\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n zrUtil.each([0, 1], function (idx) {\n if (cellSizeSpecified(cellSize, idx)) {\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n }\n });\n var whGlobal = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n zrUtil.each([0, 1], function (idx) {\n if (!cellSizeSpecified(cellSize, idx)) {\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n }\n });\n\n function cellSizeSpecified(cellSize, idx) {\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\n } // Has been calculated out number.\n\n\n this._sw = cellSize[0];\n this._sh = cellSize[1];\n };\n /**\n * Convert a time data(time, value) item to (x, y) point.\n */\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\n // It will return NaN if data exceeds.\n\n\n Calendar.prototype.dataToPoint = function (data, clamp) {\n zrUtil.isArray(data) && (data = data[0]);\n clamp == null && (clamp = true);\n var dayInfo = this.getDateInfo(data);\n var range = this._rangeInfo;\n var date = dayInfo.formatedDate; // if not in range return [NaN, NaN]\n\n if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n return [NaN, NaN];\n }\n\n var week = dayInfo.day;\n\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n\n if (this._orient === 'vertical') {\n return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];\n }\n\n return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];\n };\n /**\n * Convert a (x, y) point to time data\n */\n\n\n Calendar.prototype.pointToData = function (point) {\n var date = this.pointToDate(point);\n return date && date.time;\n };\n /**\n * Convert a time date item to (x, y) four point.\n */\n\n\n Calendar.prototype.dataToRect = function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n height: this._sh - this._lineWidth\n },\n center: point,\n tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n };\n };\n /**\n * Convert a (x, y) point to time date\n *\n * @param {Array} point point\n * @return {Object} date\n */\n\n\n Calendar.prototype.pointToDate = function (point) {\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n var range = this._rangeInfo.range;\n\n if (this._orient === 'vertical') {\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n }\n\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n };\n\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n Calendar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n /**\n * initRange\n * Normalize to an [start, end] array\n */\n\n\n Calendar.prototype._initRangeOption = function () {\n var range = this._model.get('range');\n\n var normalizedRange; // Convert [1990] to 1990\n\n if (zrUtil.isArray(range) && range.length === 1) {\n range = range[0];\n }\n\n if (!zrUtil.isArray(range)) {\n var rangeStr = range.toString(); // One year.\n\n if (/^\\d{4}$/.test(rangeStr)) {\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n } // One month\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n var start = this.getDateInfo(rangeStr);\n var firstDay = start.date;\n firstDay.setMonth(firstDay.getMonth() + 1);\n var end = this.getNextNDay(firstDay, -1);\n normalizedRange = [start.formatedDate, end.formatedDate];\n } // One day\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n normalizedRange = [rangeStr, rangeStr];\n }\n } else {\n normalizedRange = range;\n }\n\n if (!normalizedRange) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.logError('Invalid date range.');\n } // Not handling it.\n\n\n return range;\n }\n\n var tmp = this._getRangeInfo(normalizedRange);\n\n if (tmp.start.time > tmp.end.time) {\n normalizedRange.reverse();\n }\n\n return normalizedRange;\n };\n /**\n * range info\n *\n * @private\n * @param {Array} range range ['2017-01-01', '2017-07-08']\n * If range[0] > range[1], they will not be reversed.\n * @return {Object} obj\n */\n\n\n Calendar.prototype._getRangeInfo = function (range) {\n var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n var reversed;\n\n if (parsedRange[0].time > parsedRange[1].time) {\n reversed = true;\n parsedRange.reverse();\n }\n\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430):\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n // Consider case2:\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\n // ```\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n // let second = new Date(1478412000000);\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n // ```\n // will get wrong result because of DST. So we should fix it.\n\n var date = new Date(parsedRange[0].time);\n var startDateNum = date.getDate();\n var endDateNum = parsedRange[1].date.getDate();\n date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date.\n\n var dateNum = date.getDate();\n\n if (dateNum !== endDateNum) {\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n\n while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n allDay -= sign;\n date.setDate(dateNum - sign);\n }\n }\n\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n reversed && parsedRange.reverse();\n return {\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n start: parsedRange[0],\n end: parsedRange[1],\n allDay: allDay,\n weeks: weeks,\n // From 0.\n nthWeek: nthWeek,\n fweek: parsedRange[0].day,\n lweek: parsedRange[1].day\n };\n };\n /**\n * get date by nthWeeks and week day in range\n *\n * @private\n * @param {number} nthWeek the week\n * @param {number} day the week day\n * @param {Array} range [d1, d2]\n * @return {Object}\n */\n\n\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n var rangeInfo = this._getRangeInfo(range);\n\n if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n return null;\n }\n\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n var date = new Date(rangeInfo.start.time);\n date.setDate(+rangeInfo.start.d + nthDay);\n return this.getDateInfo(date);\n };\n\n Calendar.create = function (ecModel, api) {\n var calendarList = [];\n ecModel.eachComponent('calendar', function (calendarModel) {\n var calendar = new Calendar(calendarModel, ecModel, api);\n calendarList.push(calendar);\n calendarModel.coordinateSystem = calendar;\n });\n ecModel.eachSeries(function (calendarSeries) {\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\n // Inject coordinate system\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\n }\n });\n return calendarList;\n };\n\n Calendar.dimensions = ['time', 'value'];\n return Calendar;\n}();\n\nfunction getCoordSys(finder) {\n var calendarModel = finder.calendarModel;\n var seriesModel = finder.seriesModel;\n var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n return coordSys;\n}\n\nexport default Calendar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CalendarModel from '../../coord/calendar/CalendarModel';\nimport CalendarView from './CalendarView';\nimport Calendar from '../../coord/calendar/Calendar';\nexport function install(registers) {\n registers.registerComponentModel(CalendarModel);\n registers.registerComponentView(CalendarView);\n registers.registerCoordinateSystem('calendar', Calendar);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nimport * as graphicUtil from '../../util/graphic';\nimport * as layoutUtil from '../../util/layout';\nimport { parsePercent } from '../../util/number';\nimport ComponentModel from '../../model/Component';\nimport ComponentView from '../../view/Component';\nimport { getECData } from '../../util/innerStore';\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat';\nvar TRANSFORM_PROPS = {\n x: 1,\n y: 1,\n scaleX: 1,\n scaleY: 1,\n originX: 1,\n originY: 1,\n rotation: 1\n};\n;\nvar inner = modelUtil.makeInner();\nvar _nonShapeGraphicElements = {\n // Reserved but not supported in graphic component.\n path: null,\n compoundPath: null,\n // Supported in graphic component.\n group: graphicUtil.Group,\n image: graphicUtil.Image,\n text: graphicUtil.Text\n}; // ------------------------\n// Preprocessor\n// ------------------------\n\nvar preprocessor = function (option) {\n var graphicOption = option.graphic; // Convert\n // {graphic: [{left: 10, type: 'circle'}, ...]}\n // or\n // {graphic: {left: 10, type: 'circle'}}\n // to\n // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\n\n if (zrUtil.isArray(graphicOption)) {\n if (!graphicOption[0] || !graphicOption[0].elements) {\n option.graphic = [{\n elements: graphicOption\n }];\n } else {\n // Only one graphic instance can be instantiated. (We dont\n // want that too many views are created in echarts._viewMap)\n option.graphic = [option.graphic[0]];\n }\n } else if (graphicOption && !graphicOption.elements) {\n option.graphic = [{\n elements: [graphicOption]\n }];\n }\n};\n\n;\n\nvar GraphicComponentModel =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentModel, _super);\n\n function GraphicComponentModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentModel.type;\n _this.preventAutoZ = true;\n return _this;\n }\n\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\n // Prevent default merge to elements\n var elements = this.option.elements;\n this.option.elements = null;\n\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this.option.elements = elements;\n };\n\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n var newList = (isInit ? thisOption : newOption).elements;\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\n var flattenedList = [];\n\n this._flatten(newList, flattenedList, null);\n\n var mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge'); // Clear elOptionsToUpdate\n\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\n zrUtil.each(mappingResult, function (resultItem, index) {\n var newElOption = resultItem.newOption;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\n }\n\n if (!newElOption) {\n return;\n }\n\n elOptionsToUpdate.push(newElOption);\n setKeyInfoToNewElOption(resultItem, newElOption);\n mergeNewElOptionToExist(existList, index, newElOption);\n setLayoutInfoToExist(existList[index], newElOption);\n }, this); // Clean\n\n for (var i = existList.length - 1; i >= 0; i--) {\n if (existList[i] == null) {\n existList.splice(i, 1);\n } else {\n // $action should be volatile, otherwise option gotten from\n // `getOption` will contain unexpected $action.\n delete existList[i].$action;\n }\n }\n };\n /**\n * Convert\n * [{\n * type: 'group',\n * id: 'xx',\n * children: [{type: 'circle'}, {type: 'polygon'}]\n * }]\n * to\n * [\n * {type: 'group', id: 'xx'},\n * {type: 'circle', parentId: 'xx'},\n * {type: 'polygon', parentId: 'xx'}\n * ]\n */\n\n\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\n zrUtil.each(optionList, function (option) {\n if (!option) {\n return;\n }\n\n if (parentOption) {\n option.parentOption = parentOption;\n }\n\n result.push(option);\n var children = option.children;\n\n if (option.type === 'group' && children) {\n this._flatten(children, result, option);\n } // Deleting for JSON output, and for not affecting group creation.\n\n\n delete option.children;\n }, this);\n }; // FIXME\n // Pass to view using payload? setOption has a payload?\n\n\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\n var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming.\n\n this._elOptionsToUpdate = null;\n return els;\n };\n\n GraphicComponentModel.type = 'graphic';\n GraphicComponentModel.defaultOption = {\n elements: [] // parentId: null\n\n };\n return GraphicComponentModel;\n}(ComponentModel); // ------------------------\n// View\n// ------------------------\n\n\nvar GraphicComponentView =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentView, _super);\n\n function GraphicComponentView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentView.type;\n return _this;\n }\n\n GraphicComponentView.prototype.init = function () {\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\n // Having leveraged between use cases and algorithm complexity, a very\n // simple layout mechanism is used:\n // The size(width/height) can be determined by itself or its parent (not\n // implemented yet), but can not by its children. (Top-down travel)\n // The location(x/y) can be determined by the bounding rect of itself\n // (can including its descendants or not) and the size of its parent.\n // (Bottom-up travel)\n // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n // view will be reused.\n if (graphicModel !== this._lastGraphicModel) {\n this._clear();\n }\n\n this._lastGraphicModel = graphicModel;\n\n this._updateElements(graphicModel);\n\n this._relocate(graphicModel, api);\n };\n /**\n * Update graphic elements.\n */\n\n\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\n\n if (!elOptionsToUpdate) {\n return;\n }\n\n var elMap = this._elMap;\n var rootGroup = this.group; // Top-down tranverse to assign graphic settings to each elements.\n\n zrUtil.each(elOptionsToUpdate, function (elOption) {\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var elExisting = id != null ? elMap.get(id) : null;\n var parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\n var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;\n var elType = elOption.type;\n var elOptionStyle = elOption.style;\n\n if (elType === 'text' && elOptionStyle) {\n // In top/bottom mode, textVerticalAlign should not be used, which cause\n // inaccurately locating.\n if (elOption.hv && elOption.hv[1]) {\n elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;\n }\n }\n\n var textContentOption = elOption.textContent;\n var textConfig = elOption.textConfig;\n\n if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\n\n if (!textConfig && convertResult.textConfig) {\n textConfig = elOption.textConfig = convertResult.textConfig;\n }\n\n if (!textContentOption && convertResult.textContent) {\n textContentOption = convertResult.textContent;\n }\n } // Remove unnecessary props to avoid potential problems.\n\n\n var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed.\n\n if (process.env.NODE_ENV !== 'production') {\n elExisting && zrUtil.assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\n }\n\n var $action = elOption.$action || 'merge';\n\n if ($action === 'merge') {\n elExisting ? elExisting.attr(elOptionCleaned) : createEl(id, targetElParent, elOptionCleaned, elMap);\n } else if ($action === 'replace') {\n removeEl(elExisting, elMap);\n createEl(id, targetElParent, elOptionCleaned, elMap);\n } else if ($action === 'remove') {\n removeEl(elExisting, elMap);\n }\n\n var el = elMap.get(id);\n\n if (el && textContentOption) {\n if ($action === 'merge') {\n var textContentExisting = el.getTextContent();\n textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new graphicUtil.Text(textContentOption));\n } else if ($action === 'replace') {\n el.setTextContent(new graphicUtil.Text(textContentOption));\n }\n }\n\n if (el) {\n var elInner = inner(el);\n elInner.__ecGraphicWidthOption = elOption.width;\n elInner.__ecGraphicHeightOption = elOption.height;\n setEventData(el, graphicModel, elOption);\n graphicUtil.setTooltipConfig({\n el: el,\n componentModel: graphicModel,\n itemName: el.name,\n itemTooltipOption: elOption.tooltip\n });\n }\n });\n };\n /**\n * Locate graphic elements.\n */\n\n\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\n var elOptions = graphicModel.option.elements;\n var rootGroup = this.group;\n var elMap = this._elMap;\n var apiWidth = api.getWidth();\n var apiHeight = api.getHeight(); // Top-down to calculate percentage width/height of group\n\n for (var i = 0; i < elOptions.length; i++) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el || !el.isGroup) {\n continue;\n }\n\n var parentEl = el.parent;\n var isParentRoot = parentEl === rootGroup; // Like 'position:absolut' in css, default 0.\n\n var elInner = inner(el);\n var parentElInner = inner(parentEl);\n elInner.__ecGraphicWidth = parsePercent(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\n elInner.__ecGraphicHeight = parsePercent(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\n } // Bottom-up tranvese all elements (consider ec resize) to locate elements.\n\n\n for (var i = elOptions.length - 1; i >= 0; i--) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el) {\n continue;\n }\n\n var parentEl = el.parent;\n var parentElInner = inner(parentEl);\n var containerInfo = parentEl === rootGroup ? {\n width: apiWidth,\n height: apiHeight\n } : {\n width: parentElInner.__ecGraphicWidth,\n height: parentElInner.__ecGraphicHeight\n }; // PENDING\n // Currently, when `bounding: 'all'`, the union bounding rect of the group\n // does not include the rect of [0, 0, group.width, group.height], which\n // is probably weird for users. Should we make a break change for it?\n\n layoutUtil.positionElement(el, elOption, containerInfo, null, {\n hv: elOption.hv,\n boundingMode: elOption.bounding\n });\n }\n };\n /**\n * Clear all elements.\n */\n\n\n GraphicComponentView.prototype._clear = function () {\n var elMap = this._elMap;\n elMap.each(function (el) {\n removeEl(el, elMap);\n });\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.dispose = function () {\n this._clear();\n };\n\n GraphicComponentView.type = 'graphic';\n return GraphicComponentView;\n}(ComponentView);\n\nfunction createEl(id, targetElParent, elOption, elMap) {\n var graphicType = elOption.type;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(graphicType, 'graphic type MUST be set');\n }\n\n var Clz = zrUtil.hasOwn(_nonShapeGraphicElements, graphicType) // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n ? _nonShapeGraphicElements[graphicType] : graphicUtil.getShapeClass(graphicType);\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(Clz, 'graphic type can not be found');\n }\n\n var el = new Clz(elOption);\n targetElParent.add(el);\n elMap.set(id, el);\n inner(el).__ecGraphicId = id;\n}\n\nfunction removeEl(elExisting, elMap) {\n var existElParent = elExisting && elExisting.parent;\n\n if (existElParent) {\n elExisting.type === 'group' && elExisting.traverse(function (el) {\n removeEl(el, elMap);\n });\n elMap.removeKey(inner(elExisting).__ecGraphicId);\n existElParent.remove(elExisting);\n }\n} // Remove unnecessary props to avoid potential problems.\n\n\nfunction getCleanedElOption(elOption) {\n elOption = zrUtil.extend({}, elOption);\n zrUtil.each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(layoutUtil.LOCATION_PARAMS), function (name) {\n delete elOption[name];\n });\n return elOption;\n}\n\nfunction isSetLoc(obj, props) {\n var isSet;\n zrUtil.each(props, function (prop) {\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\n });\n return isSet;\n}\n\nfunction setKeyInfoToNewElOption(resultItem, newElOption) {\n var existElOption = resultItem.existing; // Set id and type after id assigned.\n\n newElOption.id = resultItem.keyInfo.id;\n !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified\n\n if (newElOption.parentId == null) {\n var newElParentOption = newElOption.parentOption;\n\n if (newElParentOption) {\n newElOption.parentId = newElParentOption.id;\n } else if (existElOption) {\n newElOption.parentId = existElOption.parentId;\n }\n } // Clear\n\n\n newElOption.parentOption = null;\n}\n\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\n // Update existing options, for `getOption` feature.\n var newElOptCopy = zrUtil.extend({}, newElOption);\n var existElOption = existList[index];\n var $action = newElOption.$action || 'merge';\n\n if ($action === 'merge') {\n if (existElOption) {\n if (process.env.NODE_ENV !== 'production') {\n var newType = newElOption.type;\n zrUtil.assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\n } // We can ensure that newElOptCopy and existElOption are not\n // the same object, so `merge` will not change newElOptCopy.\n\n\n zrUtil.merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize.\n\n layoutUtil.mergeLayoutParam(existElOption, newElOptCopy, {\n ignoreSize: true\n }); // Will be used in render.\n\n layoutUtil.copyLayoutParams(newElOption, existElOption);\n } else {\n existList[index] = newElOptCopy;\n }\n } else if ($action === 'replace') {\n existList[index] = newElOptCopy;\n } else if ($action === 'remove') {\n // null will be cleaned later.\n existElOption && (existList[index] = null);\n }\n}\n\nfunction setLayoutInfoToExist(existItem, newElOption) {\n if (!existItem) {\n return;\n }\n\n existItem.hv = newElOption.hv = [// Rigid body, dont care `width`.\n isSetLoc(newElOption, ['left', 'right']), // Rigid body, dont care `height`.\n isSetLoc(newElOption, ['top', 'bottom'])]; // Give default group size. Otherwise layout error may occur.\n\n if (existItem.type === 'group') {\n var existingGroupOpt = existItem;\n var newGroupOpt = newElOption;\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\n }\n}\n\nfunction setEventData(el, graphicModel, elOption) {\n var eventData = getECData(el).eventData; // Simple optimize for large amount of elements that no need event.\n\n if (!el.silent && !el.ignore && !eventData) {\n eventData = getECData(el).eventData = {\n componentType: 'graphic',\n componentIndex: graphicModel.componentIndex,\n name: el.name\n };\n } // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n\n\n if (eventData) {\n eventData.info = elOption.info;\n }\n}\n\nexport function install(registers) {\n registers.registerComponentModel(GraphicComponentModel);\n registers.registerComponentView(GraphicComponentView);\n registers.registerPreprocessor(preprocessor);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { indexOf, createHashMap, assert } from 'zrender/lib/core/util';\nexport var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single']; // Supported coords.\n// FIXME: polar has been broken (but rarely used).\n\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\nexport function isCoordSupported(seriesModel) {\n var coordType = seriesModel.get('coordinateSystem');\n return indexOf(SERIES_COORDS, coordType) >= 0;\n}\nexport function getAxisMainType(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'Axis';\n}\nexport function getAxisIndexPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisIndex';\n}\nexport function getAxisIdPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisId';\n}\n/**\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\n * This function finds all linked dataZoomModels start from the given payload.\n */\n\nexport function findEffectedDataZooms(ecModel, payload) {\n // Key: `DataZoomAxisDimension`\n var axisRecords = createHashMap();\n var effectedModels = []; // Key: uid of dataZoomModel\n\n var effectedModelMap = createHashMap(); // Find the dataZooms specified by payload.\n\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid)) {\n addToEffected(dataZoomModel);\n }\n }); // Start from the given dataZoomModels, travel the graph to find\n // all of the linked dataZoom models.\n\n var foundNewLink;\n\n do {\n foundNewLink = false;\n ecModel.eachComponent('dataZoom', processSingle);\n } while (foundNewLink);\n\n function processSingle(dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\n addToEffected(dataZoomModel);\n foundNewLink = true;\n }\n }\n\n function addToEffected(dataZoom) {\n effectedModelMap.set(dataZoom.uid, true);\n effectedModels.push(dataZoom);\n markAxisControlled(dataZoom);\n }\n\n function isLinked(dataZoomModel) {\n var isLink = false;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisIdxArr = axisRecords.get(axisDim);\n\n if (axisIdxArr && axisIdxArr[axisIndex]) {\n isLink = true;\n }\n });\n return isLink;\n }\n\n function markAxisControlled(dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\n });\n }\n\n return effectedModels;\n}\n/**\n * Find the first target coordinate system.\n * Available after model built.\n *\n * @return Like {\n * grid: [\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\n * ...\n * ], // cartesians must not be null/undefined.\n * polar: [\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\n * ...\n * ], // polars must not be null/undefined.\n * singleAxis: [\n * {model: coord0, axisModels: [], coordIndex: 0}\n * ]\n * }\n */\n\nexport function collectReferCoordSysModelInfo(dataZoomModel) {\n var ecModel = dataZoomModel.ecModel;\n var coordSysInfoWrap = {\n infoList: [],\n infoMap: createHashMap()\n };\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n\n if (!axisModel) {\n return;\n }\n\n var coordSysModel = axisModel.getCoordSysModel();\n\n if (!coordSysModel) {\n return;\n }\n\n var coordSysUid = coordSysModel.uid;\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\n\n if (!coordSysInfo) {\n coordSysInfo = {\n model: coordSysModel,\n axisModels: []\n };\n coordSysInfoWrap.infoList.push(coordSysInfo);\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\n }\n\n coordSysInfo.axisModels.push(axisModel);\n });\n return coordSysInfoWrap;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, createHashMap, merge, assert } from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS } from './helper';\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model';\n\nvar DataZoomAxisInfo =\n/** @class */\nfunction () {\n function DataZoomAxisInfo() {\n this.indexList = [];\n this.indexMap = [];\n }\n\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\n // Remove duplication.\n if (!this.indexMap[axisCmptIdx]) {\n this.indexList.push(axisCmptIdx);\n this.indexMap[axisCmptIdx] = true;\n }\n };\n\n return DataZoomAxisInfo;\n}();\n\nvar DataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(DataZoomModel, _super);\n\n function DataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomModel.type;\n _this._autoThrottle = true;\n _this._noTarget = true;\n /**\n * It is `[rangeModeForMin, rangeModeForMax]`.\n * The optional values for `rangeMode`:\n * + `'value'` mode: the axis extent will always be determined by\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\n * how data like and how `axis.min` and `axis.max` are.\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\n *\n * For example, when users are using dynamic data (update data periodically via `setOption`),\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\n */\n\n _this._rangePropMode = ['percent', 'percent'];\n return _this;\n }\n\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\n var inputRawOption = retrieveRawOption(option);\n /**\n * Suppose a \"main process\" start at the point that model prepared (that is,\n * model initialized or merged or method called in `action`).\n * We should keep the `main process` idempotent, that is, given a set of values\n * on `option`, we get the same result.\n *\n * But sometimes, values on `option` will be updated for providing users\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\n * should not be the base/input of the `main process`.\n *\n * So in that case we should save and keep the input of the `main process`\n * separately, called `settledOption`.\n *\n * For example, consider the case:\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\n * where the original input `option.startValue`, `option.endValue` are earsed by\n * calculated value.\n * (Step)2) click the legend to hide and show a series,\n * where the new range is calculated by the earsed `startValue` and `endValue`,\n * which brings incorrect result.\n */\n\n this.settledOption = inputRawOption;\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype.mergeOption = function (newOption) {\n var inputRawOption = retrieveRawOption(newOption); //FIX #2591\n\n merge(this.option, newOption, true);\n merge(this.settledOption, inputRawOption, true);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype._doInit = function (inputRawOption) {\n var thisOption = this.option; // if (!env.canvasSupported) {\n // thisOption.realtime = false;\n // }\n\n this._setDefaultThrottle(inputRawOption);\n\n this._updateRangeUse(inputRawOption);\n\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n // start/end has higher priority over startValue/endValue if they\n // both set, but we should make chart.setOption({endValue: 1000})\n // effective, rather than chart.setOption({endValue: 1000, end: null}).\n if (this._rangePropMode[index] === 'value') {\n thisOption[names[0]] = settledOption[names[0]] = null;\n } // Otherwise do nothing and use the merge result.\n\n }, this);\n\n this._resetTarget();\n };\n\n DataZoomModel.prototype._resetTarget = function () {\n var optionOrient = this.get('orient', true);\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\n\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\n\n if (hasAxisSpecified) {\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\n } else {\n this._orient = optionOrient || 'horizontal';\n\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\n }\n\n this._noTarget = true;\n targetAxisIndexMap.each(function (axisInfo) {\n if (axisInfo.indexList.length) {\n this._noTarget = false;\n }\n }, this);\n };\n\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\n var hasAxisSpecified = false;\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); // When user set axisIndex as a empty array, we think that user specify axisIndex\n // but do not want use auto mode. Because empty array may be encountered when\n // some error occured.\n\n if (!refering.specified) {\n return;\n }\n\n hasAxisSpecified = true;\n var axisInfo = new DataZoomAxisInfo();\n each(refering.models, function (axisModel) {\n axisInfo.add(axisModel.componentIndex);\n });\n targetAxisIndexMap.set(axisDim, axisInfo);\n }, this);\n return hasAxisSpecified;\n };\n\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\n var ecModel = this.ecModel;\n var needAuto = true; // Find axis that parallel to dataZoom as default.\n\n if (needAuto) {\n var axisDim = orient === 'vertical' ? 'y' : 'x';\n var axisModels = ecModel.findComponents({\n mainType: axisDim + 'Axis'\n });\n setParallelAxis(axisModels, axisDim);\n } // Find axis that parallel to dataZoom as default.\n\n\n if (needAuto) {\n var axisModels = ecModel.findComponents({\n mainType: 'singleAxis',\n filter: function (axisModel) {\n return axisModel.get('orient', true) === orient;\n }\n });\n setParallelAxis(axisModels, 'single');\n }\n\n function setParallelAxis(axisModels, axisDim) {\n // At least use the first parallel axis as the target axis.\n var axisModel = axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModel.componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false; // Find parallel axes in the same grid.\n\n if (axisDim === 'x' || axisDim === 'y') {\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n gridModel_1 && each(axisModels, function (axModel) {\n if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\n axisInfo.add(axModel.componentIndex);\n }\n });\n }\n }\n\n if (needAuto) {\n // If no parallel axis, find the first category axis as default. (Also consider polar).\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n if (!needAuto) {\n return;\n }\n\n var axisModels = ecModel.findComponents({\n mainType: getAxisMainType(axisDim),\n filter: function (axisModel) {\n return axisModel.get('type', true) === 'category';\n }\n });\n\n if (axisModels[0]) {\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModels[0].componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false;\n }\n }, this);\n }\n };\n\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\n var dim; // Find the first axis\n\n this.eachTargetAxis(function (axisDim) {\n !dim && (dim = axisDim);\n }, this);\n return dim === 'y' ? 'vertical' : 'horizontal';\n };\n\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\n // When first time user set throttle, auto throttle ends.\n if (inputRawOption.hasOwnProperty('throttle')) {\n this._autoThrottle = false;\n }\n\n if (this._autoThrottle) {\n var globalOption = this.ecModel.option;\n this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;\n }\n };\n\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\n var rangePropMode = this._rangePropMode;\n var rangeModeInOption = this.get('rangeMode');\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n var percentSpecified = inputRawOption[names[0]] != null;\n var valueSpecified = inputRawOption[names[1]] != null;\n\n if (percentSpecified && !valueSpecified) {\n rangePropMode[index] = 'percent';\n } else if (!percentSpecified && valueSpecified) {\n rangePropMode[index] = 'value';\n } else if (rangeModeInOption) {\n rangePropMode[index] = rangeModeInOption[index];\n } else if (percentSpecified) {\n // percentSpecified && valueSpecified\n rangePropMode[index] = 'percent';\n } // else remain its original setting.\n\n });\n };\n\n DataZoomModel.prototype.noTarget = function () {\n return this._noTarget;\n };\n\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\n var firstAxisModel;\n this.eachTargetAxis(function (axisDim, axisIndex) {\n if (firstAxisModel == null) {\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n }, this);\n return firstAxisModel;\n };\n /**\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\n */\n\n\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\n each(axisInfo.indexList, function (axisIndex) {\n callback.call(context, axisDim, axisIndex);\n });\n });\n };\n /**\n * @return If not found, return null/undefined.\n */\n\n\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\n var axisModel = this.getAxisModel(axisDim, axisIndex);\n\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n }\n };\n /**\n * @return If not found, return null/undefined.\n */\n\n\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim && axisIndex != null);\n }\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n };\n /**\n * If not specified, set to undefined.\n */\n\n\n DataZoomModel.prototype.setRawRange = function (opt) {\n var thisOption = this.option;\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\n // Consider the pair <start, startValue>:\n // If one has value and the other one is `null/undefined`, we both set them\n // to `settledOption`. This strategy enables the feature to clear the original\n // value in `settledOption` to `null/undefined`.\n // But if both of them are `null/undefined`, we do not set them to `settledOption`\n // and keep `settledOption` with the original value. This strategy enables users to\n // only set <end or endValue> but not set <start or startValue> when calling\n // `dispatchAction`.\n // The pair <end, endValue> is treated in the same way.\n if (opt[names[0]] != null || opt[names[1]] != null) {\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\n }\n }, this);\n\n this._updateRangeUse(opt);\n };\n\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\n var option = this.option;\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\n option[name] = opt[name];\n });\n };\n\n DataZoomModel.prototype.getPercentRange = function () {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataPercentWindow();\n }\n };\n /**\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\n *\n * @return [startValue, endValue] value can only be '-' or finite number.\n */\n\n\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\n if (axisDim == null && axisIndex == null) {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataValueWindow();\n }\n } else {\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\n }\n };\n /**\n * @param axisModel If axisModel given, find axisProxy\n * corresponding to the axisModel\n */\n\n\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n } // Find the first hosted axisProxy\n\n\n var firstProxy;\n\n var axisDimList = this._targetAxisInfoMap.keys();\n\n for (var i = 0; i < axisDimList.length; i++) {\n var axisDim = axisDimList[i];\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n for (var j = 0; j < axisInfo.indexList.length; j++) {\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\n\n if (proxy.hostedBy(this)) {\n return proxy;\n }\n\n if (!firstProxy) {\n firstProxy = proxy;\n }\n }\n } // If no hosted proxy found, still need to return a proxy.\n // This case always happens in toolbox dataZoom, where axes are all hosted by\n // other dataZooms.\n\n\n return firstProxy;\n };\n\n DataZoomModel.prototype.getRangePropMode = function () {\n return this._rangePropMode.slice();\n };\n\n DataZoomModel.prototype.getOrient = function () {\n if (process.env.NODE_ENV !== 'production') {\n // Should not be called before initialized.\n assert(this._orient);\n }\n\n return this._orient;\n };\n\n DataZoomModel.type = 'dataZoom';\n DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'];\n DataZoomModel.defaultOption = {\n zlevel: 0,\n z: 4,\n filterMode: 'filter',\n start: 0,\n end: 100\n };\n return DataZoomModel;\n}(ComponentModel);\n/**\n * Retrieve the those raw params from option, which will be cached separately.\n * becasue they will be overwritten by normalized/calculated values in the main\n * process.\n */\n\n\nfunction retrieveRawOption(option) {\n var ret = {};\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n}\n\nexport default DataZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel';\n\nvar SelectDataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomModel, _super);\n\n function SelectDataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomModel.type;\n return _this;\n }\n\n SelectDataZoomModel.type = 'dataZoom.select';\n return SelectDataZoomModel;\n}(DataZoomModel);\n\nexport default SelectDataZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component';\n\nvar DataZoomView =\n/** @class */\nfunction (_super) {\n __extends(DataZoomView, _super);\n\n function DataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomView.type;\n return _this;\n }\n\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n this.dataZoomModel = dataZoomModel;\n this.ecModel = ecModel;\n this.api = api;\n };\n\n DataZoomView.type = 'dataZoom';\n return DataZoomView;\n}(ComponentView);\n\nexport default DataZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView';\n\nvar SelectDataZoomView =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomView, _super);\n\n function SelectDataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomView.type;\n return _this;\n }\n\n SelectDataZoomView.type = 'dataZoom.select';\n return SelectDataZoomView;\n}(DataZoomView);\n\nexport default SelectDataZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as numberUtil from '../../util/number';\nimport sliderMove from '../helper/sliderMove';\nimport { unionAxisExtentFromData } from '../../coord/axisHelper';\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo';\nimport { getAxisMainType, isCoordSupported } from './helper';\nimport { SINGLE_REFERRING } from '../../util/model';\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\n/**\n * Operate single axis.\n * One axis can only operated by one axis operator.\n * Different dataZoomModels may be defined to operate the same axis.\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\n * So dataZoomModels share one axisProxy in that case.\n */\n\nvar AxisProxy =\n/** @class */\nfunction () {\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\n this._dimName = dimName;\n this._axisIndex = axisIndex;\n this.ecModel = ecModel;\n this._dataZoomModel = dataZoomModel; // /**\n // * @readOnly\n // * @private\n // */\n // this.hasSeriesStacked;\n }\n /**\n * Whether the axisProxy is hosted by dataZoomModel.\n */\n\n\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\n return this._dataZoomModel === dataZoomModel;\n };\n /**\n * @return Value can only be NaN or finite value.\n */\n\n\n AxisProxy.prototype.getDataValueWindow = function () {\n return this._valueWindow.slice();\n };\n /**\n * @return {Array.<number>}\n */\n\n\n AxisProxy.prototype.getDataPercentWindow = function () {\n return this._percentWindow.slice();\n };\n\n AxisProxy.prototype.getTargetSeriesModels = function () {\n var seriesModels = [];\n this.ecModel.eachSeries(function (seriesModel) {\n if (isCoordSupported(seriesModel)) {\n var axisMainType = getAxisMainType(this._dimName);\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\n\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\n seriesModels.push(seriesModel);\n }\n }\n }, this);\n return seriesModels;\n };\n\n AxisProxy.prototype.getAxisModel = function () {\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\n };\n\n AxisProxy.prototype.getMinMaxSpan = function () {\n return zrUtil.clone(this._minMaxSpan);\n };\n /**\n * Only calculate by given range and this._dataExtent, do not change anything.\n */\n\n\n AxisProxy.prototype.calculateDataWindow = function (opt) {\n var dataExtent = this._dataExtent;\n var axisModel = this.getAxisModel();\n var scale = axisModel.axis.scale;\n\n var rangePropMode = this._dataZoomModel.getRangePropMode();\n\n var percentExtent = [0, 100];\n var percentWindow = [];\n var valueWindow = [];\n var hasPropModeValue;\n each(['start', 'end'], function (prop, idx) {\n var boundPercent = opt[prop];\n var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n // but not min/max of axis, which will be calculated by data window then).\n // The former one is suitable for cases that a dataZoom component controls multiple\n // axes with different unit or extent, and the latter one is suitable for accurate\n // zoom by pixel (e.g., in dataZoomSelect).\n // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n // only when setOption or dispatchAction, otherwise it remains its original value.\n // (Why not only record `percentProp` and always map to `valueProp`? Because\n // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n // `valueProp`. consider two axes constrolled by one dataZoom. They have different\n // data extent. All of values that are overflow the `dataExtent` will be calculated\n // to percent '100%').\n\n if (rangePropMode[idx] === 'percent') {\n boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis.\n\n boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));\n } else {\n hasPropModeValue = true;\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because\n // This calculation can not be inversed, because all of values that\n // are overflow the `dataExtent` will be calculated to percent '100%'\n\n boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);\n } // valueWindow[idx] = round(boundValue);\n // percentWindow[idx] = round(boundPercent);\n\n\n valueWindow[idx] = boundValue;\n percentWindow[idx] = boundPercent;\n });\n asc(valueWindow);\n asc(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent,\n // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window\n // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n // where API is able to initialize/modify the window size even though `zoomLock`\n // specified.\n\n var spans = this._minMaxSpan;\n hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\n\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\n var suffix = toValue ? 'Span' : 'ValueSpan';\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\n\n for (var i = 0; i < 2; i++) {\n toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\n }\n }\n\n return {\n valueWindow: valueWindow,\n percentWindow: percentWindow\n };\n };\n /**\n * Notice: reset should not be called before series.restoreData() called,\n * so it is recommanded to be called in \"process stage\" but not \"model init\n * stage\".\n */\n\n\n AxisProxy.prototype.reset = function (dataZoomModel) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them.\n\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // this.hasSeriesStacked = false;\n // each(targetSeries, function (series) {\n // let data = series.getData();\n // let dataDim = data.mapDimension(this._dimName);\n // let stackedDimension = data.getCalculationInfo('stackedDimension');\n // if (stackedDimension && stackedDimension === dataDim) {\n // this.hasSeriesStacked = true;\n // }\n // }, this);\n // `calculateDataWindow` uses min/maxSpan.\n\n this._updateMinMaxSpan();\n\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\n this._valueWindow = dataWindow.valueWindow;\n this._percentWindow = dataWindow.percentWindow; // Update axis setting then.\n\n this._setAxisModel();\n };\n\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var axisDim = this._dimName;\n var seriesModels = this.getTargetSeriesModels();\n var filterMode = dataZoomModel.get('filterMode');\n var valueWindow = this._valueWindow;\n\n if (filterMode === 'none') {\n return;\n } // FIXME\n // Toolbox may has dataZoom injected. And if there are stacked bar chart\n // with NaN data, NaN will be filtered and stack will be wrong.\n // So we need to force the mode to be set empty.\n // In fect, it is not a big deal that do not support filterMode-'filter'\n // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n // selection\" some day, which might need \"adapt to data extent on the\n // otherAxis\", which is disabled by filterMode-'empty'.\n // But currently, stack has been fixed to based on value but not index,\n // so this is not an issue any more.\n // let otherAxisModel = this.getOtherAxisModel();\n // if (dataZoomModel.get('$fromToolbox')\n // && otherAxisModel\n // && otherAxisModel.hasSeriesStacked\n // ) {\n // filterMode = 'empty';\n // }\n // TODO\n // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\n\n\n each(seriesModels, function (seriesModel) {\n var seriesData = seriesModel.getData();\n var dataDims = seriesData.mapDimensionsAll(axisDim);\n\n if (!dataDims.length) {\n return;\n }\n\n if (filterMode === 'weakFilter') {\n seriesData.filterSelf(function (dataIndex) {\n var leftOut;\n var rightOut;\n var hasValue;\n\n for (var i = 0; i < dataDims.length; i++) {\n var value = seriesData.get(dataDims[i], dataIndex);\n var thisHasValue = !isNaN(value);\n var thisLeftOut = value < valueWindow[0];\n var thisRightOut = value > valueWindow[1];\n\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\n return true;\n }\n\n thisHasValue && (hasValue = true);\n thisLeftOut && (leftOut = true);\n thisRightOut && (rightOut = true);\n } // If both left out and right out, do not filter.\n\n\n return hasValue && leftOut && rightOut;\n });\n } else {\n each(dataDims, function (dim) {\n if (filterMode === 'empty') {\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\n return !isInWindow(value) ? NaN : value;\n }));\n } else {\n var range = {};\n range[dim] = valueWindow; // console.time('select');\n\n seriesData.selectRange(range); // console.timeEnd('select');\n }\n });\n }\n\n each(dataDims, function (dim) {\n seriesData.setApproximateExtent(valueWindow, dim);\n });\n });\n\n function isInWindow(value) {\n return value >= valueWindow[0] && value <= valueWindow[1];\n }\n };\n\n AxisProxy.prototype._updateMinMaxSpan = function () {\n var minMaxSpan = this._minMaxSpan = {};\n var dataZoomModel = this._dataZoomModel;\n var dataExtent = this._dataExtent;\n each(['min', 'max'], function (minMax) {\n var percentSpan = dataZoomModel.get(minMax + 'Span');\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\n\n if (valueSpan != null) {\n percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\n } else if (percentSpan != null) {\n valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\n }\n\n minMaxSpan[minMax + 'Span'] = percentSpan;\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\n }, this);\n };\n\n AxisProxy.prototype._setAxisModel = function () {\n var axisModel = this.getAxisModel();\n var percentWindow = this._percentWindow;\n var valueWindow = this._valueWindow;\n\n if (!percentWindow) {\n return;\n } // [0, 500]: arbitrary value, guess axis extent.\n\n\n var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\n precision = Math.min(precision, 20); // For value axis, if min/max/scale are not set, we just use the extent obtained\n // by series data, which may be a little different from the extent calculated by\n // `axisHelper.getScaleExtent`. But the different just affects the experience a\n // little when zooming. So it will not be fixed until some users require it strongly.\n\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\n\n if (percentWindow[0] !== 0) {\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\n }\n\n if (percentWindow[1] !== 100) {\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\n }\n\n rawExtentInfo.freeze();\n };\n\n return AxisProxy;\n}();\n\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\n var dataExtent = [Infinity, -Infinity];\n each(seriesModels, function (seriesModel) {\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\n }); // It is important to get \"consistent\" extent when more then one axes is\n // controlled by a `dataZoom`, otherwise those axes will not be synchronized\n // when zooming. But it is difficult to know what is \"consistent\", considering\n // axes have different type or even different meanings (For example, two\n // time axes are used to compare data of the same date in different years).\n // So basically dataZoom just obtains extent by series.data (in category axis\n // extent can be obtained from axis.data).\n // Nevertheless, user can set min/max/scale on axes to make extent of axes\n // consistent.\n\n var axisModel = axisProxy.getAxisModel();\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\n return [rawExtentResult.min, rawExtentResult.max];\n}\n\nexport default AxisProxy;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util';\nimport { getAxisMainType } from './helper';\nimport AxisProxy from './AxisProxy';\nvar dataZoomProcessor = {\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n function eachAxisModel(cb) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\n });\n });\n } // FIXME: it brings side-effect to `getTargetSeries`.\n // Prepare axis proxies.\n\n\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // dispose all last axis proxy, in case that some axis are deleted.\n axisModel.__dzAxisProxy = null;\n });\n var proxyList = [];\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // Different dataZooms may constrol the same axis. In that case,\n // an axisProxy serves both of them.\n if (!axisModel.__dzAxisProxy) {\n // Use the first dataZoomModel as the main model of axisProxy.\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\n proxyList.push(axisModel.__dzAxisProxy);\n }\n });\n var seriesModelMap = createHashMap();\n each(proxyList, function (axisProxy) {\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n return seriesModelMap;\n },\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\n }); // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setCalculatedRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n });\n }\n });\n }\n};\nexport default dataZoomProcessor;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { findEffectedDataZooms } from './helper';\nimport { each } from 'zrender/lib/core/util';\nexport default function installDataZoomAction(registers) {\n registers.registerAction('dataZoom', function (payload, ecModel) {\n var effectedModels = findEffectedDataZooms(ecModel, payload);\n each(effectedModels, function (dataZoomModel) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport dataZoomProcessor from './dataZoomProcessor';\nimport installDataZoomAction from './dataZoomAction';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\n installDataZoomAction(registers);\n registers.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SelectZoomModel from './SelectZoomModel';\nimport SelectZoomView from './SelectZoomView';\nimport installCommon from './installCommon';\nexport function install(registers) {\n registers.registerComponentModel(SelectZoomModel);\n registers.registerComponentView(SelectZoomView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nvar ToolboxFeature =\n/** @class */\nfunction () {\n function ToolboxFeature() {}\n\n return ToolboxFeature;\n}();\n\nexport { ToolboxFeature };\nvar features = {};\nexport function registerFeature(name, ctor) {\n features[name] = ctor;\n}\nexport function getFeature(name) {\n return features[name];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as featureManager from './featureManager';\nimport ComponentModel from '../../model/Component';\n\nvar ToolboxModel =\n/** @class */\nfunction (_super) {\n __extends(ToolboxModel, _super);\n\n function ToolboxModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ToolboxModel.type;\n return _this;\n }\n\n ToolboxModel.prototype.optionUpdated = function () {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n var ecModel = this.ecModel;\n zrUtil.each(this.option.feature, function (featureOpt, featureName) {\n var Feature = featureManager.getFeature(featureName);\n\n if (Feature) {\n if (Feature.getDefaultOption) {\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\n }\n\n zrUtil.merge(featureOpt, Feature.defaultOption);\n }\n });\n };\n\n ToolboxModel.type = 'toolbox';\n ToolboxModel.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n ToolboxModel.defaultOption = {\n show: true,\n z: 6,\n zlevel: 0,\n orient: 'horizontal',\n left: 'right',\n top: 'top',\n // right\n // bottom\n backgroundColor: 'transparent',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemSize: 15,\n itemGap: 8,\n showTitle: true,\n iconStyle: {\n borderColor: '#666',\n color: 'none'\n },\n emphasis: {\n iconStyle: {\n borderColor: '#3E98C5'\n }\n },\n // textStyle: {},\n // feature\n tooltip: {\n show: false,\n position: 'bottom'\n }\n };\n return ToolboxModel;\n}(ComponentModel);\n\nexport default ToolboxModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport { getLayoutRect, box as layoutBox, positionElement } from '../../util/layout';\nimport * as formatUtil from '../../util/format';\nimport * as graphic from '../../util/graphic';\n/**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */\n\nexport function layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\nexport function makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as textContain from 'zrender/lib/contain/text';\nimport * as graphic from '../../util/graphic';\nimport { enterEmphasis, leaveEmphasis } from '../../util/states';\nimport Model from '../../model/Model';\nimport DataDiffer from '../../data/DataDiffer';\nimport * as listComponentHelper from '../helper/listComponent';\nimport ComponentView from '../../view/Component';\nimport { ToolboxFeature, getFeature } from './featureManager';\nimport { getUID } from '../../util/component';\nimport ZRText from 'zrender/lib/graphic/Text';\n\nvar ToolboxView =\n/** @class */\nfunction (_super) {\n __extends(ToolboxView, _super);\n\n function ToolboxView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n\n if (!toolboxModel.get('show')) {\n return;\n }\n\n var itemSize = +toolboxModel.get('itemSize');\n var featureOpts = toolboxModel.get('feature') || {};\n var features = this._features || (this._features = {});\n var featureNames = [];\n zrUtil.each(featureOpts, function (opt, name) {\n featureNames.push(name);\n });\n new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute(); // Keep for diff.\n\n this._featureNames = featureNames;\n\n function processFeature(newIndex, oldIndex) {\n var featureName = featureNames[newIndex];\n var oldName = featureNames[oldIndex];\n var featureOpt = featureOpts[featureName];\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\n var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\n\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\n featureOpt.title = payload.newTitle;\n }\n\n if (featureName && !oldName) {\n // Create\n if (isUserFeatureName(featureName)) {\n feature = {\n onclick: featureModel.option.onclick,\n featureName: featureName\n };\n } else {\n var Feature = getFeature(featureName);\n\n if (!Feature) {\n return;\n }\n\n feature = new Feature();\n }\n\n features[featureName] = feature;\n } else {\n feature = features[oldName]; // If feature does not exsit.\n\n if (!feature) {\n return;\n }\n }\n\n feature.uid = getUID('toolbox-feature');\n feature.model = featureModel;\n feature.ecModel = ecModel;\n feature.api = api;\n\n if (feature instanceof ToolboxFeature) {\n if (!featureName && oldName) {\n feature.dispose && feature.dispose(ecModel, api);\n return;\n }\n\n if (!featureModel.get('show') || feature.unusable) {\n feature.remove && feature.remove(ecModel, api);\n return;\n }\n }\n\n createIconPaths(featureModel, feature, featureName);\n\n featureModel.setIconStatus = function (iconName, status) {\n var option = this.option;\n var iconPaths = this.iconPaths;\n option.iconStatus = option.iconStatus || {};\n option.iconStatus[iconName] = status;\n\n if (iconPaths[iconName]) {\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\n }\n };\n\n if (feature instanceof ToolboxFeature) {\n if (feature.render) {\n feature.render(featureModel, ecModel, api, payload);\n }\n }\n }\n\n function createIconPaths(featureModel, feature, featureName) {\n var iconStyleModel = featureModel.getModel('iconStyle');\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); // If one feature has mutiple icon. they are orginaized as\n // {\n // icon: {\n // foo: '',\n // bar: ''\n // },\n // title: {\n // foo: '',\n // bar: ''\n // }\n // }\n\n var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon');\n var titles = featureModel.get('title') || {};\n var iconsMap;\n var titlesMap;\n\n if (typeof icons === 'string') {\n iconsMap = {};\n iconsMap[featureName] = icons;\n } else {\n iconsMap = icons;\n }\n\n if (typeof titles === 'string') {\n titlesMap = {};\n titlesMap[featureName] = titles;\n } else {\n titlesMap = titles;\n }\n\n var iconPaths = featureModel.iconPaths = {};\n zrUtil.each(iconsMap, function (iconStr, iconName) {\n var path = graphic.createIcon(iconStr, {}, {\n x: -itemSize / 2,\n y: -itemSize / 2,\n width: itemSize,\n height: itemSize\n }); // TODO handling image\n\n path.setStyle(iconStyleModel.getItemStyle());\n var pathEmphasisState = path.ensureState('emphasis');\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); // Text position calculation\n\n var textContent = new ZRText({\n style: {\n text: titlesMap[iconName],\n align: iconStyleEmphasisModel.get('textAlign'),\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\n padding: iconStyleEmphasisModel.get('textPadding'),\n fill: null\n },\n ignore: true\n });\n path.setTextContent(textContent);\n graphic.setTooltipConfig({\n el: path,\n componentModel: toolboxModel,\n itemName: iconName,\n formatterParamsExtra: {\n title: titlesMap[iconName]\n }\n }); // graphic.enableHoverEmphasis(path);\n\n path.__title = titlesMap[iconName];\n path.on('mouseover', function () {\n // Should not reuse above hoverStyle, which might be modified.\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical' ? toolboxModel.get('right') == null ? 'right' : 'left' : toolboxModel.get('bottom') == null ? 'bottom' : 'top';\n textContent.setStyle({\n fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\n });\n path.setTextConfig({\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\n });\n textContent.ignore = !toolboxModel.get('showTitle'); // Use enterEmphasis and leaveEmphasis provide by ec.\n // There are flags managed by the echarts.\n\n enterEmphasis(this);\n }).on('mouseout', function () {\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\n leaveEmphasis(this);\n }\n\n textContent.hide();\n });\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\n group.add(path);\n path.on('click', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName));\n iconPaths[iconName] = path;\n });\n }\n\n listComponentHelper.layout(group, toolboxModel, api); // Render background after group is layout\n // FIXME\n\n group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen\n\n group.eachChild(function (icon) {\n var titleText = icon.__title; // const hoverStyle = icon.hoverStyle;\n // TODO simplify code?\n\n var emphasisState = icon.ensureState('emphasis');\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\n var textContent = icon.getTextContent();\n var emphasisTextState = textContent && textContent.states.emphasis; // May be background element\n\n if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\n var rect = textContain.getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\n var offsetX = icon.x + group.x;\n var offsetY = icon.y + group.y + itemSize;\n var needPutOnTop = false;\n\n if (offsetY + rect.height > api.getHeight()) {\n emphasisTextConfig.position = 'top';\n needPutOnTop = true;\n }\n\n var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 8;\n\n if (offsetX + rect.width / 2 > api.getWidth()) {\n emphasisTextConfig.position = ['100%', topOffset];\n emphasisTextStyle.align = 'right';\n } else if (offsetX - rect.width / 2 < 0) {\n emphasisTextConfig.position = [0, topOffset];\n emphasisTextStyle.align = 'left';\n }\n }\n });\n };\n\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\n });\n }; // updateLayout(toolboxModel, ecModel, api, payload) {\n // zrUtil.each(this._features, function (feature) {\n // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n // });\n // },\n\n\n ToolboxView.prototype.remove = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);\n });\n this.group.removeAll();\n };\n\n ToolboxView.prototype.dispose = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n });\n };\n\n ToolboxView.type = 'toolbox';\n return ToolboxView;\n}(ComponentView);\n\nfunction isUserFeatureName(featureName) {\n return featureName.indexOf('my') === 0;\n}\n\nexport default ToolboxView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Uint8Array */\n\nimport env from 'zrender/lib/core/env';\nimport { ToolboxFeature } from '../featureManager';\n\nvar SaveAsImage =\n/** @class */\nfunction (_super) {\n __extends(SaveAsImage, _super);\n\n function SaveAsImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n SaveAsImage.prototype.onclick = function (ecModel, api) {\n var model = this.model;\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\n var isSvg = api.getZr().painter.getType() === 'svg';\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\n var url = api.getConnectedDataURL({\n type: type,\n backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\n excludeComponents: model.get('excludeComponents'),\n pixelRatio: model.get('pixelRatio')\n }); // Chrome, Firefox, New Edge\n\n if (typeof MouseEvent === 'function' && (env.browser.newEdge || !env.browser.ie && !env.browser.edge)) {\n var $a = document.createElement('a');\n $a.download = title + '.' + type;\n $a.target = '_blank';\n $a.href = url;\n var evt = new MouseEvent('click', {\n // some micro front-end framework, window maybe is a Proxy\n view: document.defaultView,\n bubbles: true,\n cancelable: false\n });\n $a.dispatchEvent(evt);\n } // IE or old Edge\n else {\n if (window.navigator.msSaveOrOpenBlob || isSvg) {\n var parts = url.split(','); // data:[<mime type>][;charset=<charset>][;base64],<encoded data>\n\n var base64Encoded = parts[0].indexOf('base64') > -1;\n var bstr = isSvg // should decode the svg data uri first\n ? decodeURIComponent(parts[1]) : parts[1]; // only `atob` when the data uri is encoded with base64\n // otherwise, like `svg` data uri exported by zrender,\n // there will be an error, for it's not encoded with base64.\n // (just a url-encoded string through `encodeURIComponent`)\n\n base64Encoded && (bstr = atob(bstr));\n var filename = title + '.' + type;\n\n if (window.navigator.msSaveOrOpenBlob) {\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n var blob = new Blob([u8arr]);\n window.navigator.msSaveOrOpenBlob(blob, filename);\n } else {\n var frame = document.createElement('iframe');\n document.body.appendChild(frame);\n var cw = frame.contentWindow;\n var doc = cw.document;\n doc.open('image/svg+xml', 'replace');\n doc.write(bstr);\n doc.close();\n cw.focus();\n doc.execCommand('SaveAs', true, filename);\n document.body.removeChild(frame);\n }\n } else {\n var lang = model.get('lang');\n var html = '' + '<body style=\"margin:0;\">' + '<img src=\"' + url + '\" style=\"max-width:100%;\" title=\"' + (lang && lang[0] || '') + '\" />' + '</body>';\n var tab = window.open();\n tab.document.write(html);\n tab.document.title = title;\n }\n }\n };\n\n SaveAsImage.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\n type: 'png',\n // Default use option.backgroundColor\n // backgroundColor: '#fff',\n connectedBackgroundColor: '#fff',\n name: '',\n excludeComponents: ['toolbox'],\n // use current pixel ratio of device by default\n // pixelRatio: 1,\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\n };\n return defaultOption;\n };\n\n return SaveAsImage;\n}(ToolboxFeature);\n\nSaveAsImage.prototype.unusable = !env.canvasSupported;\nexport default SaveAsImage;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { ToolboxFeature } from '../featureManager';\nimport { SINGLE_REFERRING } from '../../../util/model';\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\nvar ICON_TYPES = ['line', 'bar', 'stack']; // stack and tiled appears in pair for the title\n\nvar TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'];\nvar radioTypes = [['line', 'bar'], ['stack']];\n\nvar MagicType =\n/** @class */\nfunction (_super) {\n __extends(MagicType, _super);\n\n function MagicType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n MagicType.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon');\n var icons = {};\n zrUtil.each(model.get('type'), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n MagicType.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: [],\n // Icon group\n icon: {\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\n // eslint-disable-next-line\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line\n\n },\n // `line`, `bar`, `stack`, `tiled`\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\n option: {},\n seriesIndex: {}\n };\n return defaultOption;\n };\n\n MagicType.prototype.onclick = function (ecModel, api, type) {\n var model = this.model;\n var seriesIndex = model.get(['seriesIndex', type]); // Not supported magicType\n\n if (!seriesOptGenreator[type]) {\n return;\n }\n\n var newOption = {\n series: []\n };\n\n var generateNewSeriesTypes = function (seriesModel) {\n var seriesType = seriesModel.subType;\n var seriesId = seriesModel.id;\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\n\n if (newSeriesOpt) {\n // PENDING If merge original option?\n zrUtil.defaults(newSeriesOpt, seriesModel.option);\n newOption.series.push(newSeriesOpt);\n } // Modify boundaryGap\n\n\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (categoryAxis) {\n var axisDim = categoryAxis.dim;\n var axisType = axisDim + 'Axis';\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n var axisIndex = axisModel.componentIndex;\n newOption[axisType] = newOption[axisType] || [];\n\n for (var i = 0; i <= axisIndex; i++) {\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\n }\n\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\n }\n }\n };\n\n zrUtil.each(radioTypes, function (radio) {\n if (zrUtil.indexOf(radio, type) >= 0) {\n zrUtil.each(radio, function (item) {\n model.setIconStatus(item, 'normal');\n });\n }\n });\n model.setIconStatus(type, 'emphasis');\n ecModel.eachComponent({\n mainType: 'series',\n query: seriesIndex == null ? null : {\n seriesIndex: seriesIndex\n }\n }, generateNewSeriesTypes);\n var newTitle; // Change title of stack\n\n if (type === 'stack') {\n // use titles in model instead of ecModel\n // as stack and tiled appears in pair, just flip them\n // no need of checking stack state\n newTitle = zrUtil.merge({\n stack: model.option.title.tiled,\n tiled: model.option.title.stack\n }, model.option.title);\n }\n\n api.dispatchAction({\n type: 'changeMagicType',\n currentType: type,\n newOption: newOption,\n newTitle: newTitle,\n featureName: 'magicType'\n });\n };\n\n return MagicType;\n}(ToolboxFeature);\n\nvar seriesOptGenreator = {\n 'line': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'bar') {\n return zrUtil.merge({\n id: seriesId,\n type: 'line',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'line']) || {}, true);\n }\n },\n 'bar': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'line') {\n return zrUtil.merge({\n id: seriesId,\n type: 'bar',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'bar']) || {}, true);\n }\n },\n 'stack': function (seriesType, seriesId, seriesModel, model) {\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\n\n if (seriesType === 'line' || seriesType === 'bar') {\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\n return zrUtil.merge({\n id: seriesId,\n stack: isStack ? '' : INNER_STACK_KEYWORD\n }, model.get(['option', 'stack']) || {}, true);\n }\n }\n}; // TODO: SELF REGISTERED.\n\necharts.registerAction({\n type: 'changeMagicType',\n event: 'magicTypeChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.mergeOption(payload.newOption);\n});\nexport default MagicType;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts';\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { ToolboxFeature } from '../featureManager';\nimport { addEventListener } from 'zrender/lib/core/event';\nvar BLOCK_SPLITER = new Array(60).join('-');\nvar ITEM_SPLITER = '\\t';\n/**\n * Group series into two types\n * 1. on category axis, like line, bar\n * 2. others, like scatter, pie\n */\n\nfunction groupSeries(ecModel) {\n var seriesGroupByCategoryAxis = {};\n var otherSeries = [];\n var meta = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\n // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\n var baseAxis = coordSys.getBaseAxis();\n\n if (baseAxis.type === 'category') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n\n if (!seriesGroupByCategoryAxis[key]) {\n seriesGroupByCategoryAxis[key] = {\n categoryAxis: baseAxis,\n valueAxis: coordSys.getOtherAxis(baseAxis),\n series: []\n };\n meta.push({\n axisDim: baseAxis.dim,\n axisIndex: baseAxis.index\n });\n }\n\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\n } else {\n otherSeries.push(seriesModel);\n }\n } else {\n otherSeries.push(seriesModel);\n }\n });\n return {\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\n other: otherSeries,\n meta: meta\n };\n}\n/**\n * Assemble content of series on cateogory axis\n * @inner\n */\n\n\nfunction assembleSeriesWithCategoryAxis(groups) {\n var tables = [];\n zrUtil.each(groups, function (group, key) {\n var categoryAxis = group.categoryAxis;\n var valueAxis = group.valueAxis;\n var valueAxisDim = valueAxis.dim;\n var headers = [' '].concat(zrUtil.map(group.series, function (series) {\n return series.name;\n })); // @ts-ignore TODO Polar\n\n var columns = [categoryAxis.model.getCategories()];\n zrUtil.each(group.series, function (series) {\n var rawData = series.getRawData();\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\n return val;\n }));\n }); // Assemble table content\n\n var lines = [headers.join(ITEM_SPLITER)];\n\n for (var i = 0; i < columns[0].length; i++) {\n var items = [];\n\n for (var j = 0; j < columns.length; j++) {\n items.push(columns[j][i]);\n }\n\n lines.push(items.join(ITEM_SPLITER));\n }\n\n tables.push(lines.join('\\n'));\n });\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n/**\n * Assemble content of other series\n */\n\n\nfunction assembleOtherSeries(series) {\n return zrUtil.map(series, function (series) {\n var data = series.getRawData();\n var lines = [series.name];\n var vals = [];\n data.each(data.dimensions, function () {\n var argLen = arguments.length;\n var dataIndex = arguments[argLen - 1];\n var name = data.getName(dataIndex);\n\n for (var i = 0; i < argLen - 1; i++) {\n vals[i] = arguments[i];\n }\n\n lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER));\n });\n return lines.join('\\n');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n\nfunction getContentFromModel(ecModel) {\n var result = groupSeries(ecModel);\n return {\n value: zrUtil.filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) {\n return !!str.replace(/[\\n\\t\\s]/g, '');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\n meta: result.meta\n };\n}\n\nfunction trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}\n/**\n * If a block is tsv format\n */\n\n\nfunction isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n}\n\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\n/**\n * @param {string} tsv\n * @return {Object}\n */\n\nfunction parseTSVContents(tsv) {\n var tsvLines = tsv.split(/\\n+/g);\n var headers = trim(tsvLines.shift()).split(itemSplitRegex);\n var categories = [];\n var series = zrUtil.map(headers, function (header) {\n return {\n name: header,\n data: []\n };\n });\n\n for (var i = 0; i < tsvLines.length; i++) {\n var items = trim(tsvLines[i]).split(itemSplitRegex);\n categories.push(items.shift());\n\n for (var j = 0; j < items.length; j++) {\n series[j] && (series[j].data[i] = items[j]);\n }\n }\n\n return {\n series: series,\n categories: categories\n };\n}\n\nfunction parseListContents(str) {\n var lines = str.split(/\\n+/g);\n var seriesName = trim(lines.shift());\n var data = [];\n\n for (var i = 0; i < lines.length; i++) {\n // if line is empty, ignore it.\n // there is a case that a user forgot to delete `\\n`.\n var line = trim(lines[i]);\n\n if (!line) {\n continue;\n }\n\n var items = line.split(itemSplitRegex);\n var name_1 = '';\n var value = void 0;\n var hasName = false;\n\n if (isNaN(items[0])) {\n // First item is name\n hasName = true;\n name_1 = items[0];\n items = items.slice(1);\n data[i] = {\n name: name_1,\n value: []\n };\n value = data[i].value;\n } else {\n value = data[i] = [];\n }\n\n for (var j = 0; j < items.length; j++) {\n value.push(+items[j]);\n }\n\n if (value.length === 1) {\n hasName ? data[i].value = value[0] : data[i] = value[0];\n }\n }\n\n return {\n name: seriesName,\n data: data\n };\n}\n\nfunction parseContents(str, blockMetaList) {\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\n var newOption = {\n series: []\n };\n zrUtil.each(blocks, function (block, idx) {\n if (isTSVFormat(block)) {\n var result = parseTSVContents(block);\n var blockMeta = blockMetaList[idx];\n var axisKey = blockMeta.axisDim + 'Axis';\n\n if (blockMeta) {\n newOption[axisKey] = newOption[axisKey] || [];\n newOption[axisKey][blockMeta.axisIndex] = {\n data: result.categories\n };\n newOption.series = newOption.series.concat(result.series);\n }\n } else {\n var result = parseListContents(block);\n newOption.series.push(result);\n }\n });\n return newOption;\n}\n\nvar DataView =\n/** @class */\nfunction (_super) {\n __extends(DataView, _super);\n\n function DataView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataView.prototype.onclick = function (ecModel, api) {\n var container = api.getDom();\n var model = this.model;\n\n if (this._dom) {\n container.removeChild(this._dom);\n }\n\n var root = document.createElement('div');\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\n root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements\n\n var header = document.createElement('h4');\n var lang = model.get('lang') || [];\n header.innerHTML = lang[0] || model.get('title');\n header.style.cssText = 'margin: 10px 20px;';\n header.style.color = model.get('textColor');\n var viewMain = document.createElement('div');\n var textarea = document.createElement('textarea');\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\n var optionToContent = model.get('optionToContent');\n var contentToOption = model.get('contentToOption');\n var result = getContentFromModel(ecModel);\n\n if (typeof optionToContent === 'function') {\n var htmlOrDom = optionToContent(api.getOption());\n\n if (typeof htmlOrDom === 'string') {\n viewMain.innerHTML = htmlOrDom;\n } else if (zrUtil.isDom(htmlOrDom)) {\n viewMain.appendChild(htmlOrDom);\n }\n } else {\n // Use default textarea\n viewMain.appendChild(textarea);\n textarea.readOnly = model.get('readOnly');\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\n textarea.style.color = model.get('textColor');\n textarea.style.borderColor = model.get('textareaBorderColor');\n textarea.style.backgroundColor = model.get('textareaColor');\n textarea.value = result.value;\n }\n\n var blockMetaList = result.meta;\n var buttonContainer = document.createElement('div');\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\n var buttonStyle = 'float:right;margin-right:20px;border:none;' + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\n var closeButton = document.createElement('div');\n var refreshButton = document.createElement('div');\n buttonStyle += ';background-color:' + model.get('buttonColor');\n buttonStyle += ';color:' + model.get('buttonTextColor');\n var self = this;\n\n function close() {\n container.removeChild(root);\n self._dom = null;\n }\n\n addEventListener(closeButton, 'click', close);\n addEventListener(refreshButton, 'click', function () {\n if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\n }\n\n close();\n return;\n }\n\n var newOption;\n\n try {\n if (typeof contentToOption === 'function') {\n newOption = contentToOption(viewMain, api.getOption());\n } else {\n newOption = parseContents(textarea.value, blockMetaList);\n }\n } catch (e) {\n close();\n throw new Error('Data view format error ' + e);\n }\n\n if (newOption) {\n api.dispatchAction({\n type: 'changeDataView',\n newOption: newOption\n });\n }\n\n close();\n });\n closeButton.innerHTML = lang[1];\n refreshButton.innerHTML = lang[2];\n refreshButton.style.cssText = buttonStyle;\n closeButton.style.cssText = buttonStyle;\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\n buttonContainer.appendChild(closeButton);\n root.appendChild(header);\n root.appendChild(viewMain);\n root.appendChild(buttonContainer);\n viewMain.style.height = container.clientHeight - 80 + 'px';\n container.appendChild(root);\n this._dom = root;\n };\n\n DataView.prototype.remove = function (ecModel, api) {\n this._dom && api.getDom().removeChild(this._dom);\n };\n\n DataView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n DataView.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n readOnly: false,\n optionToContent: null,\n contentToOption: null,\n // eslint-disable-next-line\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\n backgroundColor: '#fff',\n textColor: '#000',\n textareaColor: '#fff',\n textareaBorderColor: '#333',\n buttonColor: '#c23531',\n buttonTextColor: '#fff'\n };\n return defaultOption;\n };\n\n return DataView;\n}(ToolboxFeature);\n/**\n * @inner\n */\n\n\nfunction tryMergeDataOption(newData, originalData) {\n return zrUtil.map(newData, function (newVal, idx) {\n var original = originalData && originalData[idx];\n\n if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\n var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\n\n if (!newValIsObject) {\n newVal = {\n value: newVal\n };\n } // original data has name but new data has no name\n\n\n var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option\n\n newVal = zrUtil.defaults(newVal, original);\n shouldDeleteName && delete newVal.name;\n return newVal;\n } else {\n return newVal;\n }\n });\n} // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'changeDataView',\n event: 'dataViewChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n var newSeriesOptList = [];\n zrUtil.each(payload.newOption.series, function (seriesOpt) {\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\n\n if (!seriesModel) {\n // New created series\n // Geuss the series type\n newSeriesOptList.push(zrUtil.extend({\n // Default is scatter\n type: 'scatter'\n }, seriesOpt));\n } else {\n var originalData = seriesModel.get('data');\n newSeriesOptList.push({\n name: seriesOpt.name,\n data: tryMergeDataOption(seriesOpt.data, originalData)\n });\n }\n });\n ecModel.mergeOption(zrUtil.defaults({\n series: newSeriesOptList\n }, payload.newOption));\n});\nexport default DataView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { makeInner } from '../../util/model';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\n * @param ecModel\n * @param newSnapshot key is dataZoomId\n */\n\nexport function push(ecModel, newSnapshot) {\n var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = storedSnapshots.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = storedSnapshots[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n storedSnapshots[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n var head = storedSnapshots[storedSnapshots.length - 1];\n storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n batchItem = storedSnapshots[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\nexport function clear(ecModel) {\n inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n return getStoreSnapshots(ecModel).length;\n}\n/**\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n */\n\nfunction getStoreSnapshots(ecModel) {\n var store = inner(ecModel);\n\n if (!store.snapshots) {\n store.snapshots = [{}];\n }\n\n return store.snapshots;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts';\nimport * as history from '../../dataZoom/history';\nimport { ToolboxFeature } from '../featureManager';\n\nvar RestoreOption =\n/** @class */\nfunction (_super) {\n __extends(RestoreOption, _super);\n\n function RestoreOption() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n RestoreOption.prototype.onclick = function (ecModel, api) {\n history.clear(ecModel);\n api.dispatchAction({\n type: 'restore',\n from: this.uid\n });\n };\n\n RestoreOption.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n // eslint-disable-next-line\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\n };\n return defaultOption;\n };\n\n return RestoreOption;\n}(ToolboxFeature); // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'restore',\n event: 'restore',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.resetOption('recreate');\n});\nexport default RestoreOption;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport * as brushHelper from './brushHelper';\nimport { parseFinder as modelUtilParseFinder } from '../../util/model';\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData']; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n\nvar BrushTargetManager =\n/** @class */\nfunction () {\n /**\n * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.<number>}. like: {xAxisIndex: [3, 4]}\n * @param opt.include include coordinate system types.\n */\n function BrushTargetManager(finder, ecModel, opt) {\n var _this = this;\n\n this._targetInfoList = [];\n var foundCpts = parseFinder(ecModel, finder);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, _this._targetInfoList);\n }\n });\n }\n\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n return areas;\n };\n\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n };\n /**\n * the `areas` is `BrushModel.areas`.\n * Called in layout stage.\n * convert `area.coordRange` to global range and set panelId to `area.range`.\n */\n\n\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\n }\n\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n };\n\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\n return map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n };\n\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n };\n /**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n */\n\n\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var j = 0; j < targetInfoMatchers.length; j++) {\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n };\n\n return BrushTargetManager;\n}();\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, finder) {\n return modelUtilParseFinder(ecModel, finder, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilders.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilders.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilders = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.master.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange) {\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = map(rangeOrCoordRange, function (item) {\n var p = coordSys[COORD_CONVERTS[to]](item);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n if (process.env.NODE_ENV !== 'production') {\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\n }\n\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n },\n polygon: function (values, refer, scales) {\n return map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n// Return [0~1, 0~1]\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nexport default BrushTargetManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\"; // TODO depends on DataZoom and Brush\n\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BrushController from '../../helper/BrushController';\nimport BrushTargetManager from '../../helper/BrushTargetManager';\nimport * as history from '../../dataZoom/history';\nimport sliderMove from '../../helper/sliderMove';\nimport { ToolboxFeature } from '../featureManager';\nimport { makeInternalComponentId, parseFinder } from '../../../util/model';\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator';\nvar each = zrUtil.each;\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\nvar ICON_TYPES = ['zoom', 'back'];\n\nvar DataZoomFeature =\n/** @class */\nfunction (_super) {\n __extends(DataZoomFeature, _super);\n\n function DataZoomFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\n if (!this._brushController) {\n this._brushController = new BrushController(api.getZr());\n\n this._brushController.on('brush', zrUtil.bind(this._onBrush, this)).mount();\n }\n\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\n updateBackBtnStatus(featureModel, ecModel);\n };\n\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\n handlers[type].call(this);\n };\n\n DataZoomFeature.prototype.remove = function (ecModel, api) {\n this._brushController && this._brushController.unmount();\n };\n\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\n this._brushController && this._brushController.dispose();\n };\n\n DataZoomFeature.prototype._onBrush = function (eventParam) {\n var areas = eventParam.areas;\n\n if (!eventParam.isEnd || !areas.length) {\n return;\n }\n\n var snapshot = {};\n var ecModel = this.ecModel;\n\n this._brushController.updateCovers([]); // remove cover\n\n\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {\n include: ['grid']\n });\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n if (coordSys.type !== 'cartesian2d') {\n return;\n }\n\n var brushType = area.brushType;\n\n if (brushType === 'rect') {\n setBatch('x', coordSys, coordRange[0]);\n setBatch('y', coordSys, coordRange[1]);\n } else {\n setBatch({\n lineX: 'x',\n lineY: 'y'\n }[brushType], coordSys, coordRange);\n }\n });\n history.push(ecModel, snapshot);\n\n this._dispatchZoomAction(snapshot);\n\n function setBatch(dimName, coordSys, minMax) {\n var axis = coordSys.getAxis(dimName);\n var axisModel = axis.model;\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range.\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\n\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\n }\n\n dataZoomModel && (snapshot[dataZoomModel.id] = {\n dataZoomId: dataZoomModel.id,\n startValue: minMax[0],\n endValue: minMax[1]\n });\n }\n\n function findDataZoom(dimName, axisModel, ecModel) {\n var found;\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'select'\n }, function (dzModel) {\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\n has && (found = dzModel);\n });\n return found;\n }\n };\n\n ;\n\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\n var batch = []; // Convert from hash map to array.\n\n each(snapshot, function (batchItem, dataZoomId) {\n batch.push(zrUtil.clone(batchItem));\n });\n batch.length && this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n batch: batch\n });\n };\n\n DataZoomFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n filterMode: 'filter',\n // Icon group\n icon: {\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\n },\n // `zoom`, `back`\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\n brushStyle: {\n borderWidth: 0,\n color: 'rgba(210,219,238,0.2)'\n }\n };\n return defaultOption;\n };\n\n return DataZoomFeature;\n}(ToolboxFeature);\n\nvar handlers = {\n zoom: function () {\n var nextActive = !this._isZoomActive;\n this.api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: nextActive\n });\n },\n back: function () {\n this._dispatchZoomAction(history.pop(this.ecModel));\n }\n};\n\nfunction makeAxisFinder(dzFeatureModel) {\n var setting = {\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\n xAxisId: dzFeatureModel.get('xAxisId', true),\n yAxisId: dzFeatureModel.get('yAxisId', true)\n }; // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\n // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\n // Some old cases set like this below to close yAxis control but leave xAxis control:\n // `{ feature: { dataZoom: { yAxisIndex: false } }`.\n\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\n setting.xAxisIndex = 'all';\n }\n\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\n setting.yAxisIndex = 'all';\n }\n\n return setting;\n}\n\nfunction updateBackBtnStatus(featureModel, ecModel) {\n featureModel.setIconStatus('back', history.count(ecModel) > 1 ? 'emphasis' : 'normal');\n}\n\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\n var zoomActive = view._isZoomActive;\n\n if (payload && payload.type === 'takeGlobalCursor') {\n zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false;\n }\n\n view._isZoomActive = zoomActive;\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {\n include: ['grid']\n });\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\n return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';\n });\n\n view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {\n brushType: 'auto',\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\n } : false);\n}\n\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\n var toolboxModel = ecModel.getComponent('toolbox', 0);\n\n if (!toolboxModel) {\n return;\n }\n\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\n var dzOptions = [];\n var finder = makeAxisFinder(dzFeatureModel);\n var finderResult = parseFinder(ecModel, finder);\n each(finderResult.xAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex');\n });\n each(finderResult.yAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex');\n });\n\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\n var axisIndex = axisModel.componentIndex;\n var newOpt = {\n type: 'select',\n $fromToolbox: true,\n // Default to be filter\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\n // Id for merge mapping.\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\n };\n newOpt[axisIndexPropName] = axisIndex;\n dzOptions.push(newOpt);\n }\n\n return dzOptions;\n});\nexport default DataZoomFeature;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect';\nimport ToolboxModel from './ToolboxModel';\nimport ToolboxView from './ToolboxView'; // TODOD: REGISTER IN INSTALL\n\nimport { registerFeature } from './featureManager';\nimport SaveAsImage from './feature/SaveAsImage';\nimport MagicType from './feature/MagicType';\nimport DataView from './feature/DataView';\nimport Restore from './feature/Restore';\nimport DataZoom from './feature/DataZoom';\nexport function install(registers) {\n registers.registerComponentModel(ToolboxModel);\n registers.registerComponentView(ToolboxView);\n registerFeature('saveAsImage', SaveAsImage);\n registerFeature('magicType', MagicType);\n registerFeature('dataView', DataView);\n registerFeature('dataZoom', DataZoom);\n registerFeature('restore', Restore);\n use(installDataZoomSelect);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar TooltipModel =\n/** @class */\nfunction (_super) {\n __extends(TooltipModel, _super);\n\n function TooltipModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipModel.type;\n return _this;\n }\n\n TooltipModel.type = 'tooltip';\n TooltipModel.dependencies = ['axisPointer'];\n TooltipModel.defaultOption = {\n zlevel: 0,\n z: 60,\n show: true,\n // tooltip main content\n showContent: true,\n // 'trigger' only works on coordinate system.\n // 'item' | 'axis' | 'none'\n trigger: 'item',\n // 'click' | 'mousemove' | 'none'\n triggerOn: 'mousemove|click',\n alwaysShowContent: false,\n displayMode: 'single',\n renderMode: 'auto',\n // whether restraint content inside viewRect.\n // If renderMode: 'richText', default true.\n // If renderMode: 'html', defaut false (for backward compat).\n confine: null,\n showDelay: 0,\n hideDelay: 100,\n // Animation transition time, unit is second\n transitionDuration: 0.4,\n enterable: false,\n backgroundColor: '#fff',\n // box shadow\n shadowBlur: 10,\n shadowColor: 'rgba(0, 0, 0, .2)',\n shadowOffsetX: 1,\n shadowOffsetY: 2,\n // tooltip border radius, unit is px, default is 4\n borderRadius: 4,\n // tooltip border width, unit is px, default is 0 (no border)\n borderWidth: 1,\n // Tooltip inside padding, default is 5 for all direction\n // Array is allowed to set up, right, bottom, left, same with css\n // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\n padding: null,\n // Extra css text\n extraCssText: '',\n // axis indicator, trigger by axis\n axisPointer: {\n // default is line\n // legal values: 'line' | 'shadow' | 'cross'\n type: 'line',\n // Valid when type is line, appoint tooltip line locate on which line. Optional\n // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\n // default is 'auto', chose the axis which type is category.\n // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\n axis: 'auto',\n animation: 'auto',\n animationDurationUpdate: 200,\n animationEasingUpdate: 'exponentialOut',\n crossStyle: {\n color: '#999',\n width: 1,\n type: 'dashed',\n // TODO formatter\n textStyle: {}\n } // lineStyle and shadowStyle should not be specified here,\n // otherwise it will always override those styles on option.axisPointer.\n\n },\n textStyle: {\n color: '#666',\n fontSize: 14\n }\n };\n return TooltipModel;\n}(ComponentModel);\n\nexport default TooltipModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { toCamelCase } from '../../util/format';\nimport env from 'zrender/lib/core/env';\n/* global document */\n\nexport function shouldTooltipConfine(tooltipModel) {\n var confineOption = tooltipModel.get('confine');\n return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible.\n : tooltipModel.get('renderMode') === 'richText';\n}\n\nfunction testStyle(styleProps) {\n if (!env.domSupported) {\n return;\n }\n\n var style = document.documentElement.style;\n\n for (var i = 0, len = styleProps.length; i < len; i++) {\n if (styleProps[i] in style) {\n return styleProps[i];\n }\n }\n}\n\nexport var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\nexport var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\nexport function toCSSVendorPrefix(styleVendor, styleProp) {\n if (!styleVendor) {\n return styleProp;\n }\n\n styleProp = toCamelCase(styleProp, true);\n var idx = styleVendor.indexOf(styleProp);\n styleVendor = idx === -1 ? styleProp : \"-\" + styleVendor.slice(0, idx) + \"-\" + styleProp;\n return styleVendor.toLowerCase();\n}\nexport function getComputedStyle(el, style) {\n var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);\n return stl ? style ? stl[style] : stl : null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isString, indexOf, each, bind, isArray, isDom } from 'zrender/lib/core/util';\nimport { toHex } from 'zrender/lib/tool/color';\nimport { normalizeEvent } from 'zrender/lib/core/event';\nimport { transformLocalCoord } from 'zrender/lib/core/dom';\nimport env from 'zrender/lib/core/env';\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format';\nimport { shouldTooltipConfine, toCSSVendorPrefix, getComputedStyle, TRANSFORM_VENDOR, TRANSITION_VENDOR } from './helper';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup';\n/* global document, window */\n\nvar CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\nvar CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform'); // eslint-disable-next-line\n\nvar gCssText = \"position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;\" + (env.transform3dSupported ? 'will-change:transform;' : '');\n\nfunction mirrorPos(pos) {\n pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top';\n return pos;\n}\n\nfunction assembleArrow(backgroundColor, borderColor, arrowPosition) {\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\n return '';\n }\n\n borderColor = convertToColorString(borderColor);\n var arrowPos = mirrorPos(arrowPosition);\n var positionStyle = arrowPos + \":-6px;\";\n var transformStyle = CSS_TRANSFORM_VENDOR + ':';\n\n if (indexOf(['left', 'right'], arrowPos) > -1) {\n positionStyle += 'top:50%';\n transformStyle += \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\n } else {\n positionStyle += 'left:50%';\n transformStyle += \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\n }\n\n var borderStyle = borderColor + \" solid 1px;\";\n var styleCss = ['position:absolute;width:10px;height:10px;', positionStyle + \";\" + transformStyle + \";\", \"border-bottom:\" + borderStyle, \"border-right:\" + borderStyle, \"background-color:\" + backgroundColor + \";\", 'box-shadow:8px 8px 16px -3px #000;'];\n return \"<div style=\\\"\" + styleCss.join('') + \"\\\"></div>\";\n}\n\nfunction assembleTransition(duration, onlyFade) {\n var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\n var transitionOption = \" \" + duration / 2 + \"s \" + transitionCurve;\n var transitionText = \"opacity\" + transitionOption + \",visibility\" + transitionOption;\n\n if (!onlyFade) {\n transitionOption = \" \" + duration + \"s \" + transitionCurve;\n transitionText += env.transformSupported ? \",\" + TRANSFORM_VENDOR + transitionOption : \",left\" + transitionOption + \",top\" + transitionOption;\n }\n\n return CSS_TRANSITION_VENDOR + ':' + transitionText;\n}\n\nfunction assembleTransform(x, y, toString) {\n // If using float on style, the final width of the dom might\n // keep changing slightly while mouse move. So `toFixed(0)` them.\n var x0 = x.toFixed(0) + 'px';\n var y0 = y.toFixed(0) + 'px'; // not support transform, use `left` and `top` instead.\n\n if (!env.transformSupported) {\n return toString ? \"top:\" + y0 + \";left:\" + x0 + \";\" : [['top', y0], ['left', x0]];\n } // support transform\n\n\n var is3d = env.transform3dSupported;\n var translate = \"translate\" + (is3d ? '3d' : '') + \"(\" + x0 + \",\" + y0 + (is3d ? ',0' : '') + \")\";\n return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\n}\n/**\n * @param {Object} textStyle\n * @return {string}\n * @inner\n */\n\n\nfunction assembleFont(textStyleModel) {\n var cssText = [];\n var fontSize = textStyleModel.get('fontSize');\n var color = textStyleModel.getTextColor();\n color && cssText.push('color:' + color);\n cssText.push('font:' + textStyleModel.getFont());\n fontSize // @ts-ignore, leave it to the tooltip refactor.\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\n var shadowColor = textStyleModel.get('textShadowColor');\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\n shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);\n each(['decoration', 'align'], function (name) {\n var val = textStyleModel.get(name);\n val && cssText.push('text-' + name + ':' + val);\n });\n return cssText.join(';');\n}\n\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\n var cssText = [];\n var transitionDuration = tooltipModel.get('transitionDuration');\n var backgroundColor = tooltipModel.get('backgroundColor');\n var shadowBlur = tooltipModel.get('shadowBlur');\n var shadowColor = tooltipModel.get('shadowColor');\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\n var textStyleModel = tooltipModel.getModel('textStyle');\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\n cssText.push('box-shadow:' + boxShadow); // Animation transition. Do not animate when transitionDuration is 0.\n\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\n\n if (backgroundColor) {\n if (env.canvasSupported) {\n cssText.push('background-color:' + backgroundColor);\n } else {\n // for ie\n cssText.push('background-color:#' + toHex(backgroundColor));\n cssText.push('filter:alpha(opacity=70)');\n }\n } // Border style\n\n\n each(['width', 'color', 'radius'], function (name) {\n var borderName = 'border-' + name;\n var camelCase = toCamelCase(borderName);\n var val = tooltipModel.get(camelCase);\n val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\n }); // Text style\n\n cssText.push(assembleFont(textStyleModel)); // Padding\n\n if (padding != null) {\n cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\n }\n\n return cssText.join(';') + ';';\n} // If not able to make, do not modify the input `out`.\n\n\nfunction makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\n var zrPainter = zr && zr.painter;\n\n if (appendToBody) {\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\n\n if (zrViewportRoot) {\n // Some APPs might use scale on body, so we support CSS transform here.\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\n }\n } else {\n out[0] = zrX;\n out[1] = zrY; // xy should be based on canvas root. But tooltipContent is\n // the sibling of canvas root. So padding of ec container\n // should be considered here.\n\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\n\n if (viewportRootOffset) {\n out[0] += viewportRootOffset.offsetLeft;\n out[1] += viewportRootOffset.offsetTop;\n }\n }\n\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nvar TooltipHTMLContent =\n/** @class */\nfunction () {\n function TooltipHTMLContent(container, api, opt) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._enterable = true;\n this._firstShow = true;\n this._longHide = true;\n\n if (env.wxa) {\n return null;\n }\n\n var el = document.createElement('div'); // TODO: TYPE\n\n el.domBelongToZr = true;\n this.el = el;\n var zr = this._zr = api.getZr();\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\n\n if (appendToBody) {\n document.body.appendChild(el);\n } else {\n container.appendChild(el);\n }\n\n this._container = container; // FIXME\n // Is it needed to trigger zr event manually if\n // the browser do not support `pointer-events: none`.\n\n var self = this;\n\n el.onmouseenter = function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n };\n\n el.onmousemove = function (e) {\n e = e || window.event;\n\n if (!self._enterable) {\n // `pointer-events: none` is set to tooltip content div\n // if `enterable` is set as `false`, and `el.onmousemove`\n // can not be triggered. But in browser that do not\n // support `pointer-events`, we need to do this:\n // Try trigger zrender event to avoid mouse\n // in and out shape too frequently\n var handler = zr.handler;\n var zrViewportRoot = zr.painter.getViewportRoot();\n normalizeEvent(zrViewportRoot, e, true);\n handler.dispatch('mousemove', e);\n }\n };\n\n el.onmouseleave = function () {\n // set `_inContent` to `false` before `hideLater`\n self._inContent = false;\n\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n };\n }\n /**\n * Update when tooltip is rendered\n */\n\n\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\n // FIXME\n // Move this logic to ec main?\n var container = this._container;\n var position = getComputedStyle(container, 'position');\n var domStyle = container.style;\n\n if (domStyle.position !== 'absolute' && position !== 'absolute') {\n domStyle.position = 'relative';\n } // move tooltip if chart resized\n\n\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized(); // update className\n\n this.el.className = tooltipModel.get('className') || ''; // Hide the tooltip\n // PENDING\n // this.hide();\n };\n\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\n clearTimeout(this._hideTimeout);\n clearTimeout(this._longHideTimeout);\n var el = this.el;\n var style = el.style;\n var styleCoord = this._styleCoord;\n\n if (!el.innerHTML) {\n style.display = 'none';\n } else {\n style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) // initial transform\n + assembleTransform(styleCoord[0], styleCoord[1], true) + (\"border-color:\" + convertToColorString(nearPointColor) + \";\") + (tooltipModel.get('extraCssText') || '') // If mouse occasionally move over the tooltip, a mouseout event will be\n // triggered by canvas, and cause some unexpectable result like dragging\n // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n // it. Although it is not supported by IE8~IE10, fortunately it is a rare\n // scenario.\n + (\";pointer-event:\" + (this._enterable ? 'auto' : 'none'));\n }\n\n this._show = true;\n this._firstShow = false;\n this._longHide = false;\n };\n\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\n if (content == null) {\n return;\n }\n\n var el = this.el;\n\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) {\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\n }\n\n if (isString(content)) {\n el.innerHTML = content;\n } else if (content) {\n // Clear previous\n el.innerHTML = '';\n\n if (!isArray(content)) {\n content = [content];\n }\n\n for (var i = 0; i < content.length; i++) {\n if (isDom(content[i]) && content[i].parentNode !== el) {\n el.appendChild(content[i]);\n }\n }\n }\n };\n\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipHTMLContent.prototype.getSize = function () {\n var el = this.el;\n return [el.clientWidth, el.clientHeight];\n };\n\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\n\n if (styleCoord[0] != null && styleCoord[1] != null) {\n var style_1 = this.el.style;\n var transforms = assembleTransform(styleCoord[0], styleCoord[1]);\n each(transforms, function (transform) {\n style_1[transform[0]] = transform[1];\n });\n }\n };\n /**\n * when `alwaysShowContent` is true,\n * move the tooltip after chart resized\n */\n\n\n TooltipHTMLContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipHTMLContent.prototype.hide = function () {\n var _this = this;\n\n var style = this.el.style;\n style.visibility = 'hidden';\n style.opacity = '0';\n env.transform3dSupported && (style.willChange = '');\n this._show = false;\n this._longHideTimeout = setTimeout(function () {\n return _this._longHide = true;\n }, 500);\n };\n\n TooltipHTMLContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable)) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipHTMLContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipHTMLContent.prototype.dispose = function () {\n this.el.parentNode.removeChild(this.el);\n };\n\n TooltipHTMLContent.prototype.getOuterSize = function () {\n var width = this.el.clientWidth;\n var height = this.el.clientHeight; // Consider browser compatibility.\n // IE8 does not support getComputedStyle.\n\n var stl = getComputedStyle(this.el);\n\n if (stl) {\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\n }\n\n return {\n width: width,\n height: height\n };\n };\n\n return TooltipHTMLContent;\n}();\n\nexport default TooltipHTMLContent;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ZRText from 'zrender/lib/graphic/Text';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup';\nimport { throwError } from '../../util/log';\n\nvar TooltipRichContent =\n/** @class */\nfunction () {\n function TooltipRichContent(api) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._enterable = true;\n this._zr = api.getZr();\n makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\n }\n /**\n * Update when tooltip is rendered\n */\n\n\n TooltipRichContent.prototype.update = function (tooltipModel) {\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized();\n };\n\n TooltipRichContent.prototype.show = function () {\n if (this._hideTimeout) {\n clearTimeout(this._hideTimeout);\n }\n\n this.el.show();\n this._show = true;\n };\n /**\n * Set tooltip content\n */\n\n\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\n if (zrUtil.isObject(content)) {\n throwError(process.env.NODE_ENV !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\n }\n\n if (this.el) {\n this._zr.remove(this.el);\n }\n\n var textStyleModel = tooltipModel.getModel('textStyle');\n this.el = new ZRText({\n style: {\n rich: markupStyleCreator.richTextStyles,\n text: content,\n lineHeight: 22,\n backgroundColor: tooltipModel.get('backgroundColor'),\n borderRadius: tooltipModel.get('borderRadius'),\n borderWidth: 1,\n borderColor: borderColor,\n shadowColor: tooltipModel.get('shadowColor'),\n shadowBlur: tooltipModel.get('shadowBlur'),\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\n textShadowColor: textStyleModel.get('textShadowColor'),\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\n fill: tooltipModel.get(['textStyle', 'color']),\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\n verticalAlign: 'top',\n align: 'left'\n },\n z: tooltipModel.get('z')\n });\n\n this._zr.add(this.el);\n\n var self = this;\n this.el.on('mouseover', function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n });\n this.el.on('mouseout', function () {\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n\n self._inContent = false;\n });\n };\n\n TooltipRichContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipRichContent.prototype.getSize = function () {\n var el = this.el;\n var bounding = this.el.getBoundingRect(); // bounding rect does not include shadow. For renderMode richText,\n // if overflow, it will be cut. So calculate them accurately.\n\n var shadowOuterSize = calcShadowOuterSize(el.style);\n return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];\n };\n\n TooltipRichContent.prototype.moveTo = function (x, y) {\n var el = this.el;\n\n if (el) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, x, y);\n x = styleCoord[0];\n y = styleCoord[1];\n var style = el.style;\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\n var shadowOuterSize = calcShadowOuterSize(style); // rich text x, y do not include border.\n\n el.x = x + borderWidth + shadowOuterSize.left;\n el.y = y + borderWidth + shadowOuterSize.top;\n el.markRedraw();\n }\n };\n /**\n * when `alwaysShowContent` is true,\n * move the tooltip after chart resized\n */\n\n\n TooltipRichContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipRichContent.prototype.hide = function () {\n if (this.el) {\n this.el.hide();\n }\n\n this._show = false;\n };\n\n TooltipRichContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable)) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipRichContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipRichContent.prototype.getOuterSize = function () {\n var size = this.getSize();\n return {\n width: size[0],\n height: size[1]\n };\n };\n\n TooltipRichContent.prototype.dispose = function () {\n this._zr.remove(this.el);\n };\n\n return TooltipRichContent;\n}();\n\nfunction mathMaxWith0(val) {\n return Math.max(0, val);\n}\n\nfunction calcShadowOuterSize(style) {\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\n return {\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\n };\n}\n\nfunction makeStyleCoord(out, zr, zrX, zrY) {\n out[0] = zrX;\n out[1] = zrY;\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nexport default TooltipRichContent;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport * as zrUtil from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport TooltipHTMLContent from './TooltipHTMLContent';\nimport TooltipRichContent from './TooltipRichContent';\nimport * as formatUtil from '../../util/format';\nimport * as numberUtil from '../../util/number';\nimport * as graphic from '../../util/graphic';\nimport findPointFromSeries from '../axisPointer/findPointFromSeries';\nimport * as layoutUtil from '../../util/layout';\nimport Model from '../../model/Model';\nimport * as globalListener from '../axisPointer/globalListener';\nimport * as axisHelper from '../../coord/axisHelper';\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper';\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model';\nimport ComponentView from '../../view/Component';\nimport { format as timeFormat } from '../../util/time'; // import { isDimensionStacked } from '../../data/helper/dataStackHelper';\n\nimport { getECData } from '../../util/innerStore';\nimport { shouldTooltipConfine } from './helper';\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat';\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup';\nimport { findEventDispatcher } from '../../util/event';\nvar bind = zrUtil.bind;\nvar each = zrUtil.each;\nvar parsePercent = numberUtil.parsePercent;\nvar proxyRect = new graphic.Rect({\n shape: {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n }\n});\n\nvar TooltipView =\n/** @class */\nfunction (_super) {\n __extends(TooltipView, _super);\n\n function TooltipView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipView.type;\n return _this;\n }\n\n TooltipView.prototype.init = function (ecModel, api) {\n if (env.node) {\n return;\n }\n\n var tooltipModel = ecModel.getComponent('tooltip');\n var renderMode = tooltipModel.get('renderMode');\n this._renderMode = getTooltipRenderMode(renderMode);\n this._tooltipContent = this._renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api.getDom(), api, {\n appendToBody: tooltipModel.get('appendToBody', true)\n });\n };\n\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\n if (env.node) {\n return;\n } // Reset\n\n\n this.group.removeAll();\n this._tooltipModel = tooltipModel;\n this._ecModel = ecModel;\n this._api = api;\n /**\n * @private\n * @type {boolean}\n */\n\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\n var tooltipContent = this._tooltipContent;\n tooltipContent.update(tooltipModel);\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n\n this._initGlobalListener();\n\n this._keepShow();\n };\n\n TooltipView.prototype._initGlobalListener = function () {\n var tooltipModel = this._tooltipModel;\n var triggerOn = tooltipModel.get('triggerOn');\n globalListener.register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none') {\n if (triggerOn.indexOf(currTrigger) >= 0) {\n this._tryShow(e, dispatchAction);\n } else if (currTrigger === 'leave') {\n this._hide(dispatchAction);\n }\n }\n }, this));\n };\n\n TooltipView.prototype._keepShow = function () {\n var tooltipModel = this._tooltipModel;\n var ecModel = this._ecModel;\n var api = this._api; // Try to keep the tooltip show when refreshing\n\n if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API,\n // self.manuallyShowTip({x, y}) might cause tooltip hide,\n // which is not expected.\n && tooltipModel.get('triggerOn') !== 'none') {\n var self_1 = this;\n clearTimeout(this._refreshUpdateTimeout);\n this._refreshUpdateTimeout = setTimeout(function () {\n // Show tip next tick after other charts are rendered\n // In case highlight action has wrong result\n // FIXME\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\n x: self_1._lastX,\n y: self_1._lastY,\n dataByCoordSys: self_1._lastDataByCoordSys\n });\n });\n }\n };\n /**\n * Show tip manually by\n * dispatchAction({\n * type: 'showTip',\n * x: 10,\n * y: 10\n * });\n * Or\n * dispatchAction({\n * type: 'showTip',\n * seriesIndex: 0,\n * dataIndex or dataIndexInside or name\n * });\n *\n * TODO Batch\n */\n\n\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\n if (payload.from === this.uid || env.node) {\n return;\n }\n\n var dispatchAction = makeDispatchAction(payload, api); // Reset ticket\n\n this._ticket = ''; // When triggered from axisPointer.\n\n var dataByCoordSys = payload.dataByCoordSys;\n var cmptRef = findComponentReference(payload, ecModel, api);\n\n if (cmptRef) {\n var rect = cmptRef.el.getBoundingRect().clone();\n rect.applyTransform(cmptRef.el.transform);\n\n this._tryShow({\n offsetX: rect.x + rect.width / 2,\n offsetY: rect.y + rect.height / 2,\n target: cmptRef.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n } else if (payload.tooltip && payload.x != null && payload.y != null) {\n var el = proxyRect;\n el.x = payload.x;\n el.y = payload.y;\n el.update();\n getECData(el).tooltipConfig = {\n name: null,\n option: payload.tooltip\n }; // Manually show tooltip while view is not using zrender elements.\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n target: el\n }, dispatchAction);\n } else if (dataByCoordSys) {\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n dataByCoordSys: dataByCoordSys,\n tooltipOption: payload.tooltipOption\n }, dispatchAction);\n } else if (payload.seriesIndex != null) {\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\n return;\n }\n\n var pointInfo = findPointFromSeries(payload, ecModel);\n var cx = pointInfo.point[0];\n var cy = pointInfo.point[1];\n\n if (cx != null && cy != null) {\n this._tryShow({\n offsetX: cx,\n offsetY: cy,\n target: pointInfo.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n }\n } else if (payload.x != null && payload.y != null) {\n // FIXME\n // should wrap dispatchAction like `axisPointer/globalListener` ?\n api.dispatchAction({\n type: 'updateAxisPointer',\n x: payload.x,\n y: payload.y\n });\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n target: api.getZr().findHover(payload.x, payload.y).target\n }, dispatchAction);\n }\n };\n\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\n var tooltipContent = this._tooltipContent;\n\n if (!this._alwaysShowContent && this._tooltipModel) {\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\n }\n\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\n\n if (payload.from !== this.uid) {\n this._hide(makeDispatchAction(payload, api));\n }\n }; // Be compatible with previous design, that is, when tooltip.type is 'axis' and\n // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n // and tooltip.\n\n\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\n var seriesIndex = payload.seriesIndex;\n var dataIndex = payload.dataIndex; // @ts-ignore\n\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\n return;\n }\n\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (!seriesModel) {\n return;\n }\n\n var data = seriesModel.getData();\n var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);\n\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\n return;\n }\n\n api.dispatchAction({\n type: 'updateAxisPointer',\n seriesIndex: seriesIndex,\n dataIndex: dataIndex,\n position: payload.position\n });\n return true;\n };\n\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\n var el = e.target;\n var tooltipModel = this._tooltipModel;\n\n if (!tooltipModel) {\n return;\n } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\n\n\n this._lastX = e.offsetX;\n this._lastY = e.offsetY;\n var dataByCoordSys = e.dataByCoordSys;\n\n if (dataByCoordSys && dataByCoordSys.length) {\n this._showAxisTooltip(dataByCoordSys, e);\n } else if (el) {\n this._lastDataByCoordSys = null;\n var seriesDispatcher_1;\n var cmptDispatcher_1;\n findEventDispatcher(el, function (target) {\n // Always show item tooltip if mouse is on the element with dataIndex\n if (getECData(target).dataIndex != null) {\n seriesDispatcher_1 = target;\n return true;\n } // Tooltip provided directly. Like legend.\n\n\n if (getECData(target).tooltipConfig != null) {\n cmptDispatcher_1 = target;\n return true;\n }\n }, true);\n\n if (seriesDispatcher_1) {\n this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction);\n } else if (cmptDispatcher_1) {\n this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction);\n } else {\n this._hide(dispatchAction);\n }\n } else {\n this._lastDataByCoordSys = null;\n\n this._hide(dispatchAction);\n }\n };\n\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\n // showDelay is used in this case: tooltip.enterable is set\n // as true. User intent to move mouse into tooltip and click\n // something. `showDelay` makes it easier to enter the content\n // but tooltip do not move immediately.\n var delay = tooltipModel.get('showDelay');\n cb = zrUtil.bind(cb, this);\n clearTimeout(this._showTimout);\n delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();\n };\n\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\n var ecModel = this._ecModel;\n var globalTooltipModel = this._tooltipModel;\n var point = [e.offsetX, e.offsetY];\n var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);\n var renderMode = this._renderMode;\n var cbParamsList = [];\n var articleMarkup = createTooltipMarkup('section', {\n blocks: [],\n noHeader: true\n }); // Only for legacy: `Serise['formatTooltip']` returns a string.\n\n var markupTextArrLegacy = [];\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n each(dataByCoordSys, function (itemCoordSys) {\n each(itemCoordSys.dataByAxis, function (axisItem) {\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\n var axisValue = axisItem.value;\n\n if (!axisModel || axisValue == null) {\n return;\n }\n\n var axisValueLabel = axisPointerViewHelper.getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\n var axisSectionMarkup = createTooltipMarkup('section', {\n header: axisValueLabel,\n noHeader: !zrUtil.trim(axisValueLabel),\n sortBlocks: true,\n blocks: []\n });\n articleMarkup.blocks.push(axisSectionMarkup);\n zrUtil.each(axisItem.seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var cbParams = series.getDataParams(dataIndex);\n cbParams.axisDim = axisItem.axisDim;\n cbParams.axisIndex = axisItem.axisIndex;\n cbParams.axisType = axisItem.axisType;\n cbParams.axisId = axisItem.axisId;\n cbParams.axisValue = axisHelper.getAxisRawValue(axisModel.axis, {\n value: axisValue\n });\n cbParams.axisValueLabel = axisValueLabel; // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', formatUtil.convertToColorString(cbParams.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\n\n if (seriesTooltipResult.markupFragment) {\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\n }\n\n if (seriesTooltipResult.markupText) {\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\n }\n\n cbParamsList.push(cbParams);\n });\n });\n }); // In most cases, the second axis is displays upper on the first one.\n // So we reverse it to look better.\n\n articleMarkup.blocks.reverse();\n markupTextArrLegacy.reverse();\n var positionExpr = e.position;\n var orderMode = singleTooltipModel.get('order');\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle'));\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '<br/>';\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\n\n this._showOrMove(singleTooltipModel, function () {\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\n } else {\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\n }\n }); // Do not trigger events here, because this branch only be entered\n // from dispatchAction.\n\n };\n\n TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) {\n var ecModel = this._ecModel;\n var ecData = getECData(dispatcher); // Use dataModel in element if possible\n // Used when mouseover on a element like markPoint or edge\n // In which case, the data is not main data in series.\n\n var seriesIndex = ecData.seriesIndex;\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link.\n\n var dataModel = ecData.dataModel || seriesModel;\n var dataIndex = ecData.dataIndex;\n var dataType = ecData.dataType;\n var data = dataModel.getData(dataType);\n var renderMode = this._renderMode;\n var positionDefault = e.positionDefault;\n var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var tooltipTrigger = tooltipModel.get('trigger');\n\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\n return;\n }\n\n var params = dataModel.getDataParams(dataIndex, dataType);\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n params.marker = markupStyleCreator.makeTooltipMarker('item', formatUtil.convertToColorString(params.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\n var orderMode = tooltipModel.get('order');\n var markupText = seriesTooltipResult.markupFragment ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.markupText;\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\n\n this._showOrMove(tooltipModel, function () {\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\n }); // FIXME\n // duplicated showtip if manuallyShowTip is called from dispatchAction.\n\n\n dispatchAction({\n type: 'showTip',\n dataIndexInside: dataIndex,\n dataIndex: data.getRawIndex(dataIndex),\n seriesIndex: seriesIndex,\n from: this.uid\n });\n };\n\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\n var ecData = getECData(el);\n var tooltipConfig = ecData.tooltipConfig;\n var tooltipOpt = tooltipConfig.option;\n\n if (zrUtil.isString(tooltipOpt)) {\n var content = tooltipOpt;\n tooltipOpt = {\n content: content,\n // Fixed formatter\n formatter: content\n };\n }\n\n var tooltipModelCascade = [tooltipOpt];\n\n var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\n\n if (cmpt) {\n tooltipModelCascade.push(cmpt);\n }\n\n var positionDefault = e.positionDefault;\n var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var defaultHtml = subTooltipModel.get('content');\n var asyncTicket = Math.random() + ''; // PENDING: this case do not support richText style yet.\n\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Do not check whether `trigger` is 'none' here, because `trigger`\n // only works on coordinate system. In fact, we have not found case\n // that requires setting `trigger` nothing on component yet.\n\n this._showOrMove(subTooltipModel, function () {\n // Use formatterParams from element defined in component\n // Avoid users modify it.\n var formatterParams = zrUtil.clone(subTooltipModel.get('formatterParams') || {});\n\n this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\n }); // If not dispatch showTip, tip may be hide triggered by axis.\n\n\n dispatchAction({\n type: 'showTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype._showTooltipContent = function ( // Use Model<TooltipOption> insteadof TooltipModel because this model may be from series or other options.\n // Instead of top level tooltip.\n tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\n // Reset ticket\n this._ticket = '';\n\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\n return;\n }\n\n var tooltipContent = this._tooltipContent;\n var formatter = tooltipModel.get('formatter');\n positionExpr = positionExpr || tooltipModel.get('position');\n var html = defaultHtml;\n\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor'));\n\n var nearPointColor = nearPoint.color;\n\n if (formatter && zrUtil.isString(formatter)) {\n var useUTC = tooltipModel.ecModel.get('useUTC');\n var params0 = zrUtil.isArray(params) ? params[0] : params;\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\n html = formatter;\n\n if (isTimeAxis) {\n html = timeFormat(params0.axisValue, html, useUTC);\n }\n\n html = formatUtil.formatTpl(html, params, true);\n } else if (zrUtil.isFunction(formatter)) {\n var callback = bind(function (cbTicket, html) {\n if (cbTicket === this._ticket) {\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n }\n }, this);\n this._ticket = asyncTicket;\n html = formatter(params, asyncTicket, callback);\n }\n\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n tooltipContent.show(tooltipModel, nearPointColor);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n };\n\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) {\n if (trigger === 'axis' || zrUtil.isArray(tooltipDataParams)) {\n return {\n color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none')\n };\n }\n\n if (!zrUtil.isArray(tooltipDataParams)) {\n return {\n color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\n };\n }\n };\n\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, // Mouse x\n y, // Mouse y\n content, params, el) {\n var viewWidth = this._api.getWidth();\n\n var viewHeight = this._api.getHeight();\n\n positionExpr = positionExpr || tooltipModel.get('position');\n var contentSize = content.getSize();\n var align = tooltipModel.get('align');\n var vAlign = tooltipModel.get('verticalAlign');\n var rect = el && el.getBoundingRect().clone();\n el && rect.applyTransform(el.transform);\n\n if (zrUtil.isFunction(positionExpr)) {\n // Callback of position can be an array or a string specify the position\n positionExpr = positionExpr([x, y], params, content.el, rect, {\n viewSize: [viewWidth, viewHeight],\n contentSize: contentSize.slice()\n });\n }\n\n if (zrUtil.isArray(positionExpr)) {\n x = parsePercent(positionExpr[0], viewWidth);\n y = parsePercent(positionExpr[1], viewHeight);\n } else if (zrUtil.isObject(positionExpr)) {\n var boxLayoutPosition = positionExpr;\n boxLayoutPosition.width = contentSize[0];\n boxLayoutPosition.height = contentSize[1];\n var layoutRect = layoutUtil.getLayoutRect(boxLayoutPosition, {\n width: viewWidth,\n height: viewHeight\n });\n x = layoutRect.x;\n y = layoutRect.y;\n align = null; // When positionExpr is left/top/right/bottom,\n // align and verticalAlign will not work.\n\n vAlign = null;\n } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\n else if (zrUtil.isString(positionExpr) && el) {\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\n x = pos[0];\n y = pos[1];\n } else {\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\n x = pos[0];\n y = pos[1];\n }\n\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\n\n if (shouldTooltipConfine(tooltipModel)) {\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\n x = pos[0];\n y = pos[1];\n }\n\n content.moveTo(x, y);\n }; // FIXME\n // Should we remove this but leave this to user?\n\n\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\n var lastCoordSys = this._lastDataByCoordSys;\n var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;\n contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\n contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) {\n var thisItem = thisDataByAxis[indexAxis] || {};\n var lastIndices = lastItem.seriesDataIndices || [];\n var newIndices = thisItem.seriesDataIndices || [];\n contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;\n contentNotChanged && each(lastIndices, function (lastIdxItem, j) {\n var newIdxItem = newIndices[j];\n contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;\n });\n });\n });\n this._lastDataByCoordSys = dataByCoordSys;\n return !!contentNotChanged;\n };\n\n TooltipView.prototype._hide = function (dispatchAction) {\n // Do not directly hideLater here, because this behavior may be prevented\n // in dispatchAction when showTip is dispatched.\n // FIXME\n // duplicated hideTip if manuallyHideTip is called from dispatchAction.\n this._lastDataByCoordSys = null;\n dispatchAction({\n type: 'hideTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype.dispose = function (ecModel, api) {\n if (env.node) {\n return;\n }\n\n this._tooltipContent.dispose();\n\n globalListener.unregister('itemTooltip', api);\n };\n\n TooltipView.type = 'tooltip';\n return TooltipView;\n}(ComponentView);\n/**\n * From top to bottom. (the last one should be globalTooltipModel);\n */\n\n\nfunction buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n\n if (defaultTooltipOption) {\n resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n } // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n\n\n if (zrUtil.isString(tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n\n if (tooltipOpt) {\n resultModel = new Model(tooltipOpt, resultModel, ecModel);\n }\n }\n }\n\n return resultModel;\n}\n\nfunction makeDispatchAction(payload, api) {\n return payload.dispatchAction || zrUtil.bind(api.dispatchAction, api);\n}\n\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\n var size = content.getOuterSize();\n var width = size.width;\n var height = size.height;\n\n if (gapH != null) {\n // Add extra 2 pixels for this case:\n // At present the \"values\" in defaut tooltip are using CSS `float: right`.\n // When the right edge of the tooltip box is on the right side of the\n // viewport, the `float` layout might push the \"values\" to the second line.\n if (x + width + gapH + 2 > viewWidth) {\n x -= width + gapH;\n } else {\n x += gapH;\n }\n }\n\n if (gapV != null) {\n if (y + height + gapV > viewHeight) {\n y -= height + gapV;\n } else {\n y += gapV;\n }\n }\n\n return [x, y];\n}\n\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\n var size = content.getOuterSize();\n var width = size.width;\n var height = size.height;\n x = Math.min(x + width, viewWidth) - width;\n y = Math.min(y + height, viewHeight) - height;\n x = Math.max(x, 0);\n y = Math.max(y, 0);\n return [x, y];\n}\n\nfunction calcTooltipPosition(position, rect, contentSize) {\n var domWidth = contentSize[0];\n var domHeight = contentSize[1];\n var gap = 10;\n var offset = 5;\n var x = 0;\n var y = 0;\n var rectWidth = rect.width;\n var rectHeight = rect.height;\n\n switch (position) {\n case 'inside':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'top':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y - domHeight - gap;\n break;\n\n case 'bottom':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight + gap;\n break;\n\n case 'left':\n x = rect.x - domWidth - gap - offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'right':\n x = rect.x + rectWidth + gap + offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n }\n\n return [x, y];\n}\n\nfunction isCenterAlign(align) {\n return align === 'center' || align === 'middle';\n}\n/**\n * Find target component by payload like:\n * ```js\n * { legendId: 'some_id', name: 'xxx' }\n * { toolboxIndex: 1, name: 'xxx' }\n * { geoName: 'some_name', name: 'xxx' }\n * ```\n * PENDING: at present only\n *\n * If not found, return null/undefined.\n */\n\n\nfunction findComponentReference(payload, ecModel, api) {\n var queryOptionMap = preParseFinder(payload).queryOptionMap;\n var componentMainType = queryOptionMap.keys()[0];\n\n if (!componentMainType || componentMainType === 'series') {\n return;\n }\n\n var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {\n useDefault: false,\n enableAll: false,\n enableNone: false\n });\n var model = queryResult.models[0];\n\n if (!model) {\n return;\n }\n\n var view = api.getViewOfComponentModel(model);\n var el;\n view.group.traverse(function (subEl) {\n var tooltipConfig = getECData(subEl).tooltipConfig;\n\n if (tooltipConfig && tooltipConfig.name === payload.name) {\n el = subEl;\n return true; // stop\n }\n });\n\n if (el) {\n return {\n componentMainType: componentMainType,\n componentIndex: model.componentIndex,\n el: el\n };\n }\n}\n\nexport default TooltipView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installAxisPointer } from '../axisPointer/install';\nimport { use } from '../../extension';\nimport TooltipModel from './TooltipModel';\nimport TooltipView from './TooltipView';\nexport function install(registers) {\n use(installAxisPointer);\n registers.registerComponentModel(TooltipModel);\n registers.registerComponentView(TooltipView);\n /**\n * @action\n * @property {string} type\n * @property {number} seriesIndex\n * @property {number} dataIndex\n * @property {number} [x]\n * @property {number} [y]\n */\n\n registers.registerAction({\n type: 'showTip',\n event: 'showTip',\n update: 'tooltip:manuallyShowTip'\n }, // noop\n function () {});\n registers.registerAction({\n type: 'hideTip',\n event: 'hideTip',\n update: 'tooltip:manuallyHideTip'\n }, // noop\n function () {});\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { normalizeToArray } from '../../util/model';\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\nexport default function brushPreprocessor(option, isNew) {\n var brushComponents = normalizeToArray(option ? option.brush : []);\n\n if (!brushComponents.length) {\n return;\n }\n\n var brushComponentSpecifiedBtns = [];\n zrUtil.each(brushComponents, function (brushOpt) {\n var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : [];\n\n if (tbs instanceof Array) {\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\n }\n });\n var toolbox = option && option.toolbox;\n\n if (zrUtil.isArray(toolbox)) {\n toolbox = toolbox[0];\n }\n\n if (!toolbox) {\n toolbox = {\n feature: {}\n };\n option.toolbox = [toolbox];\n }\n\n var toolboxFeature = toolbox.feature || (toolbox.feature = {});\n var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\n removeDuplicate(brushTypes);\n\n if (isNew && !brushTypes.length) {\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\n }\n}\n\nfunction removeDuplicate(arr) {\n var map = {};\n zrUtil.each(arr, function (val) {\n map[val] = 1;\n });\n arr.length = 0;\n zrUtil.each(map, function (flag, val) {\n arr.push(val);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @file Visual solution, for consistent option specification.\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport VisualMapping from './VisualMapping';\nimport { getItemVisualFromData, setItemVisualFromData } from './helper';\nvar each = zrUtil.each;\n\nfunction hasKeys(obj) {\n if (obj) {\n for (var name_1 in obj) {\n if (obj.hasOwnProperty(name_1)) {\n return true;\n }\n }\n }\n}\n\nexport function createVisualMappings(option, stateList, supplementVisualOption) {\n var visualMappings = {};\n each(stateList, function (state) {\n var mappings = visualMappings[state] = createMappings();\n each(option[state], function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var mappingOption = {\n type: visualType,\n visual: visualData\n };\n supplementVisualOption && supplementVisualOption(mappingOption, state);\n mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity\n // is not supported, such as rendering using gradient color.\n\n if (visualType === 'opacity') {\n mappingOption = zrUtil.clone(mappingOption);\n mappingOption.type = 'colorAlpha';\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\n }\n });\n });\n return visualMappings;\n\n function createMappings() {\n var Creater = function () {}; // Make sure hidden fields will not be visited by\n // object iteration (with hasOwnProperty checking).\n\n\n Creater.prototype.__hidden = Creater.prototype;\n var obj = new Creater();\n return obj;\n }\n}\nexport function replaceVisualOption(thisOption, newOption, keys) {\n // Visual attributes merge is not supported, otherwise it\n // brings overcomplicated merge logic. See #2853. So if\n // newOption has anyone of these keys, all of these keys\n // will be reset. Otherwise, all keys remain.\n var has;\n zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n has = true;\n }\n });\n has && zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n thisOption[key] = zrUtil.clone(newOption[key]);\n } else {\n delete thisOption[key];\n }\n });\n}\n/**\n * @param stateList\n * @param visualMappings\n * @param list\n * @param getValueState param: valueOrIndex, return: state.\n * @param scope Scope for getValueState\n * @param dimension Concrete dimension, if used.\n */\n// ???! handle brush?\n\nexport function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n var dataIndex;\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n if (dimension == null) {\n data.each(eachItem);\n } else {\n data.each([dimension], eachItem);\n }\n\n function eachItem(valueOrIndex, index) {\n dataIndex = dimension == null ? valueOrIndex // First argument is index\n : index;\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n return;\n }\n\n var valueState = getValueState.call(scope, valueOrIndex);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\n }\n }\n}\n/**\n * @param data\n * @param stateList\n * @param visualMappings <state, Object.<visualType, module:echarts/visual/VisualMapping>>\n * @param getValueState param: valueOrIndex, return: state.\n * @param dim dimension or dimension index.\n */\n\nexport function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n return {\n progress: function progress(params, data) {\n var dimName;\n\n if (dim != null) {\n dimName = data.getDimension(dim);\n }\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n continue;\n }\n\n var value = dim != null ? data.get(dimName, dataIndex) : dataIndex;\n var valueState = getValueState(value);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\n }\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as polygonContain from 'zrender/lib/contain/polygon';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { linePolygonIntersect } from '../../util/graphic';\nexport function makeBrushCommonSelectorForSeries(area) {\n var brushType = area.brushType; // Do not use function binding or curry for performance.\n\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (itemLayout) {\n return selector[brushType].rect(itemLayout, selectors, area);\n }\n };\n return selectors;\n}\nvar selector = {\n lineX: getLineSelectors(0),\n lineY: getLineSelectors(1),\n rect: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n var points = area.range;\n\n if (!itemLayout || points.length <= 1) {\n return false;\n }\n\n var x = itemLayout.x;\n var y = itemLayout.y;\n var width = itemLayout.width;\n var height = itemLayout.height;\n var p = points[0];\n\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n return true;\n }\n }\n }\n};\n\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var p = itemLayout[xyIndex];\n return inLineRange(p, range);\n }\n },\n rect: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n }\n }\n };\n}\n\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\n\nexport default selector;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport * as visualSolution from '../../visual/visualSolution';\nimport { makeBrushCommonSelectorForSeries } from './selector';\nimport * as throttleUtil from '../../util/throttle';\nimport BrushTargetManager from '../helper/BrushTargetManager';\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\nvar DISPATCH_METHOD = '__ecBrushSelect';\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\n;\nexport function layoutCovers(ecModel) {\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\n });\n}\n/**\n * Register the visual encoding if this modules required.\n */\n\nexport default function brushVisual(ecModel, api, payload) {\n var brushSelected = [];\n var throttleType;\n var throttleDelay;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {\n brushType: false\n });\n });\n layoutCovers(ecModel);\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel, brushIndex) {\n var thisBrushSelected = {\n brushId: brushModel.id,\n brushIndex: brushIndex,\n brushName: brushModel.name,\n areas: zrUtil.clone(brushModel.areas),\n selected: []\n }; // Every brush component exists in event params, convenient\n // for user to find by index.\n\n brushSelected.push(thisBrushSelected);\n var brushOption = brushModel.option;\n var brushLink = brushOption.brushLink;\n var linkedSeriesMap = [];\n var selectedDataIndexForLink = [];\n var rangeInfoBySeries = [];\n var hasBrushExists = false;\n\n if (!brushIndex) {\n // Only the first throttle setting works.\n throttleType = brushOption.throttleType;\n throttleDelay = brushOption.throttleDelay;\n } // Add boundingRect and selectors to range.\n\n\n var areas = zrUtil.map(brushModel.areas, function (area) {\n var builder = boundingRectBuilders[area.brushType];\n var selectableArea = zrUtil.defaults({\n boundingRect: builder ? builder(area) : void 0\n }, area);\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\n return selectableArea;\n });\n var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\n mappingOption.mappingMethod = 'fixed';\n });\n zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\n linkedSeriesMap[seriesIndex] = 1;\n });\n\n function linkOthers(seriesIndex) {\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\n } // If no supported brush or no brush on the series,\n // all visuals should be in original state.\n\n\n function brushed(rangeInfoList) {\n return !!rangeInfoList.length;\n }\n /**\n * Logic for each series: (If the logic has to be modified one day, do it carefully!)\n *\n * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.\n * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.\n * └!hasBrushExist┘ └nothing.\n * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.\n * └!hasBrushExist┘ └nothing.\n * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.\n * !brushed┘ └nothing.\n * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.\n */\n // Step A\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\n seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\n });\n\n function stepAParallel(seriesModel, seriesIndex) {\n var coordSys = seriesModel.coordinateSystem;\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\n });\n }\n\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\n return;\n }\n\n zrUtil.each(areas, function (area) {\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\n rangeInfoList.push(area);\n }\n\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\n });\n\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\n var data_1 = seriesModel.getData();\n data_1.each(function (dataIndex) {\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\n selectedDataIndexForLink[dataIndex] = 1;\n }\n });\n }\n } // Step B\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var seriesBrushSelected = {\n seriesId: seriesModel.id,\n seriesIndex: seriesIndex,\n seriesName: seriesModel.name,\n dataIndex: []\n }; // Every series exists in event params, convenient\n // for user to find series by seriesIndex.\n\n thisBrushSelected.selected.push(seriesBrushSelected);\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\n var data = seriesModel.getData();\n var getValueState = linkOthers(seriesIndex) ? function (dataIndex) {\n return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n } : function (dataIndex) {\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n }; // If no supported brush or no brush, all visuals are in original state.\n\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState);\n });\n });\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\n}\n;\n\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\n // This event will not be triggered when `setOpion`, otherwise dead lock may\n // triggered when do `setOption` in event listener, which we do not find\n // satisfactory way to solve yet. Some considered resolutions:\n // (a) Diff with prevoius selected data ant only trigger event when changed.\n // But store previous data and diff precisely (i.e., not only by dataIndex, but\n // also detect value changes in selected data) might bring complexity or fragility.\n // (b) Use spectial param like `silent` to suppress event triggering.\n // But such kind of volatile param may be weird in `setOption`.\n if (!payload) {\n return;\n }\n\n var zr = api.getZr();\n\n if (zr[DISPATCH_FLAG]) {\n return;\n }\n\n if (!zr[DISPATCH_METHOD]) {\n zr[DISPATCH_METHOD] = doDispatch;\n }\n\n var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\n fn(api, brushSelected);\n}\n\nfunction doDispatch(api, brushSelected) {\n if (!api.isDisposed()) {\n var zr = api.getZr();\n zr[DISPATCH_FLAG] = true;\n api.dispatchAction({\n type: 'brushSelect',\n batch: brushSelected\n });\n zr[DISPATCH_FLAG] = false;\n }\n}\n\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\n var area = rangeInfoList[i];\n\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\n return true;\n }\n }\n}\n\nfunction brushModelNotControll(brushModel, seriesIndex) {\n var seriesIndices = brushModel.option.seriesIndex;\n return seriesIndices != null && seriesIndices !== 'all' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);\n}\n\nvar boundingRectBuilders = {\n rect: function (area) {\n return getBoundingRectFromMinMax(area.range);\n },\n polygon: function (area) {\n var minMax;\n var range = area.range;\n\n for (var i = 0, len = range.length; i < len; i++) {\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\n var rg = range[i];\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\n }\n\n return minMax && getBoundingRectFromMinMax(minMax);\n }\n};\n\nfunction getBoundingRectFromMinMax(minMax) {\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BrushController from '../helper/BrushController';\nimport { layoutCovers } from './visualEncoding';\nimport ComponentView from '../../view/Component';\n\nvar BrushView =\n/** @class */\nfunction (_super) {\n __extends(BrushView, _super);\n\n function BrushView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushView.type;\n return _this;\n }\n\n BrushView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n this.model;\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount();\n };\n\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\n this.model = brushModel;\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\n // PENDING: `updateTransform` is a little tricky, whose layout need\n // to be calculate mandatorily and other stages will not be performed.\n // Take care the correctness of the logic. See #11754 .\n layoutCovers(ecModel);\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\n this.updateTransform(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\n // Do not update controller when drawing.\n (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());\n }; // updateLayout: updateController,\n // updateVisual: updateController,\n\n\n BrushView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n BrushView.prototype._onBrush = function (eventParam) {\n var modelId = this.model.id;\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); // Action is not dispatched on drag end, because the drag end\n // emits the same params with the last drag move event, and\n // may have some delay when using touch pad, which makes\n // animation not smooth (when using debounce).\n\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\n type: 'brush',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n eventParam.isEnd && this.api.dispatchAction({\n type: 'brushEnd',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n };\n\n BrushView.type = 'brush';\n return BrushView;\n}(ComponentView);\n\nexport default BrushView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as visualSolution from '../../visual/visualSolution';\nimport Model from '../../model/Model';\nimport ComponentModel from '../../model/Component';\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\n\nvar BrushModel =\n/** @class */\nfunction (_super) {\n __extends(BrushModel, _super);\n\n function BrushModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushModel.type;\n /**\n * @readOnly\n */\n\n _this.areas = [];\n /**\n * Current brush painting area settings.\n * @readOnly\n */\n\n _this.brushOption = {};\n return _this;\n }\n\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\n var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time.\n\n thisOption.outOfBrush = thisOption.outOfBrush || {\n color: DEFAULT_OUT_OF_BRUSH_COLOR\n };\n\n if (!inBrush.hasOwnProperty('liftZ')) {\n // Bigger than the highlight z lift, otherwise it will\n // be effected by the highlight z when brush.\n inBrush.liftZ = 5;\n }\n };\n /**\n * If `areas` is null/undefined, range state remain.\n */\n\n\n BrushModel.prototype.setAreas = function (areas) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isArray(areas));\n zrUtil.each(areas, function (area) {\n zrUtil.assert(area.brushType, 'Illegal areas');\n });\n } // If areas is null/undefined, range state remain.\n // This helps user to dispatchAction({type: 'brush'}) with no areas\n // set but just want to get the current brush select info from a `brush` event.\n\n\n if (!areas) {\n return;\n }\n\n this.areas = zrUtil.map(areas, function (area) {\n return generateBrushOption(this.option, area);\n }, this);\n };\n /**\n * Set the current painting brush option.\n */\n\n\n BrushModel.prototype.setBrushOption = function (brushOption) {\n this.brushOption = generateBrushOption(this.option, brushOption);\n this.brushType = this.brushOption.brushType;\n };\n\n BrushModel.type = 'brush';\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\n BrushModel.defaultOption = {\n seriesIndex: 'all',\n brushType: 'rect',\n brushMode: 'single',\n transformable: true,\n brushStyle: {\n borderWidth: 1,\n color: 'rgba(210,219,238,0.3)',\n borderColor: '#D2DBEE'\n },\n throttleType: 'fixRate',\n throttleDelay: 0,\n removeOnClick: true,\n z: 10000\n };\n return BrushModel;\n}(ComponentModel);\n\nfunction generateBrushOption(option, brushOption) {\n return zrUtil.merge({\n brushType: option.brushType,\n brushMode: option.brushMode,\n transformable: option.transformable,\n brushStyle: new Model(option.brushStyle).getItemStyle(),\n removeOnClick: option.removeOnClick,\n z: option.z\n }, brushOption, true);\n}\n\nexport default BrushModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { ToolboxFeature } from '../featureManager';\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\n\nvar BrushFeature =\n/** @class */\nfunction (_super) {\n __extends(BrushFeature, _super);\n\n function BrushFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\n var brushType;\n var brushMode;\n var isBrushed;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n brushType = brushModel.brushType;\n brushMode = brushModel.brushOption.brushMode || 'single';\n isBrushed = isBrushed || !!brushModel.areas.length;\n });\n this._brushType = brushType;\n this._brushMode = brushMode;\n zrUtil.each(featureModel.get('type', true), function (type) {\n featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal');\n });\n };\n\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\n this.render(featureModel, ecModel, api);\n };\n\n BrushFeature.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon', true);\n var icons = {};\n zrUtil.each(model.get('type', true), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n ;\n\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\n var brushType = this._brushType;\n var brushMode = this._brushMode;\n\n if (type === 'clear') {\n // Trigger parallel action firstly\n api.dispatchAction({\n type: 'axisAreaSelect',\n intervals: []\n });\n api.dispatchAction({\n type: 'brush',\n command: 'clear',\n // Clear all areas of all brush components.\n areas: []\n });\n } else {\n api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'brush',\n brushOption: {\n brushType: type === 'keep' ? brushType : brushType === type ? false : type,\n brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode\n }\n });\n }\n };\n\n ;\n\n BrushFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: ICON_TYPES.slice(),\n icon: {\n /* eslint-disable */\n rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\n polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\n lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\n lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\n keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\n clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line\n\n /* eslint-enable */\n\n },\n // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\n title: ecModel.getLocale(['toolbox', 'brush', 'title'])\n };\n return defaultOption;\n };\n\n return BrushFeature;\n}(ToolboxFeature);\n\nexport default BrushFeature;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport brushPreprocessor from './preprocessor';\nimport BrushView from './BrushView';\nimport BrushModel from './BrushModel';\nimport brushVisual from './visualEncoding'; // TODO\n\nimport BrushFeature from '../toolbox/feature/Brush';\nimport { registerFeature } from '../toolbox/featureManager';\nexport function install(registers) {\n registers.registerComponentView(BrushView);\n registers.registerComponentModel(BrushModel);\n registers.registerPreprocessor(brushPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\n registers.registerAction({\n type: 'brush',\n event: 'brush',\n update: 'updateVisual'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'brush',\n query: payload\n }, function (brushModel) {\n brushModel.setAreas(payload.areas);\n });\n });\n /**\n * payload: {\n * brushComponents: [\n * {\n * brushId,\n * brushIndex,\n * brushName,\n * series: [\n * {\n * seriesId,\n * seriesIndex,\n * seriesName,\n * rawIndices: [21, 34, ...]\n * },\n * ...\n * ]\n * },\n * ...\n * ]\n * }\n */\n\n registers.registerAction({\n type: 'brushSelect',\n event: 'brushSelected',\n update: 'none'\n }, function () {});\n registers.registerAction({\n type: 'brushEnd',\n event: 'brushEnd',\n update: 'none'\n }, function () {});\n registerFeature('brush', BrushFeature);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport { getECData } from '../../util/innerStore';\nimport { createTextStyle } from '../../label/labelStyle';\nimport { getLayoutRect } from '../../util/layout';\nimport ComponentModel from '../../model/Component';\nimport ComponentView from '../../view/Component';\nimport { windowOpen } from '../../util/format';\n\nvar TitleModel =\n/** @class */\nfunction (_super) {\n __extends(TitleModel, _super);\n\n function TitleModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleModel.type;\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n return _this;\n }\n\n TitleModel.type = 'title';\n TitleModel.defaultOption = {\n zlevel: 0,\n z: 6,\n show: true,\n text: '',\n target: 'blank',\n subtext: '',\n subtarget: 'blank',\n left: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n textStyle: {\n fontSize: 18,\n fontWeight: 'bold',\n color: '#464646'\n },\n subtextStyle: {\n fontSize: 12,\n color: '#6E7079'\n }\n };\n return TitleModel;\n}(ComponentModel); // View\n\n\nvar TitleView =\n/** @class */\nfunction (_super) {\n __extends(TitleView, _super);\n\n function TitleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleView.type;\n return _this;\n }\n\n TitleView.prototype.render = function (titleModel, ecModel, api) {\n this.group.removeAll();\n\n if (!titleModel.get('show')) {\n return;\n }\n\n var group = this.group;\n var textStyleModel = titleModel.getModel('textStyle');\n var subtextStyleModel = titleModel.getModel('subtextStyle');\n var textAlign = titleModel.get('textAlign');\n var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\n var textEl = new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: titleModel.get('text'),\n fill: textStyleModel.getTextColor()\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var textRect = textEl.getBoundingRect();\n var subText = titleModel.get('subtext');\n var subTextEl = new graphic.Text({\n style: createTextStyle(subtextStyleModel, {\n text: subText,\n fill: subtextStyleModel.getTextColor(),\n y: textRect.height + titleModel.get('itemGap'),\n verticalAlign: 'top'\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var link = titleModel.get('link');\n var sublink = titleModel.get('sublink');\n var triggerEvent = titleModel.get('triggerEvent', true);\n textEl.silent = !link && !triggerEvent;\n subTextEl.silent = !sublink && !triggerEvent;\n\n if (link) {\n textEl.on('click', function () {\n windowOpen(link, '_' + titleModel.get('target'));\n });\n }\n\n if (sublink) {\n subTextEl.on('click', function () {\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\n });\n }\n\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {\n componentType: 'title',\n componentIndex: titleModel.componentIndex\n } : null;\n group.add(textEl);\n subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line.\n\n var groupRect = group.getBoundingRect();\n var layoutOption = titleModel.getBoxLayoutParams();\n layoutOption.width = groupRect.width;\n layoutOption.height = groupRect.height;\n var layoutRect = getLayoutRect(layoutOption, {\n width: api.getWidth(),\n height: api.getHeight()\n }, titleModel.get('padding')); // Adjust text align based on position\n\n if (!textAlign) {\n // Align left if title is on the left. center and right is same\n textAlign = titleModel.get('left') || titleModel.get('right'); // @ts-ignore\n\n if (textAlign === 'middle') {\n textAlign = 'center';\n } // Adjust layout by text align\n\n\n if (textAlign === 'right') {\n layoutRect.x += layoutRect.width;\n } else if (textAlign === 'center') {\n layoutRect.x += layoutRect.width / 2;\n }\n }\n\n if (!textVerticalAlign) {\n textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); // @ts-ignore\n\n if (textVerticalAlign === 'center') {\n textVerticalAlign = 'middle';\n }\n\n if (textVerticalAlign === 'bottom') {\n layoutRect.y += layoutRect.height;\n } else if (textVerticalAlign === 'middle') {\n layoutRect.y += layoutRect.height / 2;\n }\n\n textVerticalAlign = textVerticalAlign || 'top';\n }\n\n group.x = layoutRect.x;\n group.y = layoutRect.y;\n group.markRedraw();\n var alignStyle = {\n align: textAlign,\n verticalAlign: textVerticalAlign\n };\n textEl.setStyle(alignStyle);\n subTextEl.setStyle(alignStyle); // Render background\n // Get groupRect again because textAlign has been changed\n\n groupRect = group.getBoundingRect();\n var padding = layoutRect.margin;\n var style = titleModel.getItemStyle(['color', 'opacity']);\n style.fill = titleModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: groupRect.x - padding[3],\n y: groupRect.y - padding[0],\n width: groupRect.width + padding[1] + padding[3],\n height: groupRect.height + padding[0] + padding[2],\n r: titleModel.get('borderRadius')\n },\n style: style,\n subPixelOptimize: true,\n silent: true\n });\n group.add(rect);\n };\n\n TitleView.type = 'title';\n return TitleView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(TitleModel);\n registers.registerComponentView(TitleView);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\nimport List from '../../data/List';\nimport { each, isObject, clone } from 'zrender/lib/core/util';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model';\n\nvar TimelineModel =\n/** @class */\nfunction (_super) {\n __extends(TimelineModel, _super);\n\n function TimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineModel.type;\n _this.layoutMode = 'box';\n return _this;\n }\n /**\n * @override\n */\n\n\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._initData();\n };\n /**\n * @override\n */\n\n\n TimelineModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this._initData();\n };\n\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n if (currentIndex == null) {\n currentIndex = this.option.currentIndex;\n }\n\n var count = this._data.count();\n\n if (this.option.loop) {\n currentIndex = (currentIndex % count + count) % count;\n } else {\n currentIndex >= count && (currentIndex = count - 1);\n currentIndex < 0 && (currentIndex = 0);\n }\n\n this.option.currentIndex = currentIndex;\n };\n /**\n * @return {number} currentIndex\n */\n\n\n TimelineModel.prototype.getCurrentIndex = function () {\n return this.option.currentIndex;\n };\n /**\n * @return {boolean}\n */\n\n\n TimelineModel.prototype.isIndexMax = function () {\n return this.getCurrentIndex() >= this._data.count() - 1;\n };\n /**\n * @param {boolean} state true: play, false: stop\n */\n\n\n TimelineModel.prototype.setPlayState = function (state) {\n this.option.autoPlay = !!state;\n };\n /**\n * @return {boolean} true: play, false: stop\n */\n\n\n TimelineModel.prototype.getPlayState = function () {\n return !!this.option.autoPlay;\n };\n /**\n * @private\n */\n\n\n TimelineModel.prototype._initData = function () {\n var thisOption = this.option;\n var dataArr = thisOption.data || [];\n var axisType = thisOption.axisType;\n var names = this._names = [];\n var processedDataArr;\n\n if (axisType === 'category') {\n processedDataArr = [];\n each(dataArr, function (item, index) {\n var value = convertOptionIdName(getDataItemValue(item), '');\n var newItem;\n\n if (isObject(item)) {\n newItem = clone(item);\n newItem.value = index;\n } else {\n newItem = index;\n }\n\n processedDataArr.push(newItem);\n names.push(value);\n });\n } else {\n processedDataArr = dataArr;\n }\n\n var dimType = {\n category: 'ordinal',\n time: 'time',\n value: 'number'\n }[axisType] || 'number';\n var data = this._data = new List([{\n name: 'value',\n type: dimType\n }], this);\n data.initData(processedDataArr, names);\n };\n\n TimelineModel.prototype.getData = function () {\n return this._data;\n };\n /**\n * @public\n * @return {Array.<string>} categoreis\n */\n\n\n TimelineModel.prototype.getCategories = function () {\n if (this.get('axisType') === 'category') {\n return this._names.slice();\n }\n };\n\n TimelineModel.type = 'timeline';\n /**\n * @protected\n */\n\n TimelineModel.defaultOption = {\n zlevel: 0,\n z: 4,\n show: true,\n axisType: 'time',\n realtime: true,\n left: '20%',\n top: null,\n right: '20%',\n bottom: 0,\n width: null,\n height: 40,\n padding: 5,\n controlPosition: 'left',\n autoPlay: false,\n rewind: false,\n loop: true,\n playInterval: 2000,\n currentIndex: 0,\n itemStyle: {},\n label: {\n color: '#000'\n },\n data: []\n };\n return TimelineModel;\n}(ComponentModel);\n\nexport default TimelineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport TimelineModel from './TimelineModel';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat';\nimport { mixin } from 'zrender/lib/core/util';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar SliderTimelineModel =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineModel, _super);\n\n function SliderTimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineModel.type;\n return _this;\n }\n\n SliderTimelineModel.type = 'timeline.slider';\n /**\n * @protected\n */\n\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n orient: 'horizontal',\n inverse: false,\n tooltip: {\n trigger: 'item' // data item may also have tootip attr.\n\n },\n symbol: 'circle',\n symbolSize: 12,\n lineStyle: {\n show: true,\n width: 2,\n color: '#DAE1F5'\n },\n label: {\n position: 'auto',\n // When using number, label position is not\n // restricted by viewRect.\n // positive: right/bottom, negative: left/top\n show: true,\n interval: 'auto',\n rotate: 0,\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#A4B1D7'\n },\n itemStyle: {\n color: '#A4B1D7',\n borderWidth: 1\n },\n checkpointStyle: {\n symbol: 'circle',\n symbolSize: 15,\n color: '#316bf3',\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0, 0, 0, 0.3)',\n // borderColor: 'rgba(194,53,49, 0.5)',\n animation: true,\n animationDuration: 300,\n animationEasing: 'quinticInOut'\n },\n controlStyle: {\n show: true,\n showPlayBtn: true,\n showPrevBtn: true,\n showNextBtn: true,\n itemSize: 24,\n itemGap: 12,\n position: 'left',\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\n prevBtnSize: 18,\n nextBtnSize: 18,\n color: '#A4B1D7',\n borderColor: '#A4B1D7',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#6f778d'\n },\n itemStyle: {\n color: '#316BF3'\n },\n controlStyle: {\n color: '#316BF3',\n borderColor: '#316BF3',\n borderWidth: 2\n }\n },\n progress: {\n lineStyle: {\n color: '#316BF3'\n },\n itemStyle: {\n color: '#316BF3'\n },\n label: {\n color: '#6f778d'\n }\n },\n data: []\n });\n return SliderTimelineModel;\n}(TimelineModel);\n\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\nexport default SliderTimelineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component';\n\nvar TimelineView =\n/** @class */\nfunction (_super) {\n __extends(TimelineView, _super);\n\n function TimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineView.type;\n return _this;\n }\n\n TimelineView.type = 'timeline';\n return TimelineView;\n}(ComponentView);\n\nexport default TimelineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../../coord/Axis';\n/**\n * Extend axis 2d\n */\n\nvar TimelineAxis =\n/** @class */\nfunction (_super) {\n __extends(TimelineAxis, _super);\n\n function TimelineAxis(dim, scale, coordExtent, axisType) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n return _this;\n }\n /**\n * @override\n */\n\n\n TimelineAxis.prototype.getLabelModel = function () {\n // Force override\n return this.model.getModel('label');\n };\n /**\n * @override\n */\n\n\n TimelineAxis.prototype.isHorizontal = function () {\n return this.model.get('orient') === 'horizontal';\n };\n\n return TimelineAxis;\n}(Axis);\n\nexport default TimelineAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as graphic from '../../util/graphic';\nimport { createTextStyle } from '../../label/labelStyle';\nimport * as layout from '../../util/layout';\nimport TimelineView from './TimelineView';\nimport TimelineAxis from './TimelineAxis';\nimport { createSymbol } from '../../util/symbol';\nimport * as numberUtil from '../../util/number';\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/lib/core/util';\nimport OrdinalScale from '../../scale/Ordinal';\nimport TimeScale from '../../scale/Time';\nimport IntervalScale from '../../scale/Interval';\nimport { parsePercent } from 'zrender/lib/contain/text';\nimport { makeInner } from '../../util/model';\nimport { getECData } from '../../util/innerStore';\nimport { enableHoverEmphasis } from '../../util/states';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup';\nvar PI = Math.PI;\nvar labelDataIndexStore = makeInner();\n\nvar SliderTimelineView =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineView, _super);\n\n function SliderTimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineView.type;\n return _this;\n }\n\n SliderTimelineView.prototype.init = function (ecModel, api) {\n this.api = api;\n };\n /**\n * @override\n */\n\n\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\n this.model = timelineModel;\n this.api = api;\n this.ecModel = ecModel;\n this.group.removeAll();\n\n if (timelineModel.get('show', true)) {\n var layoutInfo_1 = this._layout(timelineModel, api);\n\n var mainGroup_1 = this._createGroup('_mainGroup');\n\n var labelGroup = this._createGroup('_labelGroup');\n\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\n\n timelineModel.formatTooltip = function (dataIndex) {\n var name = axis_1.scale.getLabel({\n value: dataIndex\n });\n return createTooltipMarkup('nameValue', {\n noName: true,\n value: name\n });\n };\n\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\n }, this);\n\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\n\n this._position(layoutInfo_1, timelineModel);\n }\n\n this._doPlayStop();\n\n this._updateTicksStatus();\n };\n /**\n * @override\n */\n\n\n SliderTimelineView.prototype.remove = function () {\n this._clearTimer();\n\n this.group.removeAll();\n };\n /**\n * @override\n */\n\n\n SliderTimelineView.prototype.dispose = function () {\n this._clearTimer();\n };\n\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\n var labelPosOpt = timelineModel.get(['label', 'position']);\n var orient = timelineModel.get('orient');\n var viewRect = getViewRect(timelineModel, api);\n var parsedLabelPos; // Auto label offset.\n\n if (labelPosOpt == null || labelPosOpt === 'auto') {\n parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-';\n } else if (isString(labelPosOpt)) {\n parsedLabelPos = {\n horizontal: {\n top: '-',\n bottom: '+'\n },\n vertical: {\n left: '-',\n right: '+'\n }\n }[orient][labelPosOpt];\n } else {\n // is number\n parsedLabelPos = labelPosOpt;\n }\n\n var labelAlignMap = {\n horizontal: 'center',\n vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right'\n };\n var labelBaselineMap = {\n horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom',\n vertical: 'middle'\n };\n var rotationMap = {\n horizontal: 0,\n vertical: PI / 2\n }; // Position\n\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\n var controlModel = timelineModel.getModel('controlStyle');\n var showControl = controlModel.get('show', true);\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\n var sizePlusGap = controlSize + controlGap; // Special label rotate.\n\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\n labelRotation = labelRotation * PI / 180; // To radian.\n\n var playPosition;\n var prevBtnPosition;\n var nextBtnPosition;\n var controlPosition = controlModel.get('position', true);\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\n var xLeft = 0;\n var xRight = mainLength; // position[0] means left, position[1] means middle.\n\n if (controlPosition === 'left' || controlPosition === 'bottom') {\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n } else {\n // 'top' 'right'\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n }\n\n var axisExtent = [xLeft, xRight];\n\n if (timelineModel.get('inverse')) {\n axisExtent.reverse();\n }\n\n return {\n viewRect: viewRect,\n mainLength: mainLength,\n orient: orient,\n rotation: rotationMap[orient],\n labelRotation: labelRotation,\n labelPosOpt: parsedLabelPos,\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\n labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient],\n // Based on mainGroup.\n playPosition: playPosition,\n prevBtnPosition: prevBtnPosition,\n nextBtnPosition: nextBtnPosition,\n axisExtent: axisExtent,\n controlSize: controlSize,\n controlGap: controlGap\n };\n };\n\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\n // Position is be called finally, because bounding rect is needed for\n // adapt content to fill viewRect (auto adapt offset).\n // Timeline may be not all in the viewRect when 'offset' is specified\n // as a number, because it is more appropriate that label aligns at\n // 'offset' but not the other edge defined by viewRect.\n var mainGroup = this._mainGroup;\n var labelGroup = this._labelGroup;\n var viewRect = layoutInfo.viewRect;\n\n if (layoutInfo.orient === 'vertical') {\n // transform to horizontal, inverse rotate by left-top point.\n var m = matrix.create();\n var rotateOriginX = viewRect.x;\n var rotateOriginY = viewRect.y + viewRect.height;\n matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\n matrix.rotate(m, m, -PI / 2);\n matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\n viewRect = viewRect.clone();\n viewRect.applyTransform(m);\n }\n\n var viewBound = getBound(viewRect);\n var mainBound = getBound(mainGroup.getBoundingRect());\n var labelBound = getBound(labelGroup.getBoundingRect());\n var mainPosition = [mainGroup.x, mainGroup.y];\n var labelsPosition = [labelGroup.x, labelGroup.y];\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\n var labelPosOpt = layoutInfo.labelPosOpt;\n\n if (labelPosOpt == null || isString(labelPosOpt)) {\n // '+' or '-'\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\n } else {\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\n }\n\n mainGroup.setPosition(mainPosition);\n labelGroup.setPosition(labelsPosition);\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\n setOrigin(mainGroup);\n setOrigin(labelGroup);\n\n function setOrigin(targetGroup) {\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\n }\n\n function getBound(rect) {\n // [[xmin, xmax], [ymin, ymax]]\n return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];\n }\n\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\n }\n };\n\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\n var data = timelineModel.getData();\n var axisType = timelineModel.get('axisType');\n var scale = createScaleByModel(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`.\n\n scale.getTicks = function () {\n return data.mapArray(['value'], function (value) {\n return {\n value: value\n };\n });\n };\n\n var dataExtent = data.getDataExtent('value');\n scale.setExtent(dataExtent[0], dataExtent[1]);\n scale.niceTicks();\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\n axis.model = timelineModel;\n return axis;\n };\n\n SliderTimelineView.prototype._createGroup = function (key) {\n var newGroup = this[key] = new graphic.Group();\n this.group.add(newGroup);\n return newGroup;\n };\n\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\n var axisExtent = axis.getExtent();\n\n if (!timelineModel.get(['lineStyle', 'show'])) {\n return;\n }\n\n var line = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n y1: 0,\n x2: axisExtent[1],\n y2: 0\n },\n style: extend({\n lineCap: 'round'\n }, timelineModel.getModel('lineStyle').getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(line);\n var progressLine = this._progressLine = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],\n y1: 0,\n y2: 0\n },\n style: defaults({\n lineCap: 'round',\n lineWidth: line.style.lineWidth\n }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(progressLine);\n };\n\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy.\n\n var ticks = axis.scale.getTicks();\n this._tickSymbols = []; // The value is dataIndex, see the costomized scale.\n\n each(ticks, function (tick) {\n var tickCoord = axis.dataToCoord(tick.value);\n var itemModel = data.getItemModel(tick.value);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\n var symbolOpt = {\n x: tickCoord,\n y: 0,\n onclick: bind(_this._changeTimeline, _this, tick.value)\n };\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\n enableHoverEmphasis(el);\n var ecData = getECData(el);\n\n if (itemModel.get('tooltip')) {\n ecData.dataIndex = tick.value;\n ecData.dataModel = timelineModel;\n } else {\n ecData.dataIndex = ecData.dataModel = null;\n }\n\n _this._tickSymbols.push(el);\n });\n };\n\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var labelModel = axis.getLabelModel();\n\n if (!labelModel.get('show')) {\n return;\n }\n\n var data = timelineModel.getData();\n var labels = axis.getViewLabels();\n this._tickLabels = [];\n each(labels, function (labelItem) {\n // The tickValue is dataIndex, see the costomized scale.\n var dataIndex = labelItem.tickValue;\n var itemModel = data.getItemModel(dataIndex);\n var normalLabelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: 0,\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\n onclick: bind(_this._changeTimeline, _this, dataIndex),\n silent: false,\n style: createTextStyle(normalLabelModel, {\n text: labelItem.formattedLabel,\n align: layoutInfo.labelAlign,\n verticalAlign: layoutInfo.labelBaseline\n })\n });\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\n group.add(textEl);\n enableHoverEmphasis(textEl);\n labelDataIndexStore(textEl).dataIndex = dataIndex;\n\n _this._tickLabels.push(textEl);\n });\n };\n\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\n var controlSize = layoutInfo.controlSize;\n var rotation = layoutInfo.rotation;\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\n var playState = timelineModel.getPlayState();\n var inverse = timelineModel.get('inverse', true);\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\n makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true);\n\n function makeBtn(position, iconName, onclick, willRotate) {\n if (!position) {\n return;\n }\n\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\n var rect = [0, -iconSize / 2, iconSize, iconSize];\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, {\n x: position[0],\n y: position[1],\n originX: controlSize / 2,\n originY: 0,\n rotation: willRotate ? -rotation : 0,\n rectHover: true,\n style: itemStyle,\n onclick: onclick\n });\n btn.ensureState('emphasis').style = hoverStyle;\n group.add(btn);\n enableHoverEmphasis(btn);\n }\n };\n\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\n var data = timelineModel.getData();\n var currentIndex = timelineModel.getCurrentIndex();\n var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');\n var me = this;\n var callback = {\n onCreate: function (pointer) {\n pointer.draggable = true;\n pointer.drift = bind(me._handlePointerDrag, me);\n pointer.ondragend = bind(me._handlePointerDragend, me);\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\n },\n onUpdate: function (pointer) {\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\n }\n }; // Reuse when exists, for animation and drag.\n\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\n };\n\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\n this._clearTimer();\n\n this.api.dispatchAction({\n type: 'timelinePlayChange',\n playState: nextState,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\n this._clearTimer();\n\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\n };\n\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\n };\n\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\n var toCoord = this._toAxisCoord(mousePos)[0];\n\n var axis = this._axis;\n var axisExtent = numberUtil.asc(axis.getExtent().slice());\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\n this._currentPointer.x = toCoord;\n\n this._currentPointer.markRedraw();\n\n this._progressLine.shape.x2 = toCoord;\n\n this._progressLine.dirty();\n\n var targetDataIndex = this._findNearestTick(toCoord);\n\n var timelineModel = this.model;\n\n if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) {\n this._changeTimeline(targetDataIndex);\n }\n };\n\n SliderTimelineView.prototype._doPlayStop = function () {\n var _this = this;\n\n this._clearTimer();\n\n if (this.model.getPlayState()) {\n this._timer = setTimeout(function () {\n // Do not cache\n var timelineModel = _this.model;\n\n _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1));\n }, this.model.get('playInterval'));\n }\n };\n\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\n var trans = this._mainGroup.getLocalTransform();\n\n return graphic.applyTransform(vertex, trans, true);\n };\n\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\n var data = this.model.getData();\n var dist = Infinity;\n var targetDataIndex;\n var axis = this._axis;\n data.each(['value'], function (value, dataIndex) {\n var coord = axis.dataToCoord(value);\n var d = Math.abs(coord - axisCoord);\n\n if (d < dist) {\n dist = d;\n targetDataIndex = dataIndex;\n }\n });\n return targetDataIndex;\n };\n\n SliderTimelineView.prototype._clearTimer = function () {\n if (this._timer) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n };\n\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\n var currentIndex = this.model.getCurrentIndex();\n\n if (nextIndex === '+') {\n nextIndex = currentIndex + 1;\n } else if (nextIndex === '-') {\n nextIndex = currentIndex - 1;\n }\n\n this.api.dispatchAction({\n type: 'timelineChange',\n currentIndex: nextIndex,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._updateTicksStatus = function () {\n var currentIndex = this.model.getCurrentIndex();\n var tickSymbols = this._tickSymbols;\n var tickLabels = this._tickLabels;\n\n if (tickSymbols) {\n for (var i = 0; i < tickSymbols.length; i++) {\n tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex);\n }\n }\n\n if (tickLabels) {\n for (var i = 0; i < tickLabels.length; i++) {\n tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\n }\n }\n };\n\n SliderTimelineView.type = 'timeline.slider';\n return SliderTimelineView;\n}(TimelineView);\n\nfunction createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // default to be value\n return new IntervalScale();\n }\n }\n}\n\nfunction getViewRect(model, api) {\n return layout.getLayoutRect(model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n }, model.get('padding'));\n}\n\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\n var style = opts.style;\n var icon = graphic.createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt.\n\n if (style) {\n icon.setStyle(style);\n }\n\n return icon;\n}\n/**\n * Create symbol or update symbol\n * opt: basic position and event handlers\n */\n\n\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n } else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n\n callback && callback.onUpdate(symbol);\n } // Style\n\n\n var itemStyle = itemStyleModel.getItemStyle(['color']);\n symbol.setStyle(itemStyle); // Transform and events.\n\n opt = merge({\n rectHover: true,\n z2: 100\n }, opt, true);\n var symbolSize = hostModel.get('symbolSize');\n symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize];\n opt.scaleX = symbolSize[0] / 2;\n opt.scaleY = symbolSize[1] / 2;\n var symbolOffset = hostModel.get('symbolOffset');\n\n if (symbolOffset) {\n opt.x = opt.x || 0;\n opt.y = opt.y || 0;\n opt.x += numberUtil.parsePercent(symbolOffset[0], symbolSize[0]);\n opt.y += numberUtil.parsePercent(symbolOffset[1], symbolSize[1]);\n }\n\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n symbol.attr(opt); // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\n symbol.updateTransform();\n return symbol;\n}\n\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\n if (pointer.dragging) {\n return;\n }\n\n var pointerModel = timelineModel.getModel('checkpointStyle');\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\n\n if (noAnimation || !pointerModel.get('animation', true)) {\n pointer.attr({\n x: toCoord,\n y: 0\n });\n progressLine && progressLine.attr({\n shape: {\n x2: toCoord\n }\n });\n } else {\n var animationCfg = {\n duration: pointerModel.get('animationDuration', true),\n easing: pointerModel.get('animationEasing', true)\n };\n pointer.stopAnimation(null, true);\n pointer.animateTo({\n x: toCoord,\n y: 0\n }, animationCfg);\n progressLine && progressLine.animateTo({\n shape: {\n x2: toCoord\n }\n }, animationCfg);\n }\n}\n\nexport default SliderTimelineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { defaults } from 'zrender/lib/core/util';\nexport function installTimelineAction(registers) {\n registers.registerAction({\n type: 'timelineChange',\n event: 'timelineChanged',\n update: 'prepareAndUpdate'\n }, function (payload, ecModel) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.currentIndex != null) {\n timelineModel.setCurrentIndex(payload.currentIndex);\n\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {\n timelineModel.setPlayState(false);\n }\n } // Set normalized currentIndex to payload.\n\n\n ecModel.resetOption('timeline', {\n replaceMerge: timelineModel.get('replaceMerge', true)\n });\n return defaults({\n currentIndex: timelineModel.option.currentIndex\n }, payload);\n });\n registers.registerAction({\n type: 'timelinePlayChange',\n event: 'timelinePlayChanged',\n update: 'update'\n }, function (payload, ecModel) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.playState != null) {\n timelineModel.setPlayState(payload.playState);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function timelinePreprocessor(option) {\n var timelineOpt = option && option.timeline;\n\n if (!zrUtil.isArray(timelineOpt)) {\n timelineOpt = timelineOpt ? [timelineOpt] : [];\n }\n\n zrUtil.each(timelineOpt, function (opt) {\n if (!opt) {\n return;\n }\n\n compatibleEC2(opt);\n });\n}\n\nfunction compatibleEC2(opt) {\n var type = opt.type;\n var ec2Types = {\n 'number': 'value',\n 'time': 'time'\n }; // Compatible with ec2\n\n if (ec2Types[type]) {\n opt.axisType = ec2Types[type];\n delete opt.type;\n }\n\n transferItem(opt);\n\n if (has(opt, 'controlPosition')) {\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\n\n if (!has(controlStyle, 'position')) {\n controlStyle.position = opt.controlPosition;\n }\n\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\n controlStyle.show = false;\n delete controlStyle.position;\n }\n\n delete opt.controlPosition;\n }\n\n zrUtil.each(opt.data || [], function (dataItem) {\n if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\n // In ec2, using name as value.\n dataItem.value = dataItem.name;\n }\n\n transferItem(dataItem);\n }\n });\n}\n\nfunction transferItem(opt) {\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out\n\n var label = opt.label || opt.label || {};\n var labelNormal = label.normal || (label.normal = {});\n var excludeLabelAttr = {\n normal: 1,\n emphasis: 1\n };\n zrUtil.each(label, function (value, name) {\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\n labelNormal[name] = value;\n }\n });\n\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\n label.emphasis = itemStyleEmphasis.label;\n delete itemStyleEmphasis.label;\n }\n}\n\nfunction has(obj, attr) {\n return obj.hasOwnProperty(attr);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport SliderTimelineModel from './SliderTimelineModel';\nimport SliderTimelineView from './SliderTimelineView';\nimport { installTimelineAction } from './timelineAction';\nimport preprocessor from './preprocessor';\nexport function install(registers) {\n registers.registerComponentModel(SliderTimelineModel);\n registers.registerComponentView(SliderTimelineView);\n registers.registerSubTypeDefaulter('timeline', function () {\n // Only slider now.\n return 'slider';\n });\n installTimelineAction(registers);\n registers.registerPreprocessor(preprocessor);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util';\nexport default function checkMarkerInSeries(seriesOpts, markerType) {\n if (!seriesOpts) {\n return false;\n }\n\n var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\n\n for (var idx = 0; idx < seriesOptArr.length; idx++) {\n if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {\n return true;\n }\n }\n\n return false;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat';\nimport ComponentModel from '../../model/Component';\nimport { makeInner, defaultEmphasis } from '../../util/model';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup';\n\nfunction fillLabel(opt) {\n defaultEmphasis(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }\n\n\nvar inner = makeInner();\n\nvar MarkerModel =\n/** @class */\nfunction (_super) {\n __extends(MarkerModel, _super);\n\n function MarkerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerModel.type;\n /**\n * If marker model is created by self from series\n */\n\n _this.createdBySelf = false;\n return _this;\n }\n /**\n * @overrite\n */\n\n\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n if (this.type === 'marker') {\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._mergeOption(option, ecModel, false, true);\n };\n\n MarkerModel.prototype.isAnimationEnabled = function () {\n if (env.node) {\n return false;\n }\n\n var hostSeries = this.__hostSeries;\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\n };\n /**\n * @overrite\n */\n\n\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\n this._mergeOption(newOpt, ecModel, false, false);\n };\n\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\n var componentType = this.mainType;\n\n if (!createdBySelf) {\n ecModel.eachSeries(function (seriesModel) {\n // mainType can be markPoint, markLine, markArea\n var markerOpt = seriesModel.get(this.mainType, true);\n var markerModel = inner(seriesModel)[componentType];\n\n if (!markerOpt || !markerOpt.data) {\n inner(seriesModel)[componentType] = null;\n return;\n }\n\n if (!markerModel) {\n if (isInit) {\n // Default label emphasis `position` and `show`\n fillLabel(markerOpt);\n }\n\n zrUtil.each(markerOpt.data, function (item) {\n // FIXME Overwrite fillLabel method ?\n if (item instanceof Array) {\n fillLabel(item[0]);\n fillLabel(item[1]);\n } else {\n fillLabel(item);\n }\n });\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); // markerModel = new ImplementedMarkerModel(\n // markerOpt, this, ecModel\n // );\n\n zrUtil.extend(markerModel, {\n mainType: this.mainType,\n // Use the same series index and name\n seriesIndex: seriesModel.seriesIndex,\n name: seriesModel.name,\n createdBySelf: true\n });\n markerModel.__hostSeries = seriesModel;\n } else {\n markerModel._mergeOption(markerOpt, ecModel, true);\n }\n\n inner(seriesModel)[componentType] = markerModel;\n }, this);\n }\n };\n\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var itemName = data.getName(dataIndex);\n return createTooltipMarkup('section', {\n header: this.name,\n blocks: [createTooltipMarkup('nameValue', {\n name: itemName,\n value: value,\n noName: !itemName,\n noValue: value == null\n })]\n });\n };\n\n MarkerModel.prototype.getData = function () {\n return this._data;\n };\n\n MarkerModel.prototype.setData = function (data) {\n this._data = data;\n };\n\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, // Support three types of markers. Strict check.\n componentType) {\n return inner(seriesModel)[componentType];\n };\n\n MarkerModel.type = 'marker';\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\n return MarkerModel;\n}(ComponentModel);\n\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\nexport default MarkerModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel';\n\nvar MarkPointModel =\n/** @class */\nfunction (_super) {\n __extends(MarkPointModel, _super);\n\n function MarkPointModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointModel.type;\n return _this;\n }\n\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkPointModel.type = 'markPoint';\n MarkPointModel.defaultOption = {\n zlevel: 0,\n z: 5,\n symbol: 'pin',\n symbolSize: 50,\n //symbolRotate: 0,\n //symbolOffset: [0, 0]\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'inside'\n },\n itemStyle: {\n borderWidth: 2\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return MarkPointModel;\n}(MarkerModel);\n\nexport default MarkPointModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as numberUtil from '../../util/number';\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper';\nimport { indexOf, curry, clone, isArray } from 'zrender/lib/core/util';\n\nfunction hasXOrY(item) {\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}\n\nfunction hasXAndY(item) {\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\n} // Make it simple, do not visit all stacked value to count precision.\n// function getPrecision(data, valueAxisDim, dataIndex) {\n// let precision = -1;\n// let stackedDim = data.mapDimension(valueAxisDim);\n// do {\n// precision = Math.max(\n// numberUtil.getPrecision(data.get(stackedDim, dataIndex)),\n// precision\n// );\n// let stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n// if (stackedOnSeries) {\n// let byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex);\n// data = stackedOnSeries.getData();\n// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue);\n// stackedDim = data.getCalculationInfo('stackedDimension');\n// }\n// else {\n// data = null;\n// }\n// } while (data);\n// return precision;\n// }\n\n\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\n var coordArr = [];\n var stacked = isDimensionStacked(data, targetDataDim\n /*, otherDataDim*/\n );\n var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim;\n var value = numCalculate(data, calcDataDim, markerType);\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\n var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.\n\n var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\n precision = Math.min(precision, 20);\n\n if (precision >= 0) {\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\n }\n\n return [coordArr, coordArrValue];\n} // TODO Specified percent\n\n\nvar markerTypeCalculator = {\n min: curry(markerTypeCalculatorWithExtent, 'min'),\n max: curry(markerTypeCalculatorWithExtent, 'max'),\n average: curry(markerTypeCalculatorWithExtent, 'average'),\n median: curry(markerTypeCalculatorWithExtent, 'median')\n};\n/**\n * Transform markPoint data item to format used in List by do the following\n * 1. Calculate statistic like `max`, `min`, `average`\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/coord/*} [coordSys]\n * @param {Object} item\n * @return {Object}\n */\n\nexport function dataTransform(seriesModel, item) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem; // 1. If not specify the position with pixel directly\n // 2. If `coord` is not a data array. Which uses `xAxis`,\n // `yAxis` to specify the coord on each dimension\n // parseFloat first because item.x and item.y can be percent string like '20%'\n\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\n var dims = coordSys.dimensions;\n var axisInfo = getAxisInfo(item, data, coordSys, seriesModel); // Clone the option\n // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\n\n item = clone(item);\n\n if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\n item.coord = coordInfo[0]; // Force to use the value of calculated value.\n // let item use the value without stack.\n\n item.value = coordInfo[1];\n } else {\n // FIXME Only has one of xAxis and yAxis.\n var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; // Each coord support max, min, average\n\n for (var i = 0; i < 2; i++) {\n if (markerTypeCalculator[coord[i]]) {\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\n }\n }\n\n item.coord = coord;\n }\n }\n\n return item;\n}\nexport function getAxisInfo(item, data, coordSys, seriesModel) {\n var ret = {};\n\n if (item.valueIndex != null || item.valueDim != null) {\n ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n } else {\n ret.baseAxis = seriesModel.getBaseAxis();\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\n }\n\n return ret;\n}\n\nfunction dataDimToCoordDim(seriesModel, dataDim) {\n var data = seriesModel.getData();\n var dimensions = data.dimensions;\n dataDim = data.getDimension(dataDim);\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimItem = data.getDimensionInfo(dimensions[i]);\n\n if (dimItem.name === dataDim) {\n return dimItem.coordDim;\n }\n }\n}\n/**\n * Filter data which is out of coordinateSystem range\n * [dataFilter description]\n */\n\n\nexport function dataFilter( // Currently only polar and cartesian has containData.\ncoordSys, item) {\n // Alwalys return true if there is no coordSys\n return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;\n}\nexport function dimValueGetter(item, dimName, dataIndex, dimIndex) {\n // x, y, radius, angle\n if (dimIndex < 2) {\n return item.coord && item.coord[dimIndex];\n }\n\n return item.value;\n}\nexport function numCalculate(data, valueDataDim, type) {\n if (type === 'average') {\n var sum_1 = 0;\n var count_1 = 0;\n data.each(valueDataDim, function (val, idx) {\n if (!isNaN(val)) {\n sum_1 += val;\n count_1++;\n }\n });\n return sum_1 / count_1;\n } else if (type === 'median') {\n return data.getMedian(valueDataDim);\n } else {\n // max & min\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component';\nimport { createHashMap, each } from 'zrender/lib/core/util';\nimport MarkerModel from './MarkerModel';\nimport { makeInner } from '../../util/model';\nimport { enterBlur } from '../../util/states';\nvar inner = makeInner();\n\nvar MarkerView =\n/** @class */\nfunction (_super) {\n __extends(MarkerView, _super);\n\n function MarkerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerView.type;\n return _this;\n }\n\n MarkerView.prototype.init = function () {\n this.markerGroupMap = createHashMap();\n };\n\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\n var _this = this;\n\n var markerGroupMap = this.markerGroupMap;\n markerGroupMap.each(function (item) {\n inner(item).keep = false;\n });\n ecModel.eachSeries(function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\n });\n markerGroupMap.each(function (item) {\n !inner(item).keep && _this.group.remove(item.group);\n });\n };\n\n MarkerView.prototype.markKeep = function (drawGroup) {\n inner(drawGroup).keep = true;\n };\n\n MarkerView.prototype.blurSeries = function (seriesModelList) {\n var _this = this;\n\n each(seriesModelList, function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n\n if (markerModel) {\n var data = markerModel.getData();\n data.eachItemGraphicEl(function (el) {\n if (el) {\n enterBlur(el);\n }\n });\n }\n });\n };\n\n MarkerView.type = 'marker';\n return MarkerView;\n}(ComponentView);\n\nexport default MarkerView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../../chart/helper/SymbolDraw';\nimport * as numberUtil from '../../util/number';\nimport List from '../../data/List';\nimport * as markerHelper from './markerHelper';\nimport MarkerView from './MarkerView';\nimport MarkerModel from './MarkerModel';\nimport { isFunction, map, defaults, filter, curry } from 'zrender/lib/core/util';\nimport { getECData } from '../../util/innerStore';\nimport { getVisualFromData } from '../../visual/helper';\n\nfunction updateMarkerLayout(mpData, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } // Chart like bar may have there own marker positioning logic\n else if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPoisition\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\n } else if (coordSys) {\n var x = mpData.get(coordSys.dimensions[0], idx);\n var y = mpData.get(coordSys.dimensions[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n\n mpData.setItemLayout(idx, point);\n });\n}\n\nvar MarkPointView =\n/** @class */\nfunction (_super) {\n __extends(MarkPointView, _super);\n\n function MarkPointView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointView.type;\n return _this;\n }\n\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\n\n if (mpModel) {\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var symbolDrawMap = this.markerGroupMap;\n var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());\n var mpData = createList(coordSys, seriesModel, mpModel); // FIXME\n\n mpModel.setData(mpData);\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var symbol = itemModel.getShallow('symbol');\n var symbolSize = itemModel.getShallow('symbolSize');\n var symbolRotate = itemModel.getShallow('symbolRotate');\n\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\n var rawIdx = mpModel.getRawValue(idx);\n var dataParams = mpModel.getDataParams(idx);\n\n if (isFunction(symbol)) {\n symbol = symbol(rawIdx, dataParams);\n }\n\n if (isFunction(symbolSize)) {\n // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?\n symbolSize = symbolSize(rawIdx, dataParams);\n }\n\n if (isFunction(symbolRotate)) {\n symbolRotate = symbolRotate(rawIdx, dataParams);\n }\n }\n\n var style = itemModel.getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n }\n\n mpData.setItemVisual(idx, {\n symbol: symbol,\n symbolSize: symbolSize,\n symbolRotate: symbolRotate,\n style: style\n });\n }); // TODO Text are wrong\n\n symbolDraw.updateData(mpData);\n this.group.add(symbolDraw.group); // Set host model for tooltip\n // FIXME\n\n mpData.eachItemGraphicEl(function (el) {\n el.traverse(function (child) {\n getECData(child).dataModel = mpModel;\n });\n });\n this.markKeep(symbolDraw);\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkPointView.type = 'markPoint';\n return MarkPointView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, mpModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n\n return defaults({\n name: coordDim\n }, info);\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var mpData = new List(coordDimsInfos, mpModel);\n var dataOpt = map(mpModel.get('data'), curry(markerHelper.dataTransform, seriesModel));\n\n if (coordSys) {\n dataOpt = filter(dataOpt, curry(markerHelper.dataFilter, coordSys));\n }\n\n mpData.initData(dataOpt, null, coordSys ? markerHelper.dimValueGetter : function (item) {\n return item.value;\n });\n return mpData;\n}\n\nexport default MarkPointView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries';\nimport MarkPointModel from './MarkPointModel';\nimport MarkPointView from './MarkPointView';\nexport function install(registers) {\n registers.registerComponentModel(MarkPointModel);\n registers.registerComponentView(MarkPointView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markPoint')) {\n // Make sure markPoint component is enabled\n opt.markPoint = opt.markPoint || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel';\n\nvar MarkLineModel =\n/** @class */\nfunction (_super) {\n __extends(MarkLineModel, _super);\n\n function MarkLineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineModel.type;\n return _this;\n }\n\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkLineModel.type = 'markLine';\n MarkLineModel.defaultOption = {\n zlevel: 0,\n z: 5,\n symbol: ['circle', 'arrow'],\n symbolSize: [8, 16],\n //symbolRotate: 0,\n symbolOffset: 0,\n precision: 2,\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'end',\n distance: 5\n },\n lineStyle: {\n type: 'dashed'\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n width: 3\n }\n },\n animationEasing: 'linear'\n };\n return MarkLineModel;\n}(MarkerModel);\n\nexport default MarkLineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport List from '../../data/List';\nimport * as numberUtil from '../../util/number';\nimport * as markerHelper from './markerHelper';\nimport LineDraw from '../../chart/helper/LineDraw';\nimport MarkerView from './MarkerView';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\nimport { getECData } from '../../util/innerStore';\nimport MarkerModel from './MarkerModel';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, defaults, curry, filter } from 'zrender/lib/core/util';\nimport { makeInner } from '../../util/model';\nimport { getVisualFromData } from '../../visual/helper';\nvar inner = makeInner();\n\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n var data = seriesModel.getData();\n var itemArray;\n\n if (!isArray(item)) {\n // Special type markLine like 'min', 'max', 'average', 'median'\n var mlType = item.type;\n\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case\n // data: [{\n // yAxis: 10\n // }]\n || item.xAxis != null || item.yAxis != null) {\n var valueAxis = void 0;\n var value = void 0;\n\n if (item.yAxis != null || item.xAxis != null) {\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n value = retrieve(item.yAxis, item.xAxis);\n } else {\n var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n valueAxis = axisInfo.valueAxis;\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\n }\n\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n var baseIndex = 1 - valueIndex; // Normized to 2d data with start and end point\n\n var mlFrom = clone(item);\n var mlTo = {\n coord: []\n };\n mlFrom.type = null;\n mlFrom.coord = [];\n mlFrom.coord[baseIndex] = -Infinity;\n mlTo.coord[baseIndex] = Infinity;\n var precision = mlModel.get('precision');\n\n if (precision >= 0 && typeof value === 'number') {\n value = +value.toFixed(Math.min(precision, 20));\n }\n\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n itemArray = [mlFrom, mlTo, {\n type: mlType,\n valueIndex: item.valueIndex,\n // Force to use the value of calculated value.\n value: value\n }];\n } else {\n // Invalid data\n if (process.env.NODE_ENV !== 'production') {\n logError('Invalid markLine data.');\n }\n\n itemArray = [];\n }\n } else {\n itemArray = item;\n }\n\n var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; // Avoid line data type is extended by from(to) data type\n\n normalizedItem[2].type = normalizedItem[2].type || null; // Merge from option and to option into line option\n\n merge(normalizedItem[2], normalizedItem[0]);\n merge(normalizedItem[2], normalizedItem[1]);\n return normalizedItem;\n};\n\nfunction isInifinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markLine has one dim\n\n\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n var dimName = coordSys.dimensions[dimIndex];\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\n\nfunction markLineFilter(coordSys, item) {\n if (coordSys.type === 'cartesian2d') {\n var fromCoord = item[0].coord;\n var toCoord = item[1].coord; // In case\n // {\n // markLine: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n\n if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n\n return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\n\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPoisition\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n } else {\n var dims = coordSys.dimensions;\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Expand line to the edge of grid if value on one axis is Inifnity\n // In case\n // markLine: {\n // data: [{\n // yAxis: 2\n // // or\n // type: 'average'\n // }]\n // }\n\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var dims = coordSys.dimensions;\n\n if (isInifinity(data.get(dims[0], idx))) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n } else if (isInifinity(data.get(dims[1], idx))) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n data.setItemLayout(idx, point);\n}\n\nvar MarkLineView =\n/** @class */\nfunction (_super) {\n __extends(MarkLineView, _super);\n\n function MarkLineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineView.type;\n return _this;\n }\n\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n\n if (mlModel) {\n var mlData_1 = mlModel.getData();\n var fromData_1 = inner(mlModel).from;\n var toData_1 = inner(mlModel).to; // Update visual and layout of from symbol and to symbol\n\n fromData_1.each(function (idx) {\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n }); // Update layout of line\n\n mlData_1.each(function (idx) {\n mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n });\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var lineDrawMap = this.markerGroupMap;\n var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n this.group.add(lineDraw.group);\n var mlData = createList(coordSys, seriesModel, mlModel);\n var fromData = mlData.from;\n var toData = mlData.to;\n var lineData = mlData.line;\n inner(mlModel).from = fromData;\n inner(mlModel).to = toData; // Line data for tooltip and formatter\n\n mlModel.setData(lineData);\n var symbolType = mlModel.get('symbol');\n var symbolSize = mlModel.get('symbolSize');\n var symbolRotate = mlModel.get('symbolRotate');\n var symbolOffset = mlModel.get('symbolOffset');\n\n if (!isArray(symbolType)) {\n symbolType = [symbolType, symbolType];\n }\n\n if (!isArray(symbolSize)) {\n symbolSize = [symbolSize, symbolSize];\n }\n\n if (!isArray(symbolRotate)) {\n symbolRotate = [symbolRotate, symbolRotate];\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n } // Update visual and layout of from symbol and to symbol\n\n\n mlData.from.each(function (idx) {\n updateDataVisualAndLayout(fromData, idx, true);\n updateDataVisualAndLayout(toData, idx, false);\n }); // Update visual and layout of line\n\n lineData.each(function (idx) {\n var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); // lineData.setItemVisual(idx, {\n // color: lineColor || fromData.getItemVisual(idx, 'color')\n // });\n\n lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n\n if (lineStyle.stroke == null) {\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n }\n\n lineData.setItemVisual(idx, {\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n toSymbol: toData.getItemVisual(idx, 'symbol'),\n style: lineStyle\n });\n });\n lineDraw.updateData(lineData); // Set host model for tooltip\n // FIXME\n\n mlData.line.eachItemGraphicEl(function (el, idx) {\n el.traverse(function (child) {\n getECData(child).dataModel = mlModel;\n });\n });\n\n function updateDataVisualAndLayout(data, idx, isFrom) {\n var itemModel = data.getItemModel(idx);\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (style.fill == null) {\n style.fill = getVisualFromData(seriesData, 'color');\n }\n\n data.setItemVisual(idx, {\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n symbolOffset: retrieve2(itemModel.get('symbolOffset'), symbolOffset[isFrom ? 0 : 1]),\n symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n style: style\n });\n }\n\n this.markKeep(lineDraw);\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkLineView.type = 'markLine';\n return MarkLineView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, mlModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n\n return defaults({\n name: coordDim\n }, info);\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var fromData = new List(coordDimsInfos, mlModel);\n var toData = new List(coordDimsInfos, mlModel); // No dimensions\n\n var lineData = new List([], mlModel);\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markLineFilter, coordSys));\n }\n\n var dimValueGetter = coordSys ? markerHelper.dimValueGetter : function (item) {\n return item.value;\n };\n fromData.initData(map(optData, function (item) {\n return item[0];\n }), null, dimValueGetter);\n toData.initData(map(optData, function (item) {\n return item[1];\n }), null, dimValueGetter);\n lineData.initData(map(optData, function (item) {\n return item[2];\n }));\n lineData.hasItemOption = true;\n return {\n from: fromData,\n to: toData,\n line: lineData\n };\n}\n\nexport default MarkLineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries';\nimport MarkLineModel from './MarkLineModel';\nimport MarkLineView from './MarkLineView';\nexport function install(registers) {\n registers.registerComponentModel(MarkLineModel);\n registers.registerComponentView(MarkLineView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markLine')) {\n // Make sure markLine component is enabled\n opt.markLine = opt.markLine || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel';\n\nvar MarkAreaModel =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaModel, _super);\n\n function MarkAreaModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaModel.type;\n return _this;\n }\n\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkAreaModel.type = 'markArea';\n MarkAreaModel.defaultOption = {\n zlevel: 0,\n // PENDING\n z: 1,\n tooltip: {\n trigger: 'item'\n },\n // markArea should fixed on the coordinate system\n animation: false,\n label: {\n show: true,\n position: 'top'\n },\n itemStyle: {\n // color and borderColor default to use color from series\n // color: 'auto'\n // borderColor: 'auto'\n borderWidth: 0\n },\n emphasis: {\n label: {\n show: true,\n position: 'top'\n }\n }\n };\n return MarkAreaModel;\n}(MarkerModel);\n\nexport default MarkAreaModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\"; // TODO Optimize on polar\n\nimport * as colorUtil from 'zrender/lib/tool/color';\nimport List from '../../data/List';\nimport * as numberUtil from '../../util/number';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis, setStatesStylesFromModel } from '../../util/states';\nimport * as markerHelper from './markerHelper';\nimport MarkerView from './MarkerView';\nimport { retrieve, mergeAll, map, defaults, curry, filter } from 'zrender/lib/core/util';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\nimport MarkerModel from './MarkerModel';\nimport { makeInner } from '../../util/model';\nimport { getVisualFromData } from '../../visual/helper';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\nimport { getECData } from '../../util/innerStore';\nvar inner = makeInner();\n\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\n var lt = markerHelper.dataTransform(seriesModel, item[0]);\n var rb = markerHelper.dataTransform(seriesModel, item[1]); // FIXME make sure lt is less than rb\n\n var ltCoord = lt.coord;\n var rbCoord = rb.coord;\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\n rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one\n\n var result = mergeAll([{}, lt, rb]);\n result.coord = [lt.coord, rb.coord];\n result.x0 = lt.x;\n result.y0 = lt.y;\n result.x1 = rb.x;\n result.y1 = rb.y;\n return result;\n};\n\nfunction isInifinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markArea has one dim\n\n\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]);\n}\n\nfunction markAreaFilter(coordSys, item) {\n var fromCoord = item.coord[0];\n var toCoord = item.coord[1];\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // In case\n // {\n // markArea: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n\n return markerHelper.dataFilter(coordSys, {\n coord: fromCoord,\n x: item.x0,\n y: item.y0\n }) || markerHelper.dataFilter(coordSys, {\n coord: toCoord,\n x: item.x1,\n y: item.y1\n });\n} // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\n\n\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPoisition\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\n } else {\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n var pt = [x, y];\n coordSys.clampData && coordSys.clampData(pt, pt);\n point = coordSys.dataToPoint(pt, true);\n }\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n\n if (isInifinity(x)) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\n } else if (isInifinity(y)) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n return point;\n}\n\nvar dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\n\nvar MarkAreaView =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaView, _super);\n\n function MarkAreaView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaView.type;\n return _this;\n }\n\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\n\n if (maModel) {\n var areaData_1 = maModel.getData();\n areaData_1.each(function (idx) {\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\n }); // Layout\n\n areaData_1.setItemLayout(idx, points);\n var el = areaData_1.getItemGraphicEl(idx);\n el.setShape('points', points);\n });\n }\n }, this);\n };\n\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var areaGroupMap = this.markerGroupMap;\n var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {\n group: new graphic.Group()\n });\n this.group.add(polygonGroup.group);\n this.markKeep(polygonGroup);\n var areaData = createList(coordSys, seriesModel, maModel); // Line data for tooltip and formatter\n\n maModel.setData(areaData); // Update visual and layout of line\n\n areaData.each(function (idx) {\n // Layout\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n });\n var xAxisScale = coordSys.getAxis('x').scale;\n var yAxisScale = coordSys.getAxis('y').scale;\n var xAxisExtent = xAxisScale.getExtent();\n var yAxisExtent = yAxisScale.getExtent();\n var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\n var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\n numberUtil.asc(xPointExtent);\n numberUtil.asc(yPointExtent);\n var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); // If none of the area is inside coordSys, allClipped is set to be true\n // in layout so that label will not be displayed. See #12591\n\n var allClipped = !overlapped;\n areaData.setItemLayout(idx, {\n points: points,\n allClipped: allClipped\n });\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n\n if (typeof style.fill === 'string') {\n style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\n }\n }\n\n if (!style.stroke) {\n style.stroke = color;\n } // Visual\n\n\n areaData.setItemVisual(idx, 'style', style);\n });\n areaData.diff(inner(polygonGroup).data).add(function (idx) {\n var layout = areaData.getItemLayout(idx);\n\n if (!layout.allClipped) {\n var polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n areaData.setItemGraphicEl(idx, polygon);\n polygonGroup.group.add(polygon);\n }\n }).update(function (newIdx, oldIdx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx);\n var layout = areaData.getItemLayout(newIdx);\n\n if (!layout.allClipped) {\n if (polygon) {\n graphic.updateProps(polygon, {\n shape: {\n points: layout.points\n }\n }, maModel, newIdx);\n } else {\n polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n }\n\n areaData.setItemGraphicEl(newIdx, polygon);\n polygonGroup.group.add(polygon);\n } else if (polygon) {\n polygonGroup.group.remove(polygon);\n }\n }).remove(function (idx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\n polygonGroup.group.remove(polygon);\n }).execute();\n areaData.eachItemGraphicEl(function (polygon, idx) {\n var itemModel = areaData.getItemModel(idx);\n var style = areaData.getItemVisual(idx, 'style');\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\n labelFetcher: maModel,\n labelDataIndex: idx,\n defaultText: areaData.getName(idx) || '',\n inheritColor: typeof style.fill === 'string' ? colorUtil.modifyAlpha(style.fill, 1) : '#000'\n });\n setStatesStylesFromModel(polygon, itemModel);\n enableHoverEmphasis(polygon);\n getECData(polygon).dataModel = maModel;\n });\n inner(polygonGroup).data = areaData;\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkAreaView.type = 'markArea';\n return MarkAreaView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, maModel) {\n var coordDimsInfos;\n var areaData;\n var dims = ['x0', 'y0', 'x1', 'y1'];\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var data = seriesModel.getData();\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n\n return defaults({\n name: coordDim\n }, info);\n });\n areaData = new List(map(dims, function (dim, idx) {\n return {\n name: dim,\n type: coordDimsInfos[idx % 2].type\n };\n }), maModel);\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n areaData = new List(coordDimsInfos, maModel);\n }\n\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markAreaFilter, coordSys));\n }\n\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\n // TODO should convert to ParsedValue?\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\n } : function (item) {\n return item.value;\n };\n areaData.initData(optData, null, dimValueGetter);\n areaData.hasItemOption = true;\n return areaData;\n}\n\nexport default MarkAreaView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport checkMarkerInSeries from './checkMarkerInSeries';\nimport MarkAreaModel from './MarkAreaModel';\nimport MarkAreaView from './MarkAreaView';\nexport function install(registers) {\n registers.registerComponentModel(MarkAreaModel);\n registers.registerComponentView(MarkAreaView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markArea')) {\n // Make sure markArea component is enabled\n opt.markArea = opt.markArea || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Model from '../../model/Model';\nimport { isNameSpecified } from '../../util/model';\nimport ComponentModel from '../../model/Component';\n\nvar getDefaultSelectorOptions = function (ecModel, type) {\n if (type === 'all') {\n return {\n type: 'all',\n title: ecModel.getLocale(['legend', 'selector', 'all'])\n };\n } else if (type === 'inverse') {\n return {\n type: 'inverse',\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\n };\n }\n};\n\nvar LegendModel =\n/** @class */\nfunction (_super) {\n __extends(LegendModel, _super);\n\n function LegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendModel.type;\n _this.layoutMode = {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas realy width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n };\n return _this;\n }\n\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype._updateSelector = function (option) {\n var selector = option.selector;\n var ecModel = this.ecModel;\n\n if (selector === true) {\n selector = option.selector = ['all', 'inverse'];\n }\n\n if (zrUtil.isArray(selector)) {\n zrUtil.each(selector, function (item, index) {\n zrUtil.isString(item) && (item = {\n type: item\n });\n selector[index] = zrUtil.merge(item, getDefaultSelectorOptions(ecModel, item.type));\n });\n }\n };\n\n LegendModel.prototype.optionUpdated = function () {\n this._updateData(this.ecModel);\n\n var legendData = this._data; // If selectedMode is single, try to select one\n\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false; // If has any selected in option.selected\n\n for (var i = 0; i < legendData.length; i++) {\n var name_1 = legendData[i].get('name');\n\n if (this.isSelected(name_1)) {\n // Force to unselect others\n this.select(name_1);\n hasSelected = true;\n break;\n }\n } // Try select the first if selectedMode is single\n\n\n !hasSelected && this.select(legendData[0].get('name'));\n }\n };\n\n LegendModel.prototype._updateData = function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n var names = provider.getAllNames();\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\n * @type {Array.<string>}\n * @private\n */\n\n this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data,\n // which is convinient for user preparing option.\n\n var rawData = this.get('data') || potentialData;\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\n dataItem = {\n name: dataItem\n };\n }\n\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\n * @type {Array.<module:echarts/model/Model>}\n * @private\n */\n\n this._data = legendData;\n };\n\n LegendModel.prototype.getData = function () {\n return this._data;\n };\n\n LegendModel.prototype.select = function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n\n selected[name] = true;\n };\n\n LegendModel.prototype.unSelect = function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n };\n\n LegendModel.prototype.toggleSelected = function (name) {\n var selected = this.option.selected; // Default is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n this[selected[name] ? 'unSelect' : 'select'](name);\n };\n\n LegendModel.prototype.allSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name', true)] = true;\n });\n };\n\n LegendModel.prototype.inverseSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n var name = dataItem.get('name', true); // Initially, default value is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n selected[name] = !selected[name];\n });\n };\n\n LegendModel.prototype.isSelected = function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n };\n\n LegendModel.prototype.getOrient = function () {\n return this.get('orient') === 'vertical' ? {\n index: 1,\n name: 'vertical'\n } : {\n index: 0,\n name: 'horizontal'\n };\n };\n\n LegendModel.type = 'legend.plain';\n LegendModel.dependencies = ['series'];\n LegendModel.defaultOption = {\n zlevel: 0,\n z: 4,\n show: true,\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n itemWidth: 25,\n itemHeight: 14,\n symbolSize: 'auto',\n inactiveColor: '#ccc',\n inactiveBorderColor: '#ccc',\n inactiveBorderWidth: 'auto',\n itemStyle: {\n color: 'inherit',\n opacity: 'inherit',\n decal: 'inherit',\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n borderColor: 'inherit',\n borderWidth: 'auto',\n borderCap: 'inherit',\n borderJoin: 'inherit',\n borderDashOffset: 'inherit',\n borderMiterLimit: 'inherit'\n },\n lineStyle: {\n width: 'auto',\n color: 'inherit',\n inactiveColor: '#ccc',\n inactiveWidth: 2,\n opacity: 'inherit',\n type: 'inherit',\n cap: 'inherit',\n join: 'inherit',\n dashOffset: 'inherit',\n miterLimit: 'inherit',\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n },\n textStyle: {\n color: '#333'\n },\n selectedMode: true,\n selector: false,\n selectorLabel: {\n show: true,\n borderRadius: 10,\n padding: [3, 5, 3, 5],\n fontSize: 12,\n fontFamily: ' sans-serif',\n color: '#666',\n borderWidth: 1,\n borderColor: '#666'\n },\n emphasis: {\n selectorLabel: {\n show: true,\n color: '#eee',\n backgroundColor: '#666'\n }\n },\n selectorPosition: 'auto',\n selectorItemGap: 7,\n selectorButtonGap: 10,\n tooltip: {\n show: false\n }\n };\n return LegendModel;\n}(ComponentModel);\n\nexport default LegendModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { parse, stringify } from 'zrender/lib/tool/color';\nimport * as graphic from '../../util/graphic';\nimport { enableHoverEmphasis } from '../../util/states';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle';\nimport { makeBackground } from '../helper/listComponent';\nimport * as layoutUtil from '../../util/layout';\nimport ComponentView from '../../view/Component';\nimport { LINE_STYLE_KEY_MAP } from '../../model/mixin/lineStyle';\nimport { ITEM_STYLE_KEY_MAP } from '../../model/mixin/itemStyle';\nimport { createSymbol } from '../../util/symbol';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar LegendView =\n/** @class */\nfunction (_super) {\n __extends(LegendView, _super);\n\n function LegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendView.type;\n _this.newlineDisabled = false;\n return _this;\n }\n\n LegendView.prototype.init = function () {\n this.group.add(this._contentGroup = new Group());\n this.group.add(this._selectorGroup = new Group());\n this._isFirstRender = true;\n };\n /**\n * @protected\n */\n\n\n LegendView.prototype.getContentGroup = function () {\n return this._contentGroup;\n };\n /**\n * @protected\n */\n\n\n LegendView.prototype.getSelectorGroup = function () {\n return this._selectorGroup;\n };\n /**\n * @override\n */\n\n\n LegendView.prototype.render = function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n var orient = legendModel.get('orient');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n } // selector has been normalized to an array in model\n\n\n var selector = legendModel.get('selector', true);\n var selectorPosition = legendModel.get('selectorPosition', true);\n\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.x = layoutRect.x - mainRect.x;\n this.group.y = layoutRect.y - mainRect.y;\n this.group.markRedraw(); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n };\n\n LegendView.prototype.resetInner = function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n this.getSelectorGroup().removeAll();\n };\n\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\n var name = legendItemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n var g = new Group(); // @ts-ignore\n\n g.newline = true;\n contentGroup.add(g);\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawed\n return;\n } // Legend to control series.\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n var symbolType = data.getVisual('legendSymbol');\n /**\n * `data.getVisual('style')` may be the color from the register\n * in series. For example, for line series,\n */\n\n var style = data.getVisual('style');\n data.getVisual('symbolSize');\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, symbolType, selectMode);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Legend to control data. In pie and funnel.\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n\n if (!provider.containName(name)) {\n return;\n }\n\n var idx = provider.indexOfName(name);\n var style = provider.getItemVisual(idx, 'style');\n var symbolType = provider.getItemVisual(idx, 'legendSymbol');\n var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range.\n // Do not show nothing.\n\n if (colorArr && colorArr[3] === 0) {\n colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n\n style.fill = stringify(colorArr, 'rgba');\n }\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, symbolType, selectMode); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!legendDrawnMap.get(name)) {\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n }\n }\n }, this);\n\n if (selector) {\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\n }\n };\n\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n each(selector, function createSelectorButton(selectorItem) {\n var type = selectorItem.type;\n var labelText = new graphic.Text({\n style: {\n x: 0,\n y: 0,\n align: 'center',\n verticalAlign: 'middle'\n },\n onclick: function () {\n api.dispatchAction({\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\n });\n }\n });\n selectorGroup.add(labelText);\n var labelModel = legendModel.getModel('selectorLabel');\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n setLabelStyle(labelText, {\n normal: labelModel,\n emphasis: emphasisLabelModel\n }, {\n defaultText: selectorItem.title\n });\n enableHoverEmphasis(labelText);\n });\n };\n\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, itemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, symbolType, selectMode) {\n var drawType = seriesModel.visualDrawType;\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var isSelected = legendModel.isSelected(name);\n var symbolKeepAspect = itemModel.get('symbolKeepAspect');\n var legendIconType = itemModel.get('icon');\n symbolType = legendIconType || symbolType || 'roundRect';\n var legendLineStyle = legendModel.getModel('lineStyle');\n var style = getLegendStyle(symbolType, itemModel, legendLineStyle, lineVisualStyle, itemVisualStyle, drawType, isSelected);\n var itemGroup = new Group();\n var textStyleModel = itemModel.getModel('textStyle');\n\n if (typeof seriesModel.getLegendIcon === 'function' && !legendIconType) {\n // Series has specific way to define legend icon\n itemGroup.add(seriesModel.getLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n symbolType: symbolType,\n symbolKeepAspect: symbolKeepAspect,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle\n }));\n } else {\n // Use default legend icon policy for most series\n itemGroup.add(getDefaultLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n symbolType: symbolType,\n symbolKeepAspect: symbolKeepAspect,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle\n }));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (typeof formatter === 'string' && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (typeof formatter === 'function') {\n content = formatter(name);\n }\n\n var inactiveColor = itemModel.get('inactiveColor');\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\n align: textAlign,\n verticalAlign: 'middle'\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true\n });\n var tooltipModel = itemModel.getModel('tooltip');\n\n if (tooltipModel.get('show')) {\n graphic.setTooltipConfig({\n el: hitRect,\n componentModel: legendModel,\n itemName: name,\n itemTooltipOption: tooltipModel.option\n });\n }\n\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n enableHoverEmphasis(itemGroup); // @ts-ignore\n\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n };\n\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n var contentPos = [-contentRect.x, -contentRect.y];\n selectorGroup.markRedraw();\n contentGroup.markRedraw();\n\n if (selector) {\n // Place buttons in selectorGroup\n layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var orientIdx = legendModel.getOrient().index;\n var wh = orientIdx === 0 ? 'width' : 'height';\n var hw = orientIdx === 0 ? 'height' : 'width';\n var yx = orientIdx === 0 ? 'y' : 'x';\n\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n } else {\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n } //Always align selector to content as 'middle'\n\n\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n var mainRect = {\n x: 0,\n y: 0\n };\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n return mainRect;\n } else {\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n return this.group.getBoundingRect();\n }\n };\n /**\n * @protected\n */\n\n\n LegendView.prototype.remove = function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n };\n\n LegendView.type = 'legend.plain';\n return LegendView;\n}(ComponentView);\n\nfunction getLegendStyle(symbolType, legendModel, legendLineStyle, lineVisualStyle, itemVisualStyle, drawType, isSelected) {\n /**\n * Use series style if is inherit;\n * elsewise, use legend style\n */\n // itemStyle\n var legendItemModel = legendModel.getModel('itemStyle');\n var itemProperties = ITEM_STYLE_KEY_MAP.concat([['decal']]);\n var itemStyle = {};\n\n for (var i = 0; i < itemProperties.length; ++i) {\n var propName = itemProperties[i][itemProperties[i].length - 1];\n var visualName = itemProperties[i][0];\n var value = legendItemModel.getShallow(propName);\n\n if (value === 'inherit') {\n switch (visualName) {\n case 'fill':\n /**\n * Series with visualDrawType as 'stroke' should have\n * series stroke as legend fill\n */\n itemStyle.fill = itemVisualStyle[drawType];\n break;\n\n case 'stroke':\n /**\n * symbol type with \"emptyXXX\" should use fill color\n * in visual style\n */\n itemStyle.stroke = itemVisualStyle[symbolType.startsWith('empty') ? 'fill' : 'stroke'];\n break;\n\n case 'opacity':\n /**\n * Use lineStyle.opacity if drawType is stroke\n */\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n break;\n\n default:\n itemStyle[visualName] = itemVisualStyle[visualName];\n }\n } else if (value === 'auto' && visualName === 'lineWidth') {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n itemStyle.lineWidth = itemVisualStyle.lineWidth > 0 ? 2 : 0;\n } else {\n itemStyle[visualName] = value;\n }\n } // lineStyle\n\n\n var legendLineModel = legendModel.getModel('lineStyle');\n var lineProperties = LINE_STYLE_KEY_MAP.concat([['inactiveColor'], ['inactiveWidth']]);\n var lineStyle = {};\n\n for (var i = 0; i < lineProperties.length; ++i) {\n var propName = lineProperties[i][1];\n var visualName = lineProperties[i][0];\n var value = legendLineModel.getShallow(propName);\n\n if (value === 'inherit') {\n lineStyle[visualName] = lineVisualStyle[visualName];\n } else if (value === 'auto' && visualName === 'lineWidth') {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n lineStyle.lineWidth = lineVisualStyle.lineWidth > 0 ? 2 : 0;\n } else {\n lineStyle[visualName] = value;\n }\n } // Fix auto color to real color\n\n\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n\n if (!isSelected) {\n var borderWidth = legendModel.get('inactiveBorderWidth');\n /**\n * Since stroke is set to be inactiveBorderColor, it may occur that\n * there is no border in series but border in legend, so we need to\n * use border only when series has border if is set to be auto\n */\n\n var visualHasBorder = itemStyle[symbolType.indexOf('empty') > -1 ? 'fill' : 'stroke'];\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n itemStyle.fill = legendModel.get('inactiveColor');\n itemStyle.stroke = legendModel.get('inactiveBorderColor');\n lineStyle.stroke = legendLineStyle.get('inactiveColor');\n lineStyle.lineWidth = legendLineStyle.get('inactiveWidth');\n }\n\n return {\n itemStyle: itemStyle,\n lineStyle: lineStyle\n };\n}\n\nfunction getDefaultLegendIcon(opt) {\n var symboType = opt.symbolType || 'roundRect';\n var symbol = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n symbol.setStyle(opt.itemStyle);\n\n if (symboType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n\n return symbol;\n}\n\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n // downplay before unselect\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: seriesName != null ? seriesName : dataName\n }); // highlight after select\n // TODO higlight immediately may cause animation loss.\n\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\n\nfunction isUseHoverLayer(api) {\n var list = api.getZr().storage.getDisplayList();\n var emphasisState;\n var i = 0;\n var len = list.length;\n\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\n i++;\n }\n\n return emphasisState && emphasisState.hoverLayer;\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nexport default LegendView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function legendFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport { curry, each } from 'zrender/lib/core/util';\n\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\n var selectedMap = {};\n var isToggleSelect = methodName === 'toggleSelected';\n var isSelected; // Update all legend components\n\n ecModel.eachComponent('legend', function (legendModel) {\n if (isToggleSelect && isSelected != null) {\n // Force other legend has same selected status\n // Or the first is toggled to true and other are toggled to false\n // In the case one legend has some item unSelected in option. And if other legend\n // doesn't has the item, they will assume it is selected.\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\n } else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\n legendModel[methodName]();\n } else {\n legendModel[methodName](payload.name);\n isSelected = legendModel.isSelected(payload.name);\n }\n\n var legendData = legendModel.getData();\n each(legendData, function (model) {\n var name = model.get('name'); // Wrap element\n\n if (name === '\\n' || name === '') {\n return;\n }\n\n var isItemSelected = legendModel.isSelected(name);\n\n if (selectedMap.hasOwnProperty(name)) {\n // Unselected if any legend is unselected\n selectedMap[name] = selectedMap[name] && isItemSelected;\n } else {\n selectedMap[name] = isItemSelected;\n }\n });\n }); // Return the event explicitly\n\n return methodName === 'allSelect' || methodName === 'inverseSelect' ? {\n selected: selectedMap\n } : {\n name: payload.name,\n selected: selectedMap\n };\n}\n\nexport function installLegendAction(registers) {\n /**\n * @event legendToggleSelect\n * @type {Object}\n * @property {string} type 'legendToggleSelect'\n * @property {string} [from]\n * @property {string} name Series name or data item name\n */\n registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\n registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\n registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\n /**\n * @event legendSelect\n * @type {Object}\n * @property {string} type 'legendSelect'\n * @property {string} name Series name or data item name\n */\n\n registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\n /**\n * @event legendUnSelect\n * @type {Object}\n * @property {string} type 'legendUnSelect'\n * @property {string} name Series name or data item name\n */\n\n registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LegendModel from './LegendModel';\nimport LegendView from './LegendView';\nimport legendFilter from './legendFilter';\nimport { installLegendAction } from './legendAction';\nexport function install(registers) {\n registers.registerComponentModel(LegendModel);\n registers.registerComponentView(LegendView);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\n registers.registerSubTypeDefaulter('legend', function () {\n return 'plain';\n });\n installLegendAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LegendModel from './LegendModel';\nimport { mergeLayoutParam, getLayoutParams } from '../../util/layout';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar ScrollableLegendModel =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendModel, _super);\n\n function ScrollableLegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendModel.type;\n return _this;\n }\n /**\n * @param {number} scrollDataIndex\n */\n\n\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\n this.option.scrollDataIndex = scrollDataIndex;\n };\n\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\n };\n /**\n * @override\n */\n\n\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n mergeAndNormalizeLayoutParams(this, this.option, option);\n };\n\n ScrollableLegendModel.type = 'legend.scroll';\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\n scrollDataIndex: 0,\n pageButtonItemGap: 5,\n pageButtonGap: null,\n pageButtonPosition: 'end',\n pageFormatter: '{current}/{total}',\n pageIcons: {\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\n },\n pageIconColor: '#2f4554',\n pageIconInactiveColor: '#aaa',\n pageIconSize: 15,\n pageTextStyle: {\n color: '#333'\n },\n animationDurationUpdate: 800\n });\n return ScrollableLegendModel;\n}(LegendModel);\n\n; // Do not `ignoreSize` to enable setting {left: 10, right: 10}.\n\nfunction mergeAndNormalizeLayoutParams(legendModel, target, raw) {\n var orient = legendModel.getOrient();\n var ignoreSize = [1, 1];\n ignoreSize[orient.index] = 0;\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: !!ignoreSize\n });\n}\n\nexport default ScrollableLegendModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Separate legend and scrollable legend to reduce package size.\n */\n\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as graphic from '../../util/graphic';\nimport * as layoutUtil from '../../util/layout';\nimport LegendView from './LegendView';\nvar Group = graphic.Group;\nvar WH = ['width', 'height'];\nvar XY = ['x', 'y'];\n\nvar ScrollableLegendView =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendView, _super);\n\n function ScrollableLegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendView.type;\n _this.newlineDisabled = true;\n _this._currentIndex = 0;\n return _this;\n }\n\n ScrollableLegendView.prototype.init = function () {\n _super.prototype.init.call(this);\n\n this.group.add(this._containerGroup = new Group());\n\n this._containerGroup.add(this.getContentGroup());\n\n this.group.add(this._controllerGroup = new Group());\n };\n /**\n * @override\n */\n\n\n ScrollableLegendView.prototype.resetInner = function () {\n _super.prototype.resetInner.call(this);\n\n this._controllerGroup.removeAll();\n\n this._containerGroup.removeClipPath();\n\n this._containerGroup.__rectSize = null;\n };\n /**\n * @override\n */\n\n\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var self = this; // Render content items.\n\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n\n var controllerGroup = this._controllerGroup; // FIXME: support be 'auto' adapt to size number text length,\n // e.g., '3/12345' should not overlap with the control arrow button.\n\n var pageIconSize = legendModel.get('pageIconSize', true);\n var pageIconSizeArr = zrUtil.isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];\n createPageButton('pagePrev', 0);\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\n controllerGroup.add(new graphic.Text({\n name: 'pageText',\n style: {\n // Placeholder to calculate a proper layout.\n text: 'xx/xx',\n fill: pageTextStyleModel.getTextColor(),\n font: pageTextStyleModel.getFont(),\n verticalAlign: 'middle',\n align: 'center'\n },\n silent: true\n }));\n createPageButton('pageNext', 1);\n\n function createPageButton(name, iconIdx) {\n var pageDataIndexName = name + 'DataIndex';\n var icon = graphic.createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\n // Buttons will be created in each render, so we do not need\n // to worry about avoiding using legendModel kept in scope.\n onclick: zrUtil.bind(self._pageGo, self, pageDataIndexName, legendModel, api)\n }, {\n x: -pageIconSizeArr[0] / 2,\n y: -pageIconSizeArr[1] / 2,\n width: pageIconSizeArr[0],\n height: pageIconSizeArr[1]\n });\n icon.name = name;\n controllerGroup.add(icon);\n }\n };\n /**\n * @override\n */\n\n\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n var hw = WH[1 - orientIdx];\n var yx = XY[1 - orientIdx];\n selector && layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var processMaxSize = zrUtil.clone(maxSize);\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\n\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\n\n if (selector) {\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\n } else {\n var offset = selectorRect[wh] + selectorButtonGap;\n selectorPos[orientIdx] -= offset;\n mainRect[xy] -= offset;\n }\n\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n selectorGroup.markRedraw();\n }\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\n var contentGroup = this.getContentGroup();\n var containerGroup = this._containerGroup;\n var controllerGroup = this._controllerGroup; // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\n layoutUtil.box( // Buttons in controller are layout always horizontally.\n 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\n var contentRect = contentGroup.getBoundingRect();\n var controllerRect = controllerGroup.getBoundingRect();\n var showController = this._showController = contentRect[wh] > maxSize[wh]; // In case that the inner elements of contentGroup layout do not based on [0, 0]\n\n var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming.\n // If first rendering, `contentGroup.position` is [0, 0], which\n // does not make sense and may cause unexepcted animation if adopted.\n\n if (!isFirstRender) {\n contentPos[orientIdx] = contentGroup[xy];\n } // Layout container group based on 0.\n\n\n var containerPos = [0, 0];\n var controllerPos = [-controllerRect.x, -controllerRect.y];\n var pageButtonGap = zrUtil.retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); // Place containerGroup and controllerGroup and contentGroup.\n\n if (showController) {\n var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom.\n\n if (pageButtonPosition === 'end') {\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\n } // controller is on the left / top.\n else {\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\n }\n } // Always align controller to content as 'middle'.\n\n\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\n contentGroup.setPosition(contentPos);\n containerGroup.setPosition(containerPos);\n controllerGroup.setPosition(controllerPos); // Calculate `mainRect` and set `clipPath`.\n // mainRect should not be calculated by `this.group.getBoundingRect()`\n // for sake of the overflow.\n\n var mainRect = {\n x: 0,\n y: 0\n }; // Consider content may be overflow (should be clipped).\n\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\n\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\n containerGroup.__rectSize = maxSize[wh];\n\n if (showController) {\n var clipShape = {\n x: 0,\n y: 0\n };\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\n clipShape[hw] = mainRect[hw];\n containerGroup.setClipPath(new graphic.Rect({\n shape: clipShape\n })); // Consider content may be larger than container, container rect\n // can not be obtained from `containerGroup.getBoundingRect()`.\n\n containerGroup.__rectSize = clipShape[wh];\n } else {\n // Do not remove or ignore controller. Keep them set as placeholders.\n controllerGroup.eachChild(function (child) {\n child.attr({\n invisible: true,\n silent: true\n });\n });\n } // Content translate animation.\n\n\n var pageInfo = this._getPageInfo(legendModel);\n\n pageInfo.pageIndex != null && graphic.updateProps(contentGroup, {\n x: pageInfo.contentPosition[0],\n y: pageInfo.contentPosition[1]\n }, // When switch from \"show controller\" to \"not show controller\", view should be\n // updated immediately without animation, otherwise causes weird effect.\n showController ? legendModel : null);\n\n this._updatePageInfoView(legendModel, pageInfo);\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\n\n scrollDataIndex != null && api.dispatchAction({\n type: 'legendScroll',\n scrollDataIndex: scrollDataIndex,\n legendId: legendModel.id\n });\n };\n\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\n var controllerGroup = this._controllerGroup;\n zrUtil.each(['pagePrev', 'pageNext'], function (name) {\n var key = name + 'DataIndex';\n var canJump = pageInfo[key] != null;\n var icon = controllerGroup.childOfName(name);\n\n if (icon) {\n icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true));\n icon.cursor = canJump ? 'pointer' : 'default';\n }\n });\n var pageText = controllerGroup.childOfName('pageText');\n var pageFormatter = legendModel.get('pageFormatter');\n var pageIndex = pageInfo.pageIndex;\n var current = pageIndex != null ? pageIndex + 1 : 0;\n var total = pageInfo.pageCount;\n pageText && pageFormatter && pageText.setStyle('text', zrUtil.isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({\n current: current,\n total: total\n }));\n };\n /**\n * contentPosition: Array.<number>, null when data item not found.\n * pageIndex: number, null when data item not found.\n * pageCount: number, always be a number, can be 0.\n * pagePrevDataIndex: number, null when no previous page.\n * pageNextDataIndex: number, null when no next page.\n * }\n */\n\n\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\n var contentGroup = this.getContentGroup();\n var containerRectSize = this._containerGroup.__rectSize;\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\n\n var children = contentGroup.children();\n var targetItem = children[targetItemIndex];\n var itemCount = children.length;\n var pCount = !itemCount ? 0 : 1;\n var result = {\n contentPosition: [contentGroup.x, contentGroup.y],\n pageCount: pCount,\n pageIndex: pCount - 1,\n pagePrevDataIndex: null,\n pageNextDataIndex: null\n };\n\n if (!targetItem) {\n return result;\n }\n\n var targetItemInfo = getItemInfo(targetItem);\n result.contentPosition[orientIdx] = -targetItemInfo.s; // Strategy:\n // (1) Always align based on the left/top most item.\n // (2) It is user-friendly that the last item shown in the\n // current window is shown at the begining of next window.\n // Otherwise if half of the last item is cut by the window,\n // it will have no chance to display entirely.\n // (3) Consider that item size probably be different, we\n // have calculate pageIndex by size rather than item index,\n // and we can not get page index directly by division.\n // (4) The window is to narrow to contain more than\n // one item, we should make sure that the page can be fliped.\n\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // Half of the last item is out of the window.\n !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || // If the current item does not intersect with the window, the new page\n // can be started at the current item or the last item.\n currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {\n if (winEndItemInfo.i > winStartItemInfo.i) {\n winStartItemInfo = winEndItemInfo;\n } else {\n // e.g., when page size is smaller than item size.\n winStartItemInfo = currItemInfo;\n }\n\n if (winStartItemInfo) {\n if (result.pageNextDataIndex == null) {\n result.pageNextDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n }\n }\n\n winEndItemInfo = currItemInfo;\n }\n\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // If the the end item does not intersect with the window started\n // from the current item, a page can be settled.\n (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && // e.g., when page size is smaller than item size.\n winStartItemInfo.i < winEndItemInfo.i) {\n winEndItemInfo = winStartItemInfo;\n\n if (result.pagePrevDataIndex == null) {\n result.pagePrevDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n ++result.pageIndex;\n }\n\n winStartItemInfo = currItemInfo;\n }\n\n return result;\n\n function getItemInfo(el) {\n if (el) {\n var itemRect = el.getBoundingRect();\n var start = itemRect[xy] + el[xy];\n return {\n s: start,\n e: start + itemRect[wh],\n i: el.__legendDataIndex\n };\n }\n }\n\n function intersect(itemInfo, winStart) {\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\n }\n };\n\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\n if (!this._showController) {\n return 0;\n }\n\n var index;\n var contentGroup = this.getContentGroup();\n var defaultIndex;\n contentGroup.eachChild(function (child, idx) {\n var legendDataIdx = child.__legendDataIndex; // FIXME\n // If the given targetDataIndex (from model) is illegal,\n // we use defaultIndex. But the index on the legend model and\n // action payload is still illegal. That case will not be\n // changed until some scenario requires.\n\n if (defaultIndex == null && legendDataIdx != null) {\n defaultIndex = idx;\n }\n\n if (legendDataIdx === targetDataIndex) {\n index = idx;\n }\n });\n return index != null ? index : defaultIndex;\n };\n\n ScrollableLegendView.type = 'legend.scroll';\n return ScrollableLegendView;\n}(LegendView);\n\nexport default ScrollableLegendView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function installScrollableLegendAction(registers) {\n /**\n * @event legendScroll\n * @type {Object}\n * @property {string} type 'legendScroll'\n * @property {string} scrollDataIndex\n */\n registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\n var scrollDataIndex = payload.scrollDataIndex;\n scrollDataIndex != null && ecModel.eachComponent({\n mainType: 'legend',\n subType: 'scroll',\n query: payload\n }, function (legendModel) {\n legendModel.setScrollDataIndex(scrollDataIndex);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport { install as installLegendPlain } from './installLegendPlain';\nimport ScrollableLegendModel from './ScrollableLegendModel';\nimport ScrollableLegendView from './ScrollableLegendView';\nimport installScrollableLegendAction from './scrollableLegendAction';\nexport function install(registers) {\n use(installLegendPlain);\n registers.registerComponentModel(ScrollableLegendModel);\n registers.registerComponentView(ScrollableLegendView);\n installScrollableLegendAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport { install as installLegendPlain } from './installLegendPlain';\nimport { install as installLegendScroll } from './installLegendScroll';\nexport function install(registers) {\n use(installLegendPlain);\n use(installLegendScroll);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar InsideZoomModel =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomModel, _super);\n\n function InsideZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = InsideZoomModel.type;\n return _this;\n }\n\n InsideZoomModel.type = 'dataZoom.inside';\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n disabled: false,\n zoomLock: false,\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n return InsideZoomModel;\n}(DataZoomModel);\n\nexport default InsideZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nimport RoamController from '../../component/helper/RoamController';\nimport * as throttleUtil from '../../util/throttle';\nimport { makeInner } from '../../util/model';\nimport { each, curry, createHashMap } from 'zrender/lib/core/util';\nimport { collectReferCoordSysModelInfo } from './helper';\nvar inner = makeInner();\nexport function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\n inner(api).coordSysRecordMap.each(function (coordSysRecord) {\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\n\n if (dzInfo) {\n dzInfo.getRange = getRange;\n }\n });\n}\nexport function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\n var coordSysRecordMap = inner(api).coordSysRecordMap;\n var coordSysKeyArr = coordSysRecordMap.keys();\n\n for (var i = 0; i < coordSysKeyArr.length; i++) {\n var coordSysKey = coordSysKeyArr[i];\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var dzUid = dataZoomModel.uid;\n var dzInfo = dataZoomInfoMap.get(dzUid);\n\n if (dzInfo) {\n dataZoomInfoMap.removeKey(dzUid);\n\n if (!dataZoomInfoMap.keys().length) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n }\n }\n }\n }\n}\n\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\n if (coordSysRecord) {\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\n var controller = coordSysRecord.controller;\n controller && controller.dispose();\n }\n}\n\nfunction createCoordSysRecord(api, coordSysModel) {\n // These init props will never change after record created.\n var coordSysRecord = {\n model: coordSysModel,\n containsPoint: curry(containsPoint, coordSysModel),\n dispatchAction: curry(dispatchAction, api),\n dataZoomInfoMap: null,\n controller: null\n }; // Must not do anything depends on coordSysRecord outside the event handler here,\n // because coordSysRecord not completed yet.\n\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\n controller.on(eventName, function (event) {\n var batch = [];\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\n // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n // moveOnMouseWheel, ...) enabled.\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\n return;\n }\n\n var method = (dzInfo.getRange || {})[eventName];\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\n !dzInfo.model.get('disabled', true) && range && batch.push({\n dataZoomId: dzInfo.model.id,\n start: range[0],\n end: range[1]\n });\n });\n batch.length && coordSysRecord.dispatchAction(batch);\n });\n });\n return coordSysRecord;\n}\n/**\n * This action will be throttled.\n */\n\n\nfunction dispatchAction(api, batch) {\n api.dispatchAction({\n type: 'dataZoom',\n animation: {\n easing: 'cubicOut',\n duration: 100\n },\n batch: batch\n });\n}\n\nfunction containsPoint(coordSysModel, e, x, y) {\n return coordSysModel.coordinateSystem.containPoint([x, y]);\n}\n/**\n * Merge roamController settings when multiple dataZooms share one roamController.\n */\n\n\nfunction mergeControllerParams(dataZoomInfoMap) {\n var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n var preventDefaultMouseMove = true;\n dataZoomInfoMap.each(function (dataZoomInfo) {\n var dataZoomModel = dataZoomInfo.model;\n var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n } // Prevent default move event by default. If one false, do not prevent. Otherwise\n // users may be confused why it does not work when multiple insideZooms exist.\n\n\n preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n });\n return {\n controlType: controlType,\n opt: {\n // RoamController will enable all of these functionalities,\n // and the final behavior is determined by its event listener\n // provided by each inside zoom.\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: true,\n preventDefaultMouseMove: !!preventDefaultMouseMove\n }\n };\n}\n\nexport function installDataZoomRoamProcessor(registers) {\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\n var apiInner = inner(api);\n var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());\n coordSysRecordMap.each(function (coordSysRecord) {\n // `coordSysRecordMap` always exists (becuase it hold the `roam controller`, which should\n // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\n coordSysRecord.dataZoomInfoMap = null;\n });\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'inside'\n }, function (dataZoomModel) {\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\n var coordSysUid = dzCoordSysInfo.model.uid;\n var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); // Notice these props might be changed each time for a single dataZoomModel.\n\n dataZoomInfoMap.set(dataZoomModel.uid, {\n dzReferCoordSysInfo: dzCoordSysInfo,\n model: dataZoomModel,\n getRange: null\n });\n });\n }); // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\n // (2) Clear coord sys if not refered by any dataZoom.\n\n coordSysRecordMap.each(function (coordSysRecord) {\n var controller = coordSysRecord.controller;\n var firstDzInfo;\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var firstDzKey = dataZoomInfoMap.keys()[0];\n\n if (firstDzKey != null) {\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\n }\n }\n\n if (!firstDzInfo) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n return;\n }\n\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\n controller.enable(controllerParams.controlType, controllerParams.opt);\n controller.setPointerChecker(coordSysRecord.containsPoint);\n throttleUtil.createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView';\nimport sliderMove from '../helper/sliderMove';\nimport * as roams from './roams';\nimport { bind } from 'zrender/lib/core/util';\n\nvar InsideZoomView =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomView, _super);\n\n function InsideZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataZoom.inside';\n return _this;\n }\n\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n _super.prototype.render.apply(this, arguments);\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n return;\n } // Hence the `throttle` util ensures to preserve command order,\n // here simply updating range all the time will not cause missing\n // any of the the roam change.\n\n\n this.range = dataZoomModel.getPercentRange(); // Reset controllers.\n\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n pan: bind(getRangeHandlers.pan, this),\n zoom: bind(getRangeHandlers.zoom, this),\n scrollMove: bind(getRangeHandlers.scrollMove, this)\n });\n };\n\n InsideZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n InsideZoomView.prototype._clear = function () {\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n this.range = null;\n };\n\n InsideZoomView.type = 'dataZoom.inside';\n return InsideZoomView;\n}(DataZoomView);\n\nvar getRangeHandlers = {\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n var scale = Math.max(1 / e.scale, 0);\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\n range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range.\n\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n },\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n }),\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n })\n};\n\nfunction makeMover(getPercentDelta) {\n return function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n sliderMove(percentDelta, range, [0, 100], 'all');\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n };\n}\n\nvar getDirectionInfo = {\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n oldPoint = oldPoint || [0, 0];\n\n if (axis.dim === 'x') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // axis.dim === 'y'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var polar = coordSysInfo.model.coordinateSystem;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var angleExtent = polar.getAngleAxis().getExtent();\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n newPoint = polar.pointToCoord(newPoint);\n\n if (axisModel.mainType === 'radiusAxis') {\n ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n ret.pixelStart = radiusExtent[0];\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'angleAxis'\n ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n\n ret.pixelLength = angleExtent[1] - angleExtent[0];\n ret.pixelStart = angleExtent[0];\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n var ret = {};\n oldPoint = oldPoint || [0, 0];\n\n if (axis.orient === 'horizontal') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'vertical'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n }\n};\nexport default InsideZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport InsideZoomModel from './InsideZoomModel';\nimport InsideZoomView from './InsideZoomView';\nimport { installDataZoomRoamProcessor } from './roams';\nimport installCommon from './installCommon';\nexport function install(registers) {\n installCommon(registers);\n registers.registerComponentModel(InsideZoomModel);\n registers.registerComponentView(InsideZoomView);\n installDataZoomRoamProcessor(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar SliderZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomModel, _super);\n\n function SliderZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomModel.type;\n return _this;\n }\n\n SliderZoomModel.type = 'dataZoom.slider';\n SliderZoomModel.layoutMode = 'box';\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n show: true,\n // deault value can only be drived in view stage.\n right: 'ph',\n top: 'ph',\n width: 'ph',\n height: 'ph',\n left: null,\n bottom: null,\n borderColor: '#d2dbee',\n borderRadius: 3,\n backgroundColor: 'rgba(47,69,84,0)',\n // dataBackgroundColor: '#ddd',\n dataBackground: {\n lineStyle: {\n color: '#d2dbee',\n width: 0.5\n },\n areaStyle: {\n color: '#d2dbee',\n opacity: 0.2\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#8fb0f7',\n width: 0.5\n },\n areaStyle: {\n color: '#8fb0f7',\n opacity: 0.2\n }\n },\n // Color of selected window.\n fillerColor: 'rgba(135,175,274,0.2)',\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\n // Percent of the slider height\n handleSize: '100%',\n handleStyle: {\n color: '#fff',\n borderColor: '#ACB8D1'\n },\n moveHandleSize: 7,\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\n moveHandleStyle: {\n color: '#D2DBEE',\n opacity: 0.7\n },\n showDetail: true,\n showDataShadow: 'auto',\n realtime: true,\n zoomLock: false,\n textStyle: {\n color: '#6E7079'\n },\n brushSelect: true,\n brushStyle: {\n color: 'rgba(135,175,274,0.15)'\n },\n emphasis: {\n handleStyle: {\n borderColor: '#8FB0F7'\n },\n moveHandleStyle: {\n color: '#8FB0F7'\n }\n }\n });\n return SliderZoomModel;\n}(DataZoomModel);\n\nexport default SliderZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, isFunction, isString, indexOf } from 'zrender/lib/core/util';\nimport * as eventTool from 'zrender/lib/core/event';\nimport * as graphic from '../../util/graphic';\nimport * as throttle from '../../util/throttle';\nimport DataZoomView from './DataZoomView';\nimport { linearMap, asc, parsePercent } from '../../util/number';\nimport * as layout from '../../util/layout';\nimport sliderMove from '../helper/sliderMove';\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper';\nimport { enableHoverEmphasis } from '../../util/states';\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol';\nimport { deprecateLog } from '../../util/log';\nimport { createTextStyle } from \"../../label/labelStyle\";\nvar Rect = graphic.Rect; // Constants\n\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\nvar DEFAULT_FILLER_SIZE = 30;\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\nvar HORIZONTAL = 'horizontal';\nvar VERTICAL = 'vertical';\nvar LABEL_GAP = 5;\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\nvar REALTIME_ANIMATION_CONFIG = {\n easing: 'cubicOut',\n duration: 100\n};\n\nvar SliderZoomView =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomView, _super);\n\n function SliderZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomView.type;\n _this._displayables = {};\n return _this;\n }\n\n SliderZoomView.prototype.init = function (ecModel, api) {\n this.api = api; // A unique handler for each dataZoom component\n\n this._onBrush = bind(this._onBrush, this);\n this._onBrushEnd = bind(this._onBrushEnd, this);\n };\n\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n _super.prototype.render.apply(this, arguments);\n\n throttle.createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\n this._orient = dataZoomModel.getOrient();\n\n if (dataZoomModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n this.group.removeAll();\n return;\n } // Notice: this._resetInterval() should not be executed when payload.type\n // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\n\n\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\n this._buildView();\n }\n\n this._updateView();\n };\n\n SliderZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n SliderZoomView.prototype._clear = function () {\n throttle.clear(this, '_dispatchZoomAction');\n var zr = this.api.getZr();\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n };\n\n SliderZoomView.prototype._buildView = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n this._brushing = false;\n this._displayables.brushRect = null;\n\n this._resetLocation();\n\n this._resetInterval();\n\n var barGroup = this._displayables.sliderGroup = new graphic.Group();\n\n this._renderBackground();\n\n this._renderHandle();\n\n this._renderDataShadow();\n\n thisGroup.add(barGroup);\n\n this._positionGroup();\n };\n\n SliderZoomView.prototype._resetLocation = function () {\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var showMoveHandle = dataZoomModel.get('brushSelect');\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; // If some of x/y/width/height are not specified,\n // auto-adapt according to target grid.\n\n var coordRect = this._findCoordRect();\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n }; // Default align by coordinate system rect.\n\n var positionInfo = this._orient === HORIZONTAL ? {\n // Why using 'right', because right should be used in vertical,\n // and it is better to be consistent for dealing with position param merge.\n right: ecSize.width - coordRect.x - coordRect.width,\n top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,\n width: coordRect.width,\n height: DEFAULT_FILLER_SIZE\n } : {\n right: DEFAULT_LOCATION_EDGE_GAP,\n top: coordRect.y,\n width: DEFAULT_FILLER_SIZE,\n height: coordRect.height\n }; // Do not write back to option and replace value 'ph', because\n // the 'ph' value should be recalculated when resize.\n\n var layoutParams = layout.getLayoutParams(dataZoomModel.option); // Replace the placeholder value.\n\n each(['right', 'top', 'width', 'height'], function (name) {\n if (layoutParams[name] === 'ph') {\n layoutParams[name] = positionInfo[name];\n }\n });\n var layoutRect = layout.getLayoutRect(layoutParams, ecSize);\n this._location = {\n x: layoutRect.x,\n y: layoutRect.y\n };\n this._size = [layoutRect.width, layoutRect.height];\n this._orient === VERTICAL && this._size.reverse();\n };\n\n SliderZoomView.prototype._positionGroup = function () {\n var thisGroup = this.group;\n var location = this._location;\n var orient = this._orient; // Just use the first axis to determine mapping.\n\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\n var sliderGroup = this._displayables.sliderGroup;\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup.\n\n sliderGroup.attr(orient === HORIZONTAL && !inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: 1\n } : orient === HORIZONTAL && inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: -1\n } : orient === VERTICAL && !inverse ? {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: 1,\n rotation: Math.PI / 2\n } // Dont use Math.PI, considering shadow direction.\n : {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: -1,\n rotation: Math.PI / 2\n }); // Position barGroup\n\n var rect = thisGroup.getBoundingRect([sliderGroup]);\n thisGroup.x = location.x - rect.x;\n thisGroup.y = location.y - rect.y;\n thisGroup.markRedraw();\n };\n\n SliderZoomView.prototype._getViewExtent = function () {\n return [0, this._size[0]];\n };\n\n SliderZoomView.prototype._renderBackground = function () {\n var dataZoomModel = this.dataZoomModel;\n var size = this._size;\n var barGroup = this._displayables.sliderGroup;\n var brushSelect = dataZoomModel.get('brushSelect');\n barGroup.add(new Rect({\n silent: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: dataZoomModel.get('backgroundColor')\n },\n z2: -40\n })); // Click panel, over shadow, below handles.\n\n var clickPanel = new Rect({\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: 'transparent'\n },\n z2: 0,\n onclick: bind(this._onClickPanel, this)\n });\n var zr = this.api.getZr();\n\n if (brushSelect) {\n clickPanel.on('mousedown', this._onBrushStart, this);\n clickPanel.cursor = 'crosshair';\n zr.on('mousemove', this._onBrush);\n zr.on('mouseup', this._onBrushEnd);\n } else {\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n }\n\n barGroup.add(clickPanel);\n };\n\n SliderZoomView.prototype._renderDataShadow = function () {\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\n\n this._displayables.dataShadowSegs = [];\n\n if (!info) {\n return;\n }\n\n var size = this._size;\n var seriesModel = info.series;\n var data = seriesModel.getRawData();\n var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() // @see candlestick\n : info.otherDim;\n\n if (otherDim == null) {\n return;\n }\n\n var otherDataExtent = data.getDataExtent(otherDim); // Nice extent.\n\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\n otherDataExtent = [otherDataExtent[0] - otherOffset, otherDataExtent[1] + otherOffset];\n var otherShadowExtent = [0, size[1]];\n var thisShadowExtent = [0, size[0]];\n var areaPoints = [[size[0], 0], [0, 0]];\n var linePoints = [];\n var step = thisShadowExtent[1] / (data.count() - 1);\n var thisCoord = 0; // Optimize for large data shadow\n\n var stride = Math.round(data.count() / size[0]);\n var lastIsEmpty;\n data.each([otherDim], function (value, index) {\n if (stride > 0 && index % stride) {\n thisCoord += step;\n return;\n } // FIXME\n // Should consider axis.min/axis.max when drawing dataShadow.\n // FIXME\n // 应该使用统一的空判断?还是在list里进行空判断?\n\n\n var isEmpty = value == null || isNaN(value) || value === ''; // See #4235.\n\n var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true); // Attempt to draw data shadow precisely when there are empty value.\n\n if (isEmpty && !lastIsEmpty && index) {\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\n } else if (!isEmpty && lastIsEmpty) {\n areaPoints.push([thisCoord, 0]);\n linePoints.push([thisCoord, 0]);\n }\n\n areaPoints.push([thisCoord, otherCoord]);\n linePoints.push([thisCoord, otherCoord]);\n thisCoord += step;\n lastIsEmpty = isEmpty;\n });\n var dataZoomModel = this.dataZoomModel;\n\n function createDataShadowGroup(isSelectedArea) {\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\n var group = new graphic.Group();\n var polygon = new graphic.Polygon({\n shape: {\n points: areaPoints\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('areaStyle').getAreaStyle(),\n silent: true,\n z2: -20\n });\n var polyline = new graphic.Polyline({\n shape: {\n points: linePoints\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('lineStyle').getLineStyle(),\n silent: true,\n z2: -19\n });\n group.add(polygon);\n group.add(polyline);\n return group;\n } // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\n\n\n for (var i = 0; i < 3; i++) {\n var group = createDataShadowGroup(i === 1);\n\n this._displayables.sliderGroup.add(group);\n\n this._displayables.dataShadowSegs.push(group);\n }\n };\n\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\n var dataZoomModel = this.dataZoomModel;\n var showDataShadow = dataZoomModel.get('showDataShadow');\n\n if (showDataShadow === false) {\n return;\n } // Find a representative series.\n\n\n var result;\n var ecModel = this.ecModel;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();\n each(seriesModels, function (seriesModel) {\n if (result) {\n return;\n }\n\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\n return;\n }\n\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\n var otherDim = getOtherDim(axisDim);\n var otherAxisInverse;\n var coordSys = seriesModel.coordinateSystem;\n\n if (otherDim != null && coordSys.getOtherAxis) {\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\n }\n\n otherDim = seriesModel.getData().mapDimension(otherDim);\n result = {\n thisAxis: thisAxis,\n series: seriesModel,\n thisDim: axisDim,\n otherDim: otherDim,\n otherAxisInverse: otherAxisInverse\n };\n }, this);\n }, this);\n return result;\n };\n\n SliderZoomView.prototype._renderHandle = function () {\n var thisGroup = this.group;\n var displayables = this._displayables;\n var handles = displayables.handles = [null, null];\n var handleLabels = displayables.handleLabels = [null, null];\n var sliderGroup = this._displayables.sliderGroup;\n var size = this._size;\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\n var brushSelect = dataZoomModel.get('brushSelect');\n var filler = displayables.filler = new Rect({\n silent: brushSelect,\n style: {\n fill: dataZoomModel.get('fillerColor')\n },\n textConfig: {\n position: 'inside'\n }\n });\n sliderGroup.add(filler); // Frame border.\n\n sliderGroup.add(new Rect({\n silent: true,\n subPixelOptimize: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1],\n r: borderRadius\n },\n style: {\n stroke: dataZoomModel.get('dataBackgroundColor') // deprecated option\n || dataZoomModel.get('borderColor'),\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\n fill: 'rgba(0,0,0,0)'\n }\n })); // Left and right handle to resize\n\n each([0, 1], function (handleIndex) {\n var iconStr = dataZoomModel.get('handleIcon');\n\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) {\n // Compatitable with the old icon parsers. Which can use a path string without path://\n iconStr = 'path://' + iconStr;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\n }\n }\n\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\n path.attr({\n cursor: getCursor(this._orient),\n draggable: true,\n drift: bind(this._onDragMove, this, handleIndex),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false),\n z2: 5\n });\n var bRect = path.getBoundingRect();\n var handleSize = dataZoomModel.get('handleSize');\n this._handleHeight = parsePercent(handleSize, this._size[1]);\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\n path.style.strokeNoScale = true;\n path.rectHover = true;\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n enableHoverEmphasis(path);\n var handleColor = dataZoomModel.get('handleColor'); // deprecated option\n // Compatitable with previous version\n\n if (handleColor != null) {\n path.style.fill = handleColor;\n }\n\n sliderGroup.add(handles[handleIndex] = path);\n var textStyleModel = dataZoomModel.getModel('textStyle');\n thisGroup.add(handleLabels[handleIndex] = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: '',\n verticalAlign: 'middle',\n align: 'center',\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }),\n z2: 10\n }));\n }, this); // Handle to move. Only visible when brushSelect is set true.\n\n var actualMoveZone = filler;\n\n if (brushSelect) {\n var moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\n var moveHandle_1 = displayables.moveHandle = new graphic.Rect({\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\n silent: true,\n shape: {\n r: [0, 0, 2, 2],\n y: size[1] - 0.5,\n height: moveHandleHeight\n }\n });\n var iconSize = moveHandleHeight * 0.8;\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\n moveHandleIcon.silent = true;\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\n actualMoveZone = displayables.moveZone = new graphic.Rect({\n invisible: true,\n shape: {\n y: size[1] - moveZoneExpandSize,\n height: moveHandleHeight + moveZoneExpandSize\n }\n });\n actualMoveZone.on('mouseover', function () {\n api.enterEmphasis(moveHandle_1);\n }).on('mouseout', function () {\n api.leaveEmphasis(moveHandle_1);\n });\n sliderGroup.add(moveHandle_1);\n sliderGroup.add(moveHandleIcon);\n sliderGroup.add(actualMoveZone);\n }\n\n actualMoveZone.attr({\n draggable: true,\n cursor: getCursor(this._orient),\n drift: bind(this._onDragMove, this, 'all'),\n ondragstart: bind(this._showDataInfo, this, true),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false)\n });\n };\n\n SliderZoomView.prototype._resetInterval = function () {\n var range = this._range = this.dataZoomModel.getPercentRange();\n\n var viewExtent = this._getViewExtent();\n\n this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];\n };\n\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\n var dataZoomModel = this.dataZoomModel;\n var handleEnds = this._handleEnds;\n\n var viewExtend = this._getViewExtent();\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n var percentExtent = [0, 100];\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n var lastRange = this._range;\n var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\n };\n\n SliderZoomView.prototype._updateView = function (nonRealtime) {\n var displaybles = this._displayables;\n var handleEnds = this._handleEnds;\n var handleInterval = asc(handleEnds.slice());\n var size = this._size;\n each([0, 1], function (handleIndex) {\n // Handles\n var handle = displaybles.handles[handleIndex];\n var handleHeight = this._handleHeight;\n handle.attr({\n scaleX: handleHeight / 2,\n scaleY: handleHeight / 2,\n // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\n // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\n y: size[1] / 2 - handleHeight / 2\n });\n }, this); // Filler\n\n displaybles.filler.setShape({\n x: handleInterval[0],\n y: 0,\n width: handleInterval[1] - handleInterval[0],\n height: size[1]\n });\n var viewExtent = {\n x: handleInterval[0],\n width: handleInterval[1] - handleInterval[0]\n }; // Move handle\n\n if (displaybles.moveHandle) {\n displaybles.moveHandle.setShape(viewExtent);\n displaybles.moveZone.setShape(viewExtent); // Force update path on the invisible object\n\n displaybles.moveZone.getBoundingRect();\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\n } // update clip path of shadow.\n\n\n var dataShadowSegs = displaybles.dataShadowSegs;\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\n\n for (var i = 0; i < dataShadowSegs.length; i++) {\n var segGroup = dataShadowSegs[i];\n var clipPath = segGroup.getClipPath();\n\n if (!clipPath) {\n clipPath = new graphic.Rect();\n segGroup.setClipPath(clipPath);\n }\n\n clipPath.setShape({\n x: segIntervals[i],\n y: 0,\n width: segIntervals[i + 1] - segIntervals[i],\n height: size[1]\n });\n }\n\n this._updateDataInfo(nonRealtime);\n };\n\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\n var dataZoomModel = this.dataZoomModel;\n var displaybles = this._displayables;\n var handleLabels = displaybles.handleLabels;\n var orient = this._orient;\n var labelTexts = ['', '']; // FIXME\n // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\n\n if (dataZoomModel.get('showDetail')) {\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var axis = axisProxy.getAxisModel().axis;\n var range = this._range;\n var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode.\n ? axisProxy.calculateDataWindow({\n start: range[0],\n end: range[1]\n }).valueWindow : axisProxy.getDataValueWindow();\n labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];\n }\n }\n\n var orderedHandleEnds = asc(this._handleEnds.slice());\n setLabel.call(this, 0);\n setLabel.call(this, 1);\n\n function setLabel(handleIndex) {\n // Label\n // Text should not transform by barGroup.\n // Ignore handlers transform\n var barTransform = graphic.getTransform(displaybles.handles[handleIndex].parent, this.group);\n var direction = graphic.transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\n var offset = this._handleWidth / 2 + LABEL_GAP;\n var textPoint = graphic.applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\n align: orient === HORIZONTAL ? direction : 'center',\n text: labelTexts[handleIndex]\n });\n }\n };\n\n SliderZoomView.prototype._formatLabel = function (value, axis) {\n var dataZoomModel = this.dataZoomModel;\n var labelFormatter = dataZoomModel.get('labelFormatter');\n var labelPrecision = dataZoomModel.get('labelPrecision');\n\n if (labelPrecision == null || labelPrecision === 'auto') {\n labelPrecision = axis.getPixelPrecision();\n }\n\n var valueStr = value == null || isNaN(value) ? '' // FIXME Glue code\n : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({\n value: Math.round(value)\n }) // param of toFixed should less then 20.\n : value.toFixed(Math.min(labelPrecision, 20));\n return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr;\n };\n /**\n * @param showOrHide true: show, false: hide\n */\n\n\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\n // Always show when drgging.\n showOrHide = this._dragging || showOrHide;\n var displayables = this._displayables;\n var handleLabels = displayables.handleLabels;\n handleLabels[0].attr('invisible', !showOrHide);\n handleLabels[1].attr('invisible', !showOrHide); // Highlight move handle\n\n displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\n };\n\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\n this._dragging = true; // For mobile device, prevent screen slider on the button.\n\n eventTool.stop(event.event); // Transform dx, dy to bar coordination.\n\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\n\n var vertex = graphic.applyTransform([dx, dy], barTransform, true);\n\n var changed = this._updateInterval(handleIndex, vertex[0]);\n\n var realtime = this.dataZoomModel.get('realtime');\n\n this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed,\n // which cause bad visual effect when progressive enabled.\n\n\n changed && realtime && this._dispatchZoomAction(true);\n };\n\n SliderZoomView.prototype._onDragEnd = function () {\n this._dragging = false;\n\n this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when\n // drag end will cause the whole view rerender, which is unnecessary.\n\n\n var realtime = this.dataZoomModel.get('realtime');\n !realtime && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onClickPanel = function (e) {\n var size = this._size;\n\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\n\n if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {\n return;\n }\n\n var handleEnds = this._handleEnds;\n var center = (handleEnds[0] + handleEnds[1]) / 2;\n\n var changed = this._updateInterval('all', localPoint[0] - center);\n\n this._updateView();\n\n changed && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrushStart = function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n this._brushStart = new graphic.Point(x, y);\n this._brushing = true;\n this._brushStartTime = +new Date(); // this._updateBrushRect(x, y);\n };\n\n SliderZoomView.prototype._onBrushEnd = function (e) {\n if (!this._brushing) {\n return;\n }\n\n var brushRect = this._displayables.brushRect;\n this._brushing = false;\n\n if (!brushRect) {\n return;\n }\n\n brushRect.attr('ignore', true);\n var brushShape = brushRect.shape;\n var brushEndTime = +new Date(); // console.log(brushEndTime - this._brushStartTime);\n\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\n // Will treat it as a click\n return;\n }\n\n var viewExtend = this._getViewExtent();\n\n var percentExtent = [0, 100];\n this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\n\n this._updateView();\n\n this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrush = function (e) {\n if (this._brushing) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n\n this._updateBrushRect(e.offsetX, e.offsetY);\n }\n };\n\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\n var displayables = this._displayables;\n var dataZoomModel = this.dataZoomModel;\n var brushRect = displayables.brushRect;\n\n if (!brushRect) {\n brushRect = displayables.brushRect = new Rect({\n silent: true,\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\n });\n displayables.sliderGroup.add(brushRect);\n }\n\n brushRect.attr('ignore', false);\n var brushStart = this._brushStart;\n var sliderGroup = this._displayables.sliderGroup;\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\n var size = this._size;\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\n brushRect.setShape({\n x: startPoint[0],\n y: 0,\n width: endPoint[0] - startPoint[0],\n height: size[1]\n });\n };\n /**\n * This action will be throttled.\n */\n\n\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\n var range = this._range;\n this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n dataZoomId: this.dataZoomModel.id,\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\n start: range[0],\n end: range[1]\n });\n };\n\n SliderZoomView.prototype._findCoordRect = function () {\n // Find the grid coresponding to the first axis referred by dataZoom.\n var rect;\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\n\n if (!rect && coordSysInfoList.length) {\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\n rect = coordSys.getRect && coordSys.getRect();\n }\n\n if (!rect) {\n var width = this.api.getWidth();\n var height = this.api.getHeight();\n rect = {\n x: width * 0.2,\n y: height * 0.2,\n width: width * 0.6,\n height: height * 0.6\n };\n }\n\n return rect;\n };\n\n SliderZoomView.type = 'dataZoom.slider';\n return SliderZoomView;\n}(DataZoomView);\n\nfunction getOtherDim(thisDim) {\n // FIXME\n // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\n var map = {\n x: 'y',\n y: 'x',\n radius: 'angle',\n angle: 'radius'\n };\n return map[thisDim];\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default SliderZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SliderZoomModel from './SliderZoomModel';\nimport SliderZoomView from './SliderZoomView';\nimport installCommon from './installCommon';\nexport function install(registers) {\n registers.registerComponentModel(SliderZoomModel);\n registers.registerComponentView(SliderZoomView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport { install as installDataZoomInside } from './installDataZoomInside';\nimport { install as installDataZoomSlider } from './installDataZoomSlider';\nexport function install(registers) {\n use(installDataZoomInside);\n use(installDataZoomSlider); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @file Visual mapping.\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nvar visualDefault = {\n /**\n * @public\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nexport default visualDefault;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport env from 'zrender/lib/core/env';\nimport visualDefault from '../../visual/visualDefault';\nimport VisualMapping from '../../visual/VisualMapping';\nimport * as visualSolution from '../../visual/visualSolution';\nimport * as modelUtil from '../../util/model';\nimport * as numberUtil from '../../util/number';\nimport ComponentModel from '../../model/Component';\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\n\nvar VisualMapModel =\n/** @class */\nfunction (_super) {\n __extends(VisualMapModel, _super);\n\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapModel.type;\n _this.stateList = ['inRange', 'outOfRange'];\n _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color'];\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n /**\n * [lowerBound, upperBound]\n */\n\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\n * @protected\n */\n\n\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option; // FIXME\n // necessary?\n // Disable realtime view update if canvas is not supported.\n\n if (!env.canvasSupported) {\n thisOption.realtime = false;\n }\n\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n };\n /**\n * @protected\n */\n\n\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n };\n /**\n * @public\n */\n\n\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\n * @protected\n * @return {Array.<number>} An array of series indices.\n */\n\n\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n\n return seriesIndices;\n };\n /**\n * @public\n */\n\n\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\n * @pubilc\n */\n\n\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n };\n /**\n * @example\n * this.formatValueText(someVal); // format single numeric value to text.\n * this.formatValueText(someVal, true); // format single category value to text.\n * this.formatValueText([min, max]); // format numeric min-max to text.\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\n *\n * @param value Real value, or this.dataBound[0 or 1].\n * @param isCategory Only available when value is number.\n * @param edgeSymbols Open-close symbol when value is interval.\n * @protected\n */\n\n\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n edgeSymbols = edgeSymbols || ['<', '>'];\n\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n };\n /**\n * @protected\n */\n\n\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option; // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n };\n /**\n * Return Concrete dimention. If return null/undefined, no dimension used.\n */\n\n\n VisualMapModel.prototype.getDataDimension = function (list) {\n var optDim = this.option.dimension;\n var listDimensions = list.dimensions;\n\n if (optDim == null && !listDimensions.length) {\n return;\n }\n\n if (optDim != null) {\n return list.getDimension(optDim);\n }\n\n var dimNames = list.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = list.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimName;\n }\n }\n };\n\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\n\n VisualMapModel.prototype.completeVisualOption = function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n } // Compatible with previous logic, always give a defautl color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the default color, set inRange: {color: null}.\n\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n var itemSymbol = this.getItemSymbol();\n var defaultSymbol = itemSymbol || 'roundRect';\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter none\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max_1 = -Infinity; // symbolSize can be object when categories defined.\n\n eachVisual(symbolSize, function (value) {\n value > max_1 && (max_1 = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max_1], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n };\n\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\n * @public\n * @abstract\n */\n\n\n VisualMapModel.prototype.setSelected = function (selected) {};\n\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\n * @public\n * @abstract\n */\n\n\n VisualMapModel.prototype.getValueState = function (value) {\n return null;\n };\n /**\n * FIXME\n * Do not publish to thirt-part-dev temporarily\n * util the interface is stable. (Should it return\n * a function but not visual meta?)\n *\n * @pubilc\n * @abstract\n * @param getColorVisual\n * params: value, valueState\n * return: color\n * @return {Object} visualMeta\n * should includes {stops, outerColors}\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\n */\n\n\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\n\n VisualMapModel.type = 'visualMap';\n VisualMapModel.dependencies = ['series'];\n VisualMapModel.defaultOption = {\n show: true,\n zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n min: 0,\n max: 200,\n left: 0,\n right: null,\n top: null,\n bottom: 0,\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n padding: 5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n precision: 0,\n textStyle: {\n color: '#333' // 值域文字颜色\n\n }\n };\n return VisualMapModel;\n}(ComponentModel);\n\nexport default VisualMapModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport VisualMapModel from './VisualMapModel';\nimport * as numberUtil from '../../util/number';\nimport { inheritDefaultOption } from '../../util/component'; // Constant\n\nvar DEFAULT_BAR_BOUND = [20, 140];\n\nvar ContinuousModel =\n/** @class */\nfunction (_super) {\n __extends(ContinuousModel, _super);\n\n function ContinuousModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousModel.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n this.resetVisual(function (mappingOption) {\n mappingOption.mappingMethod = 'linear';\n mappingOption.dataExtent = this.getExtent();\n });\n\n this._resetRange();\n };\n /**\n * @protected\n * @override\n */\n\n\n ContinuousModel.prototype.resetItemSize = function () {\n _super.prototype.resetItemSize.apply(this, arguments);\n\n var itemSize = this.itemSize;\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\n };\n /**\n * @private\n */\n\n\n ContinuousModel.prototype._resetRange = function () {\n var dataExtent = this.getExtent();\n var range = this.option.range;\n\n if (!range || range.auto) {\n // `range` should always be array (so we dont use other\n // value like 'auto') for user-friend. (consider getOption).\n dataExtent.auto = 1;\n this.option.range = dataExtent;\n } else if (zrUtil.isArray(range)) {\n if (range[0] > range[1]) {\n range.reverse();\n }\n\n range[0] = Math.max(range[0], dataExtent[0]);\n range[1] = Math.min(range[1], dataExtent[1]);\n }\n };\n /**\n * @protected\n * @override\n */\n\n\n ContinuousModel.prototype.completeVisualOption = function () {\n _super.prototype.completeVisualOption.apply(this, arguments);\n\n zrUtil.each(this.stateList, function (state) {\n var symbolSize = this.option.controller[state].symbolSize;\n\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\n symbolSize[0] = symbolSize[1] / 3; // For good looking.\n }\n }, this);\n };\n /**\n * @override\n */\n\n\n ContinuousModel.prototype.setSelected = function (selected) {\n this.option.range = selected.slice();\n\n this._resetRange();\n };\n /**\n * @public\n */\n\n\n ContinuousModel.prototype.getSelected = function () {\n var dataExtent = this.getExtent();\n var dataInterval = numberUtil.asc((this.get('range') || []).slice()); // Clamp\n\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\n return dataInterval;\n };\n /**\n * @override\n */\n\n\n ContinuousModel.prototype.getValueState = function (value) {\n var range = this.option.range;\n var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.\n // range[1] is processed likewise.\n\n return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange';\n };\n\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\n var result = [];\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimension(data), function (value, dataIndex) {\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\n * @implement\n */\n\n\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\n var stops = [];\n\n function setStop(value, valueState) {\n stops.push({\n value: value,\n color: getColorVisual(value, valueState)\n });\n } // Format to: outOfRange -- inRange -- outOfRange.\n\n\n var iIdx = 0;\n var oIdx = 0;\n var iLen = iVals.length;\n var oLen = oVals.length;\n\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\n // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\n if (oVals[oIdx] < iVals[iIdx]) {\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\n // If range is full, value beyond min, max will be clamped.\n // make a singularity\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\n setStop(iVals[iIdx], 'inRange');\n }\n\n for (var first = 1; oIdx < oLen; oIdx++) {\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\n // make a singularity\n if (first) {\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\n first = 0;\n }\n\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n var stopsLen = stops.length;\n return {\n stops: stops,\n outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent']\n };\n };\n\n ContinuousModel.type = 'visualMap.continuous';\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n align: 'auto',\n calculable: false,\n hoverLink: true,\n realtime: true,\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\n handleSize: '120%',\n handleStyle: {\n borderColor: '#fff',\n borderWidth: 1\n },\n indicatorIcon: 'circle',\n indicatorSize: '50%',\n indicatorStyle: {\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n } // emphasis: {\n // handleStyle: {\n // shadowBlur: 3,\n // shadowOffsetX: 1,\n // shadowOffsetY: 1,\n // shadowColor: 'rgba(0,0,0,0.2)'\n // }\n // }\n\n });\n return ContinuousModel;\n}(VisualMapModel);\n\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\n if (dataExtent[0] === dataExtent[1]) {\n return dataExtent.slice();\n } // When using colorHue mapping, it is not linear color any more.\n // Moreover, canvas gradient seems not to be accurate linear.\n // FIXME\n // Should be arbitrary value 100? or based on pixel size?\n\n\n var count = 200;\n var step = (dataExtent[1] - dataExtent[0]) / count;\n var value = dataExtent[0];\n var stopValues = [];\n\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\n stopValues.push(value);\n value += step;\n }\n\n stopValues.push(dataExtent[1]);\n return stopValues;\n}\n\nexport default ContinuousModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { Rect } from '../../util/graphic';\nimport * as formatUtil from '../../util/format';\nimport * as layout from '../../util/layout';\nimport VisualMapping from '../../visual/VisualMapping';\nimport ComponentView from '../../view/Component';\n\nvar VisualMapView =\n/** @class */\nfunction (_super) {\n __extends(VisualMapView, _super);\n\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapView.type;\n _this.autoPositionValues = {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n };\n return _this;\n }\n\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\n * @protected\n */\n\n\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\n * @protected\n */\n\n\n VisualMapView.prototype.renderBackground = function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new Rect({\n z2: -1,\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n };\n /**\n * @protected\n * @param targetValue can be Infinity or -Infinity\n * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\n * @param opts\n * @param opts.forceState Specify state, instead of using getValueState method.\n * @param opts.convertOpacityToAlpha For color gradient in controller widget.\n * @return {*} Visual value.\n */\n\n\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {}; // Default values.\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\n\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\n\n VisualMapView.prototype.positionGroup = function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\n\nexport default VisualMapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { getLayoutRect } from '../../util/layout';\nvar paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n/**\n * @param visualMapModel\n * @param api\n * @param itemSize always [short, long]\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\n */\n\nexport function getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n } // Auto decision align.\n\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\n * dataIndexInside means filtered index.\n */\n// TODO: TYPE more specified payload types.\n\nexport function makeHighDownBatch(batch, visualMapModel) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batchItem.dataIndex != null) {\n batchItem.dataIndexInside = batchItem.dataIndex;\n batchItem.dataIndex = null;\n }\n\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\n });\n return batch;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient';\nimport * as eventTool from 'zrender/lib/core/event';\nimport VisualMapView from './VisualMapView';\nimport * as graphic from '../../util/graphic';\nimport * as numberUtil from '../../util/number';\nimport sliderMove from '../helper/sliderMove';\nimport * as helper from './helper';\nimport * as modelUtil from '../../util/model';\nimport { parsePercent } from 'zrender/lib/contain/text';\nimport { setAsHighDownDispatcher } from '../../util/states';\nimport { createSymbol } from '../../util/symbol';\nimport ZRImage from 'zrender/lib/graphic/Image';\nimport { getECData } from '../../util/innerStore';\nvar linearMap = numberUtil.linearMap;\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max; // Arbitrary value\n\nvar HOVER_LINK_SIZE = 12;\nvar HOVER_LINK_OUT = 6; // Notice:\n// Any \"interval\" should be by the order of [low, high].\n// \"handle0\" (handleIndex === 0) maps to\n// low data value: this._dataInterval[0] and has low coord.\n// \"handle1\" (handleIndex === 1) maps to\n// high data value: this._dataInterval[1] and has high coord.\n// The logic of transform is implemented in this._createBarGroup.\n\nvar ContinuousView =\n/** @class */\nfunction (_super) {\n __extends(ContinuousView, _super);\n\n function ContinuousView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousView.type;\n _this._shapes = {};\n _this._dataInterval = [];\n _this._handleEnds = [];\n _this._hoverLinkDataIndices = [];\n return _this;\n }\n\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\n this._api = api;\n\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\n this._buildView();\n }\n };\n\n ContinuousView.prototype._buildView = function () {\n this.group.removeAll();\n var visualMapModel = this.visualMapModel;\n var thisGroup = this.group;\n this._orient = visualMapModel.get('orient');\n this._useHandle = visualMapModel.get('calculable');\n\n this._resetInterval();\n\n this._renderBar(thisGroup);\n\n var dataRangeText = visualMapModel.get('text');\n\n this._renderEndsText(thisGroup, dataRangeText, 0);\n\n this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation.\n\n\n this._updateView(true); // After updating view, inner shapes is built completely,\n // and then background can be rendered.\n\n\n this.renderBackground(thisGroup); // Real update view\n\n this._updateView();\n\n this._enableHoverLinkToSeries();\n\n this._enableHoverLinkFromSeries();\n\n this.positionGroup(thisGroup);\n };\n\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\n if (!dataRangeText) {\n return;\n } // Compatible with ec2, text[0] map to high value, text[1] map low value.\n\n\n var text = dataRangeText[1 - endsIndex];\n text = text != null ? text + '' : '';\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var itemSize = visualMapModel.itemSize;\n var barGroup = this._shapes.mainGroup;\n\n var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);\n\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\n\n var orient = this._orient;\n var textStyleModel = this.visualMapModel.textStyleModel;\n this.group.add(new graphic.Text({\n style: {\n x: position[0],\n y: position[1],\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\n align: orient === 'horizontal' ? align : 'center',\n text: text,\n font: textStyleModel.getFont(),\n fill: textStyleModel.getTextColor()\n }\n }));\n };\n\n ContinuousView.prototype._renderBar = function (targetGroup) {\n var visualMapModel = this.visualMapModel;\n var shapes = this._shapes;\n var itemSize = visualMapModel.itemSize;\n var orient = this._orient;\n var useHandle = this._useHandle;\n var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\n\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\n\n var gradientBarGroup = new graphic.Group();\n mainGroup.add(gradientBarGroup); // Bar\n\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, zrUtil.bind(this._dragHandle, this, 'all', false), zrUtil.bind(this._dragHandle, this, 'all', true))); // A border radius clip.\n\n gradientBarGroup.setClipPath(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: itemSize[0],\n height: itemSize[1],\n r: 3\n }\n }));\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\n var textSize = mathMax(textRect.width, textRect.height); // Handle\n\n if (useHandle) {\n shapes.handleThumbs = [];\n shapes.handleLabels = [];\n shapes.handleLabelPoints = [];\n\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\n\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\n }\n\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\n\n targetGroup.add(mainGroup);\n };\n\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\n var onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\n var onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\n var cursor = getCursor(this._orient);\n handleThumb.attr({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n ondragend: onDragEnd,\n onmousemove: function (e) {\n eventTool.stop(e.event);\n }\n });\n handleThumb.x = itemSize[0] / 2;\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\n handleThumb.setStyle({\n strokeNoScale: true,\n strokeFirst: true\n });\n handleThumb.style.lineWidth *= 2;\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n setAsHighDownDispatcher(handleThumb, true);\n mainGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by\n // transform (orient/inverse). So label is built separately but not\n // use zrender/graphic/helper/RectText, and is located based on view\n // group (according to handleLabelPoint) but not barGroup.\n\n var textStyleModel = this.visualMapModel.textStyleModel;\n var handleLabel = new graphic.Text({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n onmousemove: function (e) {\n // Fot mobile devicem, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd,\n style: {\n x: 0,\n y: 0,\n text: '',\n font: textStyleModel.getFont(),\n fill: textStyleModel.getTextColor()\n }\n });\n handleLabel.ensureState('blur').style = {\n opacity: 0.1\n };\n handleLabel.stateTransition = {\n duration: 200\n };\n this.group.add(handleLabel);\n var handleLabelPoint = [handleSize, 0];\n var shapes = this._shapes;\n shapes.handleThumbs[handleIndex] = handleThumb;\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\n shapes.handleLabels[handleIndex] = handleLabel;\n };\n\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\n indicator.attr({\n cursor: 'move',\n invisible: true,\n silent: true,\n x: itemSize[0] / 2\n });\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\n\n if (indicator instanceof ZRImage) {\n var pathStyle = indicator.style;\n indicator.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, indicatorStyle));\n } else {\n indicator.useStyle(indicatorStyle);\n }\n\n mainGroup.add(indicator);\n var textStyleModel = this.visualMapModel.textStyleModel;\n var indicatorLabel = new graphic.Text({\n silent: true,\n invisible: true,\n style: {\n x: 0,\n y: 0,\n text: '',\n font: textStyleModel.getFont(),\n fill: textStyleModel.getTextColor()\n }\n });\n this.group.add(indicatorLabel);\n var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];\n var shapes = this._shapes;\n shapes.indicator = indicator;\n shapes.indicatorLabel = indicatorLabel;\n shapes.indicatorLabelPoint = indicatorLabelPoint;\n this._firstShowIndicator = true;\n };\n\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, // dx is event from ondragend if isEnd is true. It's not used\n dx, dy) {\n if (!this._useHandle) {\n return;\n }\n\n this._dragging = !isEnd;\n\n if (!isEnd) {\n // Transform dx, dy to bar coordination.\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\n\n this._updateInterval(handleIndex, vertex[1]);\n\n this._hideIndicator(); // Considering realtime, update view should be executed\n // before dispatch action.\n\n\n this._updateView();\n } // dragEnd do not dispatch action when realtime.\n\n\n if (isEnd === !this.visualMapModel.get('realtime')) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: this._dataInterval.slice()\n });\n }\n\n if (isEnd) {\n !this._hovering && this._clearHoverLinkToSeries();\n } else if (useHoverLinkOnHandle(this.visualMapModel)) {\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\n }\n };\n\n ContinuousView.prototype._resetInterval = function () {\n var visualMapModel = this.visualMapModel;\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\n var dataExtent = visualMapModel.getExtent();\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];\n };\n /**\n * @private\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\n * @param {number} dx\n * @param {number} dy\n */\n\n\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\n delta = delta || 0;\n var visualMapModel = this.visualMapModel;\n var handleEnds = this._handleEnds;\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, // cross is forbiden\n 0);\n var dataExtent = visualMapModel.getExtent(); // Update data interval.\n\n this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];\n };\n\n ContinuousView.prototype._updateView = function (forSketch) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var shapes = this._shapes;\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\n\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\n\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\n\n shapes.inRange.setStyle({\n fill: visualInRange.barColor // opacity: visualInRange.opacity\n\n }).setShape('points', visualInRange.barPoints);\n shapes.outOfRange.setStyle({\n fill: visualOutOfRange.barColor // opacity: visualOutOfRange.opacity\n\n }).setShape('points', visualOutOfRange.barPoints);\n\n this._updateHandle(inRangeHandleEnds, visualInRange);\n };\n\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\n var opts = {\n forceState: forceState,\n convertOpacityToAlpha: true\n };\n\n var colorStops = this._makeColorGradient(dataInterval, opts);\n\n var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)];\n\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\n\n return {\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\n barPoints: barPoints,\n handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]\n };\n };\n\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\n // Considering colorHue, which is not linear, so we have to sample\n // to calculate gradient color stops, but not only caculate head\n // and tail.\n var sampleNumber = 100; // Arbitrary value.\n\n var colorStops = [];\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\n colorStops.push({\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\n offset: 0\n });\n\n for (var i = 1; i < sampleNumber; i++) {\n var currValue = dataInterval[0] + step * i;\n\n if (currValue > dataInterval[1]) {\n break;\n }\n\n colorStops.push({\n color: this.getControllerVisual(currValue, 'color', opts),\n offset: i / sampleNumber\n });\n }\n\n colorStops.push({\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\n offset: 1\n });\n return colorStops;\n };\n\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\n var itemSize = this.visualMapModel.itemSize;\n return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];\n };\n\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\n var orient = this._orient;\n var inverse = this.visualMapModel.get('inverse');\n return new graphic.Group(orient === 'horizontal' && !inverse ? {\n scaleX: itemAlign === 'bottom' ? 1 : -1,\n rotation: Math.PI / 2\n } : orient === 'horizontal' && inverse ? {\n scaleX: itemAlign === 'bottom' ? -1 : 1,\n rotation: -Math.PI / 2\n } : orient === 'vertical' && !inverse ? {\n scaleX: itemAlign === 'left' ? 1 : -1,\n scaleY: -1\n } : {\n scaleX: itemAlign === 'left' ? 1 : -1\n });\n };\n\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\n if (!this._useHandle) {\n return;\n }\n\n var shapes = this._shapes;\n var visualMapModel = this.visualMapModel;\n var handleThumbs = shapes.handleThumbs;\n var handleLabels = shapes.handleLabels;\n var itemSize = visualMapModel.itemSize;\n var dataExtent = visualMapModel.getExtent();\n each([0, 1], function (handleIndex) {\n var handleThumb = handleThumbs[handleIndex];\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\n handleThumb.y = handleEnds[handleIndex];\n var val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\n handleThumb.x = itemSize[0] - symbolSize / 2; // Update handle label position.\n\n var textPoint = graphic.applyTransform(shapes.handleLabelPoints[handleIndex], graphic.getTransform(handleThumb, this.group));\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\n verticalAlign: 'middle',\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\n });\n }, this);\n };\n\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var itemSize = visualMapModel.itemSize;\n var sizeExtent = [0, itemSize[1]];\n var shapes = this._shapes;\n var indicator = shapes.indicator;\n\n if (!indicator) {\n return;\n }\n\n indicator.attr('invisible', false);\n var opts = {\n convertOpacityToAlpha: true\n };\n var color = this.getControllerVisual(cursorValue, 'color', opts);\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\n var y = linearMap(cursorValue, dataExtent, sizeExtent, true);\n var x = itemSize[0] - symbolSize / 2;\n var oldIndicatorPos = {\n x: indicator.x,\n y: indicator.y\n }; // Update handle label position.\n\n indicator.y = y;\n indicator.x = x;\n var textPoint = graphic.applyTransform(shapes.indicatorLabelPoint, graphic.getTransform(indicator, this.group));\n var indicatorLabel = shapes.indicatorLabel;\n indicatorLabel.attr('invisible', false);\n\n var align = this._applyTransform('left', shapes.mainGroup);\n\n var orient = this._orient;\n var isHorizontal = orient === 'horizontal';\n indicatorLabel.setStyle({\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\n verticalAlign: isHorizontal ? align : 'middle',\n align: isHorizontal ? 'center' : align\n });\n var indicatorNewProps = {\n x: x,\n y: y,\n style: {\n fill: color\n }\n };\n var labelNewProps = {\n style: {\n x: textPoint[0],\n y: textPoint[1]\n }\n };\n\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\n var animationCfg = {\n duration: 100,\n easing: 'cubicInOut',\n additive: true\n };\n indicator.x = oldIndicatorPos.x;\n indicator.y = oldIndicatorPos.y;\n indicator.animateTo(indicatorNewProps, animationCfg);\n indicatorLabel.animateTo(labelNewProps, animationCfg);\n } else {\n indicator.attr(indicatorNewProps);\n indicatorLabel.attr(labelNewProps);\n }\n\n this._firstShowIndicator = false;\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.enterBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\n var self = this;\n\n this._shapes.mainGroup.on('mousemove', function (e) {\n self._hovering = true;\n\n if (!self._dragging) {\n var itemSize = self.visualMapModel.itemSize;\n\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); // For hover link show when hover handle, which might be\n // below or upper than sizeExtent.\n\n\n pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\n\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\n }\n }).on('mouseout', function () {\n // When mouse is out of handle, hoverLink still need\n // to be displayed when realtime is set as false.\n self._hovering = false;\n !self._dragging && self._clearHoverLinkToSeries();\n });\n };\n\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\n var zr = this.api.getZr();\n\n if (this.visualMapModel.option.hoverLink) {\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\n zr.on('mouseout', this._hideIndicator, this);\n } else {\n this._clearHoverLinkFromSeries();\n }\n };\n\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\n var visualMapModel = this.visualMapModel;\n var itemSize = visualMapModel.itemSize;\n\n if (!visualMapModel.option.hoverLink) {\n return;\n }\n\n var sizeExtent = [0, itemSize[1]];\n var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent.\n\n cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\n var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\n var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\n // where china and india has very large population.\n\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle,\n // otherwise labels overlap, especially when dragging.\n\n if (hoverOnBar) {\n if (valueRange[0] === -Infinity) {\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\n } else if (valueRange[1] === Infinity) {\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\n } else {\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\n }\n } // When realtime is set as false, handles, which are in barGroup,\n // also trigger hoverLink, which help user to realize where they\n // focus on when dragging. (see test/heatmap-large.html)\n // When realtime is set as true, highlight will not show when hover\n // handle, because the label on handle, which displays a exact value\n // but not range, might mislead users.\n\n\n var oldBatch = this._hoverLinkDataIndices;\n var newBatch = [];\n\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\n }\n\n var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\n\n this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\n };\n\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\n var el = e.target;\n var visualMapModel = this.visualMapModel;\n\n if (!el || getECData(el).dataIndex == null) {\n return;\n }\n\n var ecData = getECData(el);\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\n\n if (!visualMapModel.isTargetSeries(dataModel)) {\n return;\n }\n\n var data = dataModel.getData(ecData.dataType);\n var value = data.get(visualMapModel.getDataDimension(data), ecData.dataIndex);\n\n if (!isNaN(value)) {\n this._showIndicator(value, value);\n }\n };\n\n ContinuousView.prototype._hideIndicator = function () {\n var shapes = this._shapes;\n shapes.indicator && shapes.indicator.attr('invisible', true);\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.leaveBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\n this._hideIndicator();\n\n var indices = this._hoverLinkDataIndices;\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\n\n indices.length = 0;\n };\n\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\n this._hideIndicator();\n\n var zr = this.api.getZr();\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\n zr.off('mouseout', this._hideIndicator);\n };\n\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\n var transform = graphic.getTransform(element, global ? null : this.group);\n return zrUtil.isArray(vertex) ? graphic.applyTransform(vertex, transform, inverse) : graphic.transformDirection(vertex, transform, inverse);\n }; // TODO: TYPE more specified payload types.\n\n\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\n batch && batch.length && this.api.dispatchAction({\n type: type,\n batch: batch\n });\n };\n /**\n * @override\n */\n\n\n ContinuousView.prototype.dispose = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n /**\n * @override\n */\n\n\n ContinuousView.prototype.remove = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n\n ContinuousView.type = 'visualMap.continuous';\n return ContinuousView;\n}(VisualMapView);\n\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\n return new graphic.Polygon({\n shape: {\n points: points\n },\n draggable: !!onDrift,\n cursor: cursor,\n drift: onDrift,\n onmousemove: function (e) {\n // Fot mobile devicem, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd\n });\n}\n\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\n\n if (hoverLinkDataSize) {\n halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\n }\n\n return halfHoverLinkSize;\n}\n\nfunction useHoverLinkOnHandle(visualMapModel) {\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default ContinuousView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var visualMapActionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\nexport var visualMapActionHander = function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\n });\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as visualSolution from '../../visual/visualSolution';\nimport VisualMapping from '../../visual/VisualMapping';\nimport { getVisualFromData } from '../../visual/helper';\nexport var visualMapEncodingHandlers = [{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\n });\n return resetDefines;\n }\n}, // Only support color.\n{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var concreteDim = visualMapModel.getDataDimension(data);\n var dimInfo = data.getDimensionInfo(concreteDim);\n\n if (dimInfo != null) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimInfo.index;\n visualMetaList.push(visualMeta);\n }\n }\n }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}]; // FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\n\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: getVisualFromData(seriesModel.getData(), 'color') // default color.\n\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n\n return resultVisual.color;\n\n function getVisual(key) {\n return resultVisual[key];\n }\n\n function setVisual(key, value) {\n resultVisual[key] = value;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util';\nvar each = zrUtil.each;\nexport default function visualMapPreprocessor(option) {\n var visualMap = option && option.visualMap;\n\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n } // rename splitList to pieces\n\n\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n\n var pieces = opt.pieces;\n\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\n\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction';\nimport { visualMapEncodingHandlers } from './visualEncoding';\nimport { each } from 'zrender/lib/core/util';\nimport preprocessor from './preprocessor';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n });\n registers.registerAction(visualMapActionInfo, visualMapActionHander);\n each(visualMapEncodingHandlers, function (handler) {\n registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\n });\n registers.registerPreprocessor(preprocessor);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ContinuousModel from './ContinuousModel';\nimport ContinuousView from './ContinuousView';\nimport installCommon from './installCommon';\nexport function install(registers) {\n registers.registerComponentModel(ContinuousModel);\n registers.registerComponentView(ContinuousView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport VisualMapModel from './VisualMapModel';\nimport VisualMapping from '../../visual/VisualMapping';\nimport visualDefault from '../../visual/visualDefault';\nimport { reformIntervals } from '../../util/number';\nimport { inheritDefaultOption } from '../../util/component';\n\nvar PiecewiseModel =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseModel, _super);\n\n function PiecewiseModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseModel.type;\n /**\n * The order is always [low, ..., high].\n * [{text: string, interval: Array.<number>}, ...]\n */\n\n _this._pieceList = [];\n return _this;\n }\n\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n\n var mode = this._mode = this._determineMode();\n\n this._pieceList = [];\n\n resetMethods[this._mode].call(this, this._pieceList);\n\n this._resetSelected(newOption, isInit);\n\n var categories = this.option.categories;\n this.resetVisual(function (mappingOption, state) {\n if (mode === 'categories') {\n mappingOption.mappingMethod = 'category';\n mappingOption.categories = zrUtil.clone(categories);\n } else {\n mappingOption.dataExtent = this.getExtent();\n mappingOption.mappingMethod = 'piecewise';\n mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\n piece = zrUtil.clone(piece);\n\n if (state !== 'inRange') {\n // FIXME\n // outOfRange do not support special visual in pieces.\n piece.visual = null;\n }\n\n return piece;\n });\n }\n });\n };\n /**\n * @protected\n * @override\n */\n\n\n PiecewiseModel.prototype.completeVisualOption = function () {\n // Consider this case:\n // visualMap: {\n // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\n // }\n // where no inRange/outOfRange set but only pieces. So we should make\n // default inRange/outOfRange for this case, otherwise visuals that only\n // appear in `pieces` will not be taken into account in visual encoding.\n var option = this.option;\n var visualTypesInPieces = {};\n var visualTypes = VisualMapping.listVisualTypes();\n var isCategory = this.isCategory();\n zrUtil.each(option.pieces, function (piece) {\n zrUtil.each(visualTypes, function (visualType) {\n if (piece.hasOwnProperty(visualType)) {\n visualTypesInPieces[visualType] = 1;\n }\n });\n });\n zrUtil.each(visualTypesInPieces, function (v, visualType) {\n var exists = false;\n zrUtil.each(this.stateList, function (state) {\n exists = exists || has(option, state, visualType) || has(option.target, state, visualType);\n }, this);\n !exists && zrUtil.each(this.stateList, function (state) {\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\n });\n }, this);\n\n function has(obj, state, visualType) {\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\n }\n\n _super.prototype.completeVisualOption.apply(this, arguments);\n };\n\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\n var thisOption = this.option;\n var pieceList = this._pieceList; // Selected do not merge but all override.\n\n var selected = (isInit ? thisOption : newOption).selected || {};\n thisOption.selected = selected; // Consider 'not specified' means true.\n\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (!selected.hasOwnProperty(key)) {\n selected[key] = true;\n }\n }, this);\n\n if (thisOption.selectedMode === 'single') {\n // Ensure there is only one selected.\n var hasSel_1 = false;\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (selected[key]) {\n hasSel_1 ? selected[key] = false : hasSel_1 = true;\n }\n }, this);\n } // thisOption.selectedMode === 'multiple', default: all selected.\n\n };\n /**\n * @public\n */\n\n\n PiecewiseModel.prototype.getItemSymbol = function () {\n return this.get('itemSymbol');\n };\n /**\n * @public\n */\n\n\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\n return this._mode === 'categories' ? piece.value + '' : piece.index + '';\n };\n /**\n * @public\n */\n\n\n PiecewiseModel.prototype.getPieceList = function () {\n return this._pieceList;\n };\n /**\n * @return {string}\n */\n\n\n PiecewiseModel.prototype._determineMode = function () {\n var option = this.option;\n return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber';\n };\n /**\n * @override\n */\n\n\n PiecewiseModel.prototype.setSelected = function (selected) {\n this.option.selected = zrUtil.clone(selected);\n };\n /**\n * @override\n */\n\n\n PiecewiseModel.prototype.getValueState = function (value) {\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\n return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange';\n };\n /**\n * @public\n * @param pieceIndex piece index in visualMapModel.getPieceList()\n */\n\n\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\n var result = [];\n var pieceList = this._pieceList;\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimension(data), function (value, dataIndex) {\n // Should always base on model pieceList, because it is order sensitive.\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\n pIdx === pieceIndex && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\n * @private\n * @param piece piece.value or piece.interval is required.\n * @return Can be Infinity or -Infinity\n */\n\n\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\n var representValue;\n\n if (this.isCategory()) {\n representValue = piece.value;\n } else {\n if (piece.value != null) {\n representValue = piece.value;\n } else {\n var pieceInterval = piece.interval || [];\n representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;\n }\n }\n\n return representValue;\n };\n\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\n // Do not support category. (category axis is ordinal, numerical)\n if (this.isCategory()) {\n return;\n }\n\n var stops = [];\n var outerColors = ['', ''];\n var visualMapModel = this;\n\n function setStop(interval, valueState) {\n var representValue = visualMapModel.getRepresentValue({\n interval: interval\n }); // Not category\n\n if (!valueState) {\n valueState = visualMapModel.getValueState(representValue);\n }\n\n var color = getColorVisual(representValue, valueState);\n\n if (interval[0] === -Infinity) {\n outerColors[0] = color;\n } else if (interval[1] === Infinity) {\n outerColors[1] = color;\n } else {\n stops.push({\n value: interval[0],\n color: color\n }, {\n value: interval[1],\n color: color\n });\n }\n } // Suplement\n\n\n var pieceList = this._pieceList.slice();\n\n if (!pieceList.length) {\n pieceList.push({\n interval: [-Infinity, Infinity]\n });\n } else {\n var edge = pieceList[0].interval[0];\n edge !== -Infinity && pieceList.unshift({\n interval: [-Infinity, edge]\n });\n edge = pieceList[pieceList.length - 1].interval[1];\n edge !== Infinity && pieceList.push({\n interval: [edge, Infinity]\n });\n }\n\n var curr = -Infinity;\n zrUtil.each(pieceList, function (piece) {\n var interval = piece.interval;\n\n if (interval) {\n // Fulfill gap.\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\n setStop(interval.slice());\n curr = interval[1];\n }\n }, this);\n return {\n stops: stops,\n outerColors: outerColors\n };\n };\n\n PiecewiseModel.type = 'visualMap.piecewise';\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n selected: null,\n minOpen: false,\n maxOpen: false,\n align: 'auto',\n itemWidth: 20,\n itemHeight: 14,\n itemSymbol: 'roundRect',\n pieces: null,\n categories: null,\n splitNumber: 5,\n selectedMode: 'multiple',\n itemGap: 10,\n hoverLink: true // Enable hover highlight.\n\n });\n return PiecewiseModel;\n}(VisualMapModel);\n\n;\n/**\n * Key is this._mode\n * @type {Object}\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\n */\n\nvar resetMethods = {\n splitNumber: function (outPieceList) {\n var thisOption = this.option;\n var precision = Math.min(thisOption.precision, 20);\n var dataExtent = this.getExtent();\n var splitNumber = thisOption.splitNumber;\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\n thisOption.splitNumber = splitNumber;\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption\n\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\n precision++;\n }\n\n thisOption.precision = precision;\n splitStep = +splitStep.toFixed(precision);\n\n if (thisOption.minOpen) {\n outPieceList.push({\n interval: [-Infinity, dataExtent[0]],\n close: [0, 0]\n });\n }\n\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\n var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;\n outPieceList.push({\n interval: [curr, max],\n close: [1, 1]\n });\n }\n\n if (thisOption.maxOpen) {\n outPieceList.push({\n interval: [dataExtent[1], Infinity],\n close: [0, 0]\n });\n }\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece, index) {\n piece.index = index;\n piece.text = this.formatValueText(piece.interval);\n }, this);\n },\n categories: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.categories, function (cate) {\n // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。\n // 是否改一致。\n outPieceList.push({\n text: this.formatValueText(cate, true),\n value: cate\n });\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList);\n },\n pieces: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\n if (!zrUtil.isObject(pieceListItem)) {\n pieceListItem = {\n value: pieceListItem\n };\n }\n\n var item = {\n text: '',\n index: index\n };\n\n if (pieceListItem.label != null) {\n item.text = pieceListItem.label;\n }\n\n if (pieceListItem.hasOwnProperty('value')) {\n var value = item.value = pieceListItem.value;\n item.interval = [value, value];\n item.close = [1, 1];\n } else {\n // `min` `max` is legacy option.\n // `lt` `gt` `lte` `gte` is recommanded.\n var interval = item.interval = [];\n var close_1 = item.close = [0, 0];\n var closeList = [1, 0, 1];\n var infinityList = [-Infinity, Infinity];\n var useMinMax = [];\n\n for (var lg = 0; lg < 2; lg++) {\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\n\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\n interval[lg] = pieceListItem[names[i]];\n close_1[lg] = closeList[i];\n useMinMax[lg] = i === 2;\n }\n\n interval[lg] == null && (interval[lg] = infinityList[lg]);\n }\n\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\n\n if (process.env.NODE_ENV !== 'production') {\n if (interval[0] > interval[1]) {\n console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.');\n }\n }\n\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\n // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\n // we use value to lift the priority when min === max\n item.value = interval[0];\n }\n }\n\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\n outPieceList.push(item);\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList); // Only pieces\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece) {\n var close = piece.close;\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\n }, this);\n }\n};\n\nfunction normalizeReverse(thisOption, pieceList) {\n var inverse = thisOption.inverse;\n\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\n pieceList.reverse();\n }\n}\n\nexport default PiecewiseModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport VisualMapView from './VisualMapView';\nimport * as graphic from '../../util/graphic';\nimport { createSymbol } from '../../util/symbol';\nimport * as layout from '../../util/layout';\nimport * as helper from './helper';\n\nvar PiecewiseVisualMapView =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseVisualMapView, _super);\n\n function PiecewiseVisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseVisualMapView.type;\n return _this;\n }\n\n PiecewiseVisualMapView.prototype.doRender = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var textStyleModel = visualMapModel.textStyleModel;\n var textFont = textStyleModel.getFont();\n var textFill = textStyleModel.getTextColor();\n\n var itemAlign = this._getItemAlign();\n\n var itemSize = visualMapModel.itemSize;\n\n var viewData = this._getViewData();\n\n var endsText = viewData.endsText;\n var showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\n zrUtil.each(viewData.viewPieceList, function (item) {\n var piece = item.piece;\n var itemGroup = new graphic.Group();\n itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\n\n this._enableHoverLink(itemGroup, item.indexInModelPieceList); // TODO Category\n\n\n var representValue = visualMapModel.getRepresentValue(piece);\n\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\n\n if (showLabel) {\n var visualState = this.visualMapModel.getValueState(representValue);\n itemGroup.add(new graphic.Text({\n style: {\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\n y: itemSize[1] / 2,\n text: piece.text,\n verticalAlign: 'middle',\n align: itemAlign,\n font: textFont,\n fill: textFill,\n opacity: visualState === 'outOfRange' ? 0.5 : 1\n }\n }));\n }\n\n thisGroup.add(itemGroup);\n }, this);\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\n layout.box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\n this.renderBackground(thisGroup);\n this.positionGroup(thisGroup);\n };\n\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\n var _this = this;\n\n itemGroup.on('mouseover', function () {\n return onHoverLink('highlight');\n }).on('mouseout', function () {\n return onHoverLink('downplay');\n });\n\n var onHoverLink = function (method) {\n var visualMapModel = _this.visualMapModel; // TODO: TYPE More detailed action types\n\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\n type: method,\n batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\n });\n };\n };\n\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\n var visualMapModel = this.visualMapModel;\n var modelOption = visualMapModel.option;\n\n if (modelOption.orient === 'vertical') {\n return helper.getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\n } else {\n // horizontal, most case left unless specifying right.\n var align = modelOption.align;\n\n if (!align || align === 'auto') {\n align = 'left';\n }\n\n return align;\n }\n };\n\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\n if (!text) {\n return;\n }\n\n var itemGroup = new graphic.Group();\n var textStyleModel = this.visualMapModel.textStyleModel;\n itemGroup.add(new graphic.Text({\n style: {\n x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2,\n y: itemSize[1] / 2,\n verticalAlign: 'middle',\n align: showLabel ? itemAlign : 'center',\n text: text,\n font: textStyleModel.getFont(),\n fill: textStyleModel.getTextColor()\n }\n }));\n group.add(itemGroup);\n };\n /**\n * @private\n * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\n */\n\n\n PiecewiseVisualMapView.prototype._getViewData = function () {\n var visualMapModel = this.visualMapModel;\n var viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\n return {\n piece: piece,\n indexInModelPieceList: index\n };\n });\n var endsText = visualMapModel.get('text'); // Consider orient and inverse.\n\n var orient = visualMapModel.get('orient');\n var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high]\n\n if (orient === 'horizontal' ? inverse : !inverse) {\n viewPieceList.reverse();\n } // Origin order of endsText is [high, low]\n else if (endsText) {\n endsText = endsText.slice().reverse();\n }\n\n return {\n viewPieceList: viewPieceList,\n endsText: endsText\n };\n };\n\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\n group.add(createSymbol( // symbol will be string\n this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], // color will be string\n this.getControllerVisual(representValue, 'color')));\n };\n\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\n var visualMapModel = this.visualMapModel;\n var option = visualMapModel.option;\n var selected = zrUtil.clone(option.selected);\n var newKey = visualMapModel.getSelectedMapKey(piece);\n\n if (option.selectedMode === 'single') {\n selected[newKey] = true;\n zrUtil.each(selected, function (o, key) {\n selected[key] = key === newKey;\n });\n } else {\n selected[newKey] = !selected[newKey];\n }\n\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: selected\n });\n };\n\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\n return PiecewiseVisualMapView;\n}(VisualMapView);\n\nexport default PiecewiseVisualMapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PiecewiseModel from './PiecewiseModel';\nimport PiecewiseView from './PiecewiseView';\nimport installCommon from './installCommon';\nexport function install(registers) {\n registers.registerComponentModel(PiecewiseModel);\n registers.registerComponentView(PiecewiseView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension';\nimport { install as installVisualMapContinuous } from './installVisualMapContinuous';\nimport { install as installVisualMapPiecewise } from './installVisualMapPiecewise';\nexport function install(registers) {\n use(installVisualMapContinuous);\n use(installVisualMapPiecewise); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { retrieveRawValue } from '../data/helper/dataProvider';\nimport { makeInner } from '../util/model';\nimport { getDecalFromPalette } from '../model/mixin/palette';\nvar DEFAULT_OPTION = {\n label: {\n enabled: true\n },\n decal: {\n show: false\n }\n};\nvar inner = makeInner();\nvar decalPaletteScope = {};\nexport default function ariaVisual(ecModel, api) {\n var ariaModel = ecModel.getModel('aria'); // See \"area enabled\" detection code in `GlobalModel.ts`.\n\n if (!ariaModel.get('enabled')) {\n return;\n }\n\n var defaultOption = zrUtil.clone(DEFAULT_OPTION);\n zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\n zrUtil.merge(ariaModel.option, defaultOption, false);\n setDecal();\n setLabel();\n\n function setDecal() {\n var decalModel = ariaModel.getModel('decal');\n var useDecal = decalModel.get('show');\n\n if (useDecal) {\n // Each type of series use one scope.\n // Pie and funnel are using diferrent scopes\n var paletteScopeGroupByType_1 = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n if (!seriesModel.useColorPaletteOnData) {\n return;\n }\n\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\n\n if (!decalScope) {\n decalScope = {};\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\n }\n\n inner(seriesModel).scope = decalScope;\n });\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n if (typeof seriesModel.enableAriaDecal === 'function') {\n // Let series define how to use decal palette on data\n seriesModel.enableAriaDecal();\n return;\n }\n\n var data = seriesModel.getData();\n\n if (seriesModel.useColorPaletteOnData) {\n var dataAll_1 = seriesModel.getRawData();\n var idxMap_1 = {};\n var decalScope_1 = inner(seriesModel).scope;\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap_1[rawIdx] = idx;\n });\n var dataCount_1 = dataAll_1.count();\n dataAll_1.each(function (rawIdx) {\n var idx = idxMap_1[rawIdx];\n var name = dataAll_1.getName(rawIdx) || rawIdx + '';\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\n var specifiedDecal = data.getItemVisual(idx, 'decal');\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\n });\n } else {\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\n var specifiedDecal = data.getVisual('decal');\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\n }\n\n function mergeDecal(specifiedDecal, paletteDecal) {\n // Merge decal from palette to decal from itemStyle.\n // User do not need to specify all of the decal props.\n var resultDecal = specifiedDecal ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal) : paletteDecal;\n resultDecal.dirty = true;\n return resultDecal;\n }\n });\n }\n }\n\n function setLabel() {\n var labelLocale = ecModel.getLocaleModel().get('aria');\n var labelModel = ariaModel.getModel('label');\n labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\n\n if (!labelModel.get('enabled')) {\n return;\n }\n\n var dom = api.getZr().dom;\n\n if (labelModel.get('description')) {\n dom.setAttribute('aria-label', labelModel.get('description'));\n return;\n }\n\n var seriesCnt = ecModel.getSeriesCount();\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n var ariaLabel;\n\n if (seriesCnt < 1) {\n // No series, no aria label\n return;\n } else {\n var title = getTitle();\n\n if (title) {\n var withTitle = labelModel.get(['general', 'withTitle']);\n ariaLabel = replace(withTitle, {\n title: title\n });\n } else {\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\n }\n\n var seriesLabels_1 = [];\n var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']);\n ariaLabel += replace(prefix, {\n seriesCount: seriesCnt\n });\n ecModel.eachSeries(function (seriesModel, idx) {\n if (idx < displaySeriesCnt) {\n var seriesLabel = void 0;\n var seriesName = seriesModel.get('name');\n var withName = seriesName ? 'withName' : 'withoutName';\n seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]);\n seriesLabel = replace(seriesLabel, {\n seriesId: seriesModel.seriesIndex,\n seriesName: seriesModel.get('name'),\n seriesType: getSeriesTypeName(seriesModel.subType)\n });\n var data = seriesModel.getData();\n\n if (data.count() > maxDataCnt) {\n // Show part of data\n var partialLabel = labelModel.get(['data', 'partialData']);\n seriesLabel += replace(partialLabel, {\n displayCnt: maxDataCnt\n });\n } else {\n seriesLabel += labelModel.get(['data', 'allData']);\n }\n\n var dataLabels = [];\n\n for (var i = 0; i < data.count(); i++) {\n if (i < maxDataCnt) {\n var name_1 = data.getName(i);\n var value = retrieveRawValue(data, i);\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\n dataLabels.push(replace(dataLabel, {\n name: name_1,\n value: value\n }));\n }\n }\n\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\n seriesLabels_1.push(seriesLabel);\n }\n });\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\n var middleSeparator = separatorModel.get('middle');\n var endSeparator = separatorModel.get('end');\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\n dom.setAttribute('aria-label', ariaLabel);\n }\n }\n\n function replace(str, keyValues) {\n if (typeof str !== 'string') {\n return str;\n }\n\n var result = str;\n zrUtil.each(keyValues, function (value, key) {\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n });\n return result;\n }\n\n function getTitle() {\n var title = ecModel.get('title');\n\n if (title && title.length) {\n title = title[0];\n }\n\n return title && title.text;\n }\n\n function getSeriesTypeName(type) {\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport default function ariaPreprocessor(option) {\n if (!option || !option.aria) {\n return;\n }\n\n var aria = option.aria; // aria.show is deprecated and should use aria.enabled instead\n\n if (aria.show != null) {\n aria.enabled = aria.show;\n }\n\n aria.label = aria.label || {}; // move description, general, series, data to be under aria.label\n\n zrUtil.each(['description', 'general', 'series', 'data'], function (name) {\n if (aria[name] != null) {\n aria.label[name] = aria[name];\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ariaVisual from '../../visual/aria';\nimport ariaPreprocessor from './preprocessor';\nexport function install(registers) {\n registers.registerPreprocessor(ariaPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn } from 'zrender/lib/core/util';\nimport { throwError, makePrintable } from './log';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne' // Might mileading for sake of the different between '==' and '===',\n // So dont support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n\n};\n\nvar RegExpEvaluator =\n/** @class */\nfunction () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n\n if (condValue == null) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n\n throwError(errMsg);\n }\n }\n\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = typeof lVal;\n return type === 'string' ? this._condVal.test(lVal) : type === 'number' ? this._condVal.test(lVal + '') : false;\n };\n\n return RegExpEvaluator;\n}();\n\nvar ConstConditionInternal =\n/** @class */\nfunction () {\n function ConstConditionInternal() {}\n\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n\n return ConstConditionInternal;\n}();\n\nvar AndConditionInternal =\n/** @class */\nfunction () {\n function AndConditionInternal() {}\n\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n\n return true;\n };\n\n return AndConditionInternal;\n}();\n\nvar OrConditionInternal =\n/** @class */\nfunction () {\n function OrConditionInternal() {}\n\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n\n return false;\n };\n\n return OrConditionInternal;\n}();\n\nvar NotConditionInternal =\n/** @class */\nfunction () {\n function NotConditionInternal() {}\n\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n\n return NotConditionInternal;\n}();\n\nvar RelationalConditionInternal =\n/** @class */\nfunction () {\n function RelationalConditionInternal() {}\n\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser; // Call getValue with no `this`.\n\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow \"and\" logic internally.\n\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n\n return true;\n };\n\n return RelationalConditionInternal;\n}();\n\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n\n var errMsg = '';\n\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n\n throwError(errMsg);\n }\n\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n\n return parseRelationalOption(exprOption, getters);\n}\n\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n\n if (!cond.children.length) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n\n if (!cond.child) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n subCondList.push(evaluator);\n }\n\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n } // No relational operator always disabled in case of dangers result.\n\n\n throwError(errMsg);\n }\n\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\n\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\n\nvar ConditionalExpressionParsed =\n/** @class */\nfunction () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n\n return ConditionalExpressionParsed;\n}();\n\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseConditionalExpression } from '../../util/conditionalExpression';\nimport { hasOwn, createHashMap } from 'zrender/lib/core/util';\nimport { makePrintable, throwError } from '../../util/log';\nexport var filterTransform = {\n type: 'echarts:filter',\n // PEDING: enhance to filter by index rather than create new data\n transform: function (params) {\n // [Caveat] Fail-Fast:\n // Do not return the whole dataset unless user config indicate it explicitly.\n // For example, if no condition specified by mistake, return an empty result\n // is better than return the entire raw soruce for user to find the mistake.\n var upstream = params.upstream;\n var rawItem;\n var condition = parseConditionalExpression(params.config, {\n valueGetterAttrMap: createHashMap({\n dimension: true\n }),\n prepareGetValue: function (exprOption) {\n var errMsg = '';\n var dimLoose = exprOption.dimension;\n\n if (!hasOwn(exprOption, 'dimension')) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n return {\n dimIdx: dimInfo.index\n };\n },\n getValue: function (param) {\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\n }\n });\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n rawItem = upstream.getRawDataItem(i);\n\n if (condition.evaluate()) {\n resultData.push(rawItem);\n }\n }\n\n return {\n data: resultData\n };\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS } from '../../util/types';\nimport { makePrintable, throwError } from '../../util/log';\nimport { each } from 'zrender/lib/core/util';\nimport { normalizeToArray } from '../../util/model';\nimport { getRawValueParser, SortOrderComparator } from '../../data/helper/dataValueHelper';\nvar sampleLog = '';\n\nif (process.env.NODE_ENV !== 'production') {\n sampleLog = ['Valid config is like:', '{ dimension: \"age\", order: \"asc\" }', 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'].join(' ');\n}\n\nexport var sortTransform = {\n type: 'echarts:sort',\n transform: function (params) {\n var upstream = params.upstream;\n var config = params.config;\n var errMsg = ''; // Normalize\n // const orderExprList: OrderExpression[] = isArray(config[0])\n // ? config as OrderExpression[]\n // : [config as OrderExpression];\n\n var orderExprList = normalizeToArray(config);\n\n if (!orderExprList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Empty `config` in sort transform.';\n }\n\n throwError(errMsg);\n }\n\n var orderDefList = [];\n each(orderExprList, function (orderExpr) {\n var dimLoose = orderExpr.dimension;\n var order = orderExpr.order;\n var parserName = orderExpr.parser;\n var incomparable = orderExpr.incomparable;\n\n if (dimLoose == null) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (incomparable && incomparable !== 'min' && incomparable !== 'max') {\n var errMsg_1 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\n }\n\n throwError(errMsg_1);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n var errMsg_2 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\n }\n\n throwError(errMsg_2);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n var parser = parserName ? getRawValueParser(parserName) : null;\n\n if (parserName && !parser) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n orderDefList.push({\n dimIdx: dimInfo.index,\n parser: parser,\n comparator: new SortOrderComparator(order, incomparable)\n });\n }); // TODO: support it?\n\n var sourceFormat = upstream.sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\n }\n\n throwError(errMsg);\n } // Other upstream format are all array.\n\n\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n resultData.push(upstream.getRawDataItem(i));\n }\n\n resultData.sort(function (item0, item1) {\n for (var i = 0; i < orderDefList.length; i++) {\n var orderDef = orderDefList[i];\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\n\n if (orderDef.parser) {\n val0 = orderDef.parser(val0);\n val1 = orderDef.parser(val1);\n }\n\n var result = orderDef.comparator.evaluate(val0, val1);\n\n if (result !== 0) {\n return result;\n }\n }\n\n return 0;\n });\n return {\n data: resultData\n };\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { filterTransform } from './filterTransform';\nimport { sortTransform } from './sortTransform';\nexport function install(registers) {\n registers.registerTransform(filterTransform);\n registers.registerTransform(sortTransform);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\n\nimport ComponentModel from '../../model/Component';\nimport ComponentView from '../../view/Component';\nimport { SERIES_LAYOUT_BY_COLUMN } from '../../util/types';\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager';\n\nvar DatasetModel =\n/** @class */\nfunction (_super) {\n __extends(DatasetModel, _super);\n\n function DatasetModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n this._sourceManager = new SourceManager(this);\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\n _super.prototype.mergeOption.call(this, newOption, ecModel);\n\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.optionUpdated = function () {\n this._sourceManager.dirty();\n };\n\n DatasetModel.prototype.getSourceManager = function () {\n return this._sourceManager;\n };\n\n DatasetModel.type = 'dataset';\n DatasetModel.defaultOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\n };\n return DatasetModel;\n}(ComponentModel);\n\nexport { DatasetModel };\n\nvar DatasetView =\n/** @class */\nfunction (_super) {\n __extends(DatasetView, _super);\n\n function DatasetView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetView.type = 'dataset';\n return DatasetView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(DatasetModel);\n registers.registerComponentView(DatasetView);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from './lib/extension';\nexport * from './lib/export/core'; // ----------------------------------------------\n// All of the modules that are allowed to be\n// imported are listed below.\n//\n// Users MUST NOT import other modules that are\n// not included in this list.\n// ----------------------------------------------\n\nimport { SVGRenderer, CanvasRenderer } from './lib/export/renderers';\nimport { LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart } from './lib/export/charts';\nimport { GridComponent, PolarComponent, GeoComponent, SingleAxisComponent, ParallelComponent, CalendarComponent, GraphicComponent, ToolboxComponent, TooltipComponent, AxisPointerComponent, BrushComponent, TitleComponent, TimelineComponent, MarkPointComponent, MarkLineComponent, MarkAreaComponent, LegendComponent, DataZoomComponent, DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent, VisualMapContinuousComponent, VisualMapPiecewiseComponent, AriaComponent, DatasetComponent, TransformComponent } from './lib/export/components'; // -----------------\n// Render engines\n// -----------------\n// Render via Canvas.\n// echarts.init(dom, null, { renderer: 'canvas' })\n\nuse([CanvasRenderer]); // Render via SVG.\n// echarts.init(dom, null, { renderer: 'svg' })\n\nuse([SVGRenderer]); // ----------------\n// Charts (series)\n// ----------------\n// All of the series types, for example:\n// chart.setOption({\n// series: [{\n// type: 'line' // or 'bar', 'pie', ...\n// }]\n// });\n\nuse([LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart]); // -------------------\n// Coordinate systems\n// -------------------\n// All of the axis modules have been included in the\n// coordinate system module below, do not need to\n// make extra import.\n// `cartesian` coordinate system. For some historical\n// reasons, it is named as grid, for example:\n// chart.setOption({\n// grid: {...},\n// xAxis: {...},\n// yAxis: {...},\n// series: [{...}]\n// });\n\nuse(GridComponent); // `polar` coordinate system, for example:\n// chart.setOption({\n// polar: {...},\n// radiusAxis: {...},\n// angleAxis: {...},\n// series: [{\n// coordinateSystem: 'polar'\n// }]\n// });\n\nuse(PolarComponent); // `geo` coordinate system, for example:\n// chart.setOption({\n// geo: {...},\n// series: [{\n// coordinateSystem: 'geo'\n// }]\n// });\n\nuse(GeoComponent); // `singleAxis` coordinate system (notice, it is a coordinate system\n// with only one axis, work for chart like theme river), for example:\n// chart.setOption({\n// singleAxis: {...}\n// series: [{type: 'themeRiver', ...}]\n// });\n\nuse(SingleAxisComponent); // `parallel` coordinate system, only work for parallel series, for example:\n// chart.setOption({\n// parallel: {...},\n// parallelAxis: [{...}, ...],\n// series: [{\n// type: 'parallel'\n// }]\n// });\n\nuse(ParallelComponent); // `calendar` coordinate system. for example,\n// chart.setOptionp({\n// calendar: {...},\n// series: [{\n// coordinateSystem: 'calendar'\n// }]\n// );\n\nuse(CalendarComponent); // ------------------\n// Other components\n// ------------------\n// `graphic` component, for example:\n// chart.setOption({\n// graphic: {...}\n// });\n\nuse(GraphicComponent); // `toolbox` component, for example:\n// chart.setOption({\n// toolbox: {...}\n// });\n\nuse(ToolboxComponent); // `tooltip` component, for example:\n// chart.setOption({\n// tooltip: {...}\n// });\n\nuse(TooltipComponent); // `axisPointer` component, for example:\n// chart.setOption({\n// tooltip: {axisPointer: {...}, ...}\n// });\n// Or\n// chart.setOption({\n// axisPointer: {...}\n// });\n\nuse(AxisPointerComponent); // `brush` component, for example:\n// chart.setOption({\n// brush: {...}\n// });\n// Or\n// chart.setOption({\n// tooltip: {feature: {brush: {...}}\n// })\n\nuse(BrushComponent); // `title` component, for example:\n// chart.setOption({\n// title: {...}\n// });\n\nuse(TitleComponent); // `timeline` component, for example:\n// chart.setOption({\n// timeline: {...}\n// });\n\nuse(TimelineComponent); // `markPoint` component, for example:\n// chart.setOption({\n// series: [{markPoint: {...}}]\n// });\n\nuse(MarkPointComponent); // `markLine` component, for example:\n// chart.setOption({\n// series: [{markLine: {...}}]\n// });\n\nuse(MarkLineComponent); // `markArea` component, for example:\n// chart.setOption({\n// series: [{markArea: {...}}]\n// });\n\nuse(MarkAreaComponent); // `legend` component not scrollable. for example:\n// chart.setOption({\n// legend: {...}\n// });\n\nuse(LegendComponent); // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\n\nuse(DataZoomComponent); // `dataZoom` component providing drag, pinch, wheel behaviors\n// inside coodinate system, for example:\n// chart.setOption({\n// dataZoom: {type: 'inside'}\n// });\n\nuse(DataZoomInsideComponent); // `dataZoom` component providing a slider bar, for example:\n// chart.setOption({\n// dataZoom: {type: 'slider'}\n// });\n\nuse(DataZoomSliderComponent); // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\n\nuse(VisualMapComponent); // `visualMap` component providing continuous bar, for example:\n// chart.setOption({\n// visualMap: {type: 'continuous'}\n// });\n\nuse(VisualMapContinuousComponent); // `visualMap` component providing pieces bar, for example:\n// chart.setOption({\n// visualMap: {type: 'piecewise'}\n// });\n\nuse(VisualMapPiecewiseComponent); // `aria` component providing aria, for example:\n// chart.setOption({\n// aria: {...}\n// });\n\nuse(AriaComponent); // dataset transform\n// chart.setOption({\n// dataset: {\n// transform: []\n// }\n// });\n\nuse(TransformComponent);\nuse(DatasetComponent);","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","exports.nextTick = function nextTick(fn) {\n var args = Array.prototype.slice.call(arguments);\n args.shift();\n setTimeout(function () {\n fn.apply(null, args);\n }, 0);\n};\n\nexports.platform = exports.arch = \nexports.execPath = exports.title = 'browser';\nexports.pid = 1;\nexports.browser = true;\nexports.env = {};\nexports.argv = [];\n\nexports.binding = function (name) {\n\tthrow new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n exports.cwd = function () { return cwd };\n exports.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\nexports.exit = exports.kill = \nexports.umask = exports.dlopen = \nexports.uptime = exports.memoryUsage = \nexports.uvCounters = function() {};\nexports.features = {};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","/*!\n * vuex v4.0.0\n * (c) 2021 Evan You\n * @license MIT\n */\nimport { inject, watch, reactive } from 'vue';\n\nvar storeKey = 'store';\n\nfunction useStore (key) {\n if ( key === void 0 ) key = null;\n\n return inject(key !== null ? key : storeKey)\n}\n\nvar target = typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\nvar devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\nfunction devtoolPlugin (store) {\n if (!devtoolHook) { return }\n\n store._devtoolHook = devtoolHook;\n\n devtoolHook.emit('vuex:init', store);\n\n devtoolHook.on('vuex:travel-to-state', function (targetState) {\n store.replaceState(targetState);\n });\n\n store.subscribe(function (mutation, state) {\n devtoolHook.emit('vuex:mutation', mutation, state);\n }, { prepend: true });\n\n store.subscribeAction(function (action, state) {\n devtoolHook.emit('vuex:action', action, state);\n }, { prepend: true });\n}\n\n/**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\nfunction find (list, f) {\n return list.filter(f)[0]\n}\n\n/**\n * Deep copy the given object considering circular structure.\n * This function caches all nested objects and its copies.\n * If it detects circular structure, use cached copy to avoid infinite loop.\n *\n * @param {*} obj\n * @param {Array<Object>} cache\n * @return {*}\n */\nfunction deepCopy (obj, cache) {\n if ( cache === void 0 ) cache = [];\n\n // just return if obj is immutable value\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // if obj is hit, it is in circular structure\n var hit = find(cache, function (c) { return c.original === obj; });\n if (hit) {\n return hit.copy\n }\n\n var copy = Array.isArray(obj) ? [] : {};\n // put the copy into cache at first\n // because we want to refer it in recursive deepCopy\n cache.push({\n original: obj,\n copy: copy\n });\n\n Object.keys(obj).forEach(function (key) {\n copy[key] = deepCopy(obj[key], cache);\n });\n\n return copy\n}\n\n/**\n * forEach for object\n */\nfunction forEachValue (obj, fn) {\n Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });\n}\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isPromise (val) {\n return val && typeof val.then === 'function'\n}\n\nfunction assert (condition, msg) {\n if (!condition) { throw new Error((\"[vuex] \" + msg)) }\n}\n\nfunction partial (fn, arg) {\n return function () {\n return fn(arg)\n }\n}\n\n// Base data struct for store's module, package with some attribute and method\nvar Module = function Module (rawModule, runtime) {\n this.runtime = runtime;\n // Store some children item\n this._children = Object.create(null);\n // Store the origin module object which passed by programmer\n this._rawModule = rawModule;\n var rawState = rawModule.state;\n\n // Store the origin module's state\n this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};\n};\n\nvar prototypeAccessors = { namespaced: { configurable: true } };\n\nprototypeAccessors.namespaced.get = function () {\n return !!this._rawModule.namespaced\n};\n\nModule.prototype.addChild = function addChild (key, module) {\n this._children[key] = module;\n};\n\nModule.prototype.removeChild = function removeChild (key) {\n delete this._children[key];\n};\n\nModule.prototype.getChild = function getChild (key) {\n return this._children[key]\n};\n\nModule.prototype.hasChild = function hasChild (key) {\n return key in this._children\n};\n\nModule.prototype.update = function update (rawModule) {\n this._rawModule.namespaced = rawModule.namespaced;\n if (rawModule.actions) {\n this._rawModule.actions = rawModule.actions;\n }\n if (rawModule.mutations) {\n this._rawModule.mutations = rawModule.mutations;\n }\n if (rawModule.getters) {\n this._rawModule.getters = rawModule.getters;\n }\n};\n\nModule.prototype.forEachChild = function forEachChild (fn) {\n forEachValue(this._children, fn);\n};\n\nModule.prototype.forEachGetter = function forEachGetter (fn) {\n if (this._rawModule.getters) {\n forEachValue(this._rawModule.getters, fn);\n }\n};\n\nModule.prototype.forEachAction = function forEachAction (fn) {\n if (this._rawModule.actions) {\n forEachValue(this._rawModule.actions, fn);\n }\n};\n\nModule.prototype.forEachMutation = function forEachMutation (fn) {\n if (this._rawModule.mutations) {\n forEachValue(this._rawModule.mutations, fn);\n }\n};\n\nObject.defineProperties( Module.prototype, prototypeAccessors );\n\nvar ModuleCollection = function ModuleCollection (rawRootModule) {\n // register root module (Vuex.Store options)\n this.register([], rawRootModule, false);\n};\n\nModuleCollection.prototype.get = function get (path) {\n return path.reduce(function (module, key) {\n return module.getChild(key)\n }, this.root)\n};\n\nModuleCollection.prototype.getNamespace = function getNamespace (path) {\n var module = this.root;\n return path.reduce(function (namespace, key) {\n module = module.getChild(key);\n return namespace + (module.namespaced ? key + '/' : '')\n }, '')\n};\n\nModuleCollection.prototype.update = function update$1 (rawRootModule) {\n update([], this.root, rawRootModule);\n};\n\nModuleCollection.prototype.register = function register (path, rawModule, runtime) {\n var this$1 = this;\n if ( runtime === void 0 ) runtime = true;\n\n {\n assertRawModule(path, rawModule);\n }\n\n var newModule = new Module(rawModule, runtime);\n if (path.length === 0) {\n this.root = newModule;\n } else {\n var parent = this.get(path.slice(0, -1));\n parent.addChild(path[path.length - 1], newModule);\n }\n\n // register nested modules\n if (rawModule.modules) {\n forEachValue(rawModule.modules, function (rawChildModule, key) {\n this$1.register(path.concat(key), rawChildModule, runtime);\n });\n }\n};\n\nModuleCollection.prototype.unregister = function unregister (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n var child = parent.getChild(key);\n\n if (!child) {\n {\n console.warn(\n \"[vuex] trying to unregister module '\" + key + \"', which is \" +\n \"not registered\"\n );\n }\n return\n }\n\n if (!child.runtime) {\n return\n }\n\n parent.removeChild(key);\n};\n\nModuleCollection.prototype.isRegistered = function isRegistered (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n\n if (parent) {\n return parent.hasChild(key)\n }\n\n return false\n};\n\nfunction update (path, targetModule, newModule) {\n {\n assertRawModule(path, newModule);\n }\n\n // update target module\n targetModule.update(newModule);\n\n // update nested modules\n if (newModule.modules) {\n for (var key in newModule.modules) {\n if (!targetModule.getChild(key)) {\n {\n console.warn(\n \"[vuex] trying to add a new module '\" + key + \"' on hot reloading, \" +\n 'manual reload is needed'\n );\n }\n return\n }\n update(\n path.concat(key),\n targetModule.getChild(key),\n newModule.modules[key]\n );\n }\n }\n}\n\nvar functionAssert = {\n assert: function (value) { return typeof value === 'function'; },\n expected: 'function'\n};\n\nvar objectAssert = {\n assert: function (value) { return typeof value === 'function' ||\n (typeof value === 'object' && typeof value.handler === 'function'); },\n expected: 'function or object with \"handler\" function'\n};\n\nvar assertTypes = {\n getters: functionAssert,\n mutations: functionAssert,\n actions: objectAssert\n};\n\nfunction assertRawModule (path, rawModule) {\n Object.keys(assertTypes).forEach(function (key) {\n if (!rawModule[key]) { return }\n\n var assertOptions = assertTypes[key];\n\n forEachValue(rawModule[key], function (value, type) {\n assert(\n assertOptions.assert(value),\n makeAssertionMessage(path, key, type, value, assertOptions.expected)\n );\n });\n });\n}\n\nfunction makeAssertionMessage (path, key, type, value, expected) {\n var buf = key + \" should be \" + expected + \" but \\\"\" + key + \".\" + type + \"\\\"\";\n if (path.length > 0) {\n buf += \" in module \\\"\" + (path.join('.')) + \"\\\"\";\n }\n buf += \" is \" + (JSON.stringify(value)) + \".\";\n return buf\n}\n\nfunction createStore (options) {\n return new Store(options)\n}\n\nvar Store = function Store (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n {\n assert(typeof Promise !== 'undefined', \"vuex requires a Promise polyfill in this browser.\");\n assert(this instanceof Store, \"store must be called with the new operator.\");\n }\n\n var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];\n var strict = options.strict; if ( strict === void 0 ) strict = false;\n\n // store internal state\n this._committing = false;\n this._actions = Object.create(null);\n this._actionSubscribers = [];\n this._mutations = Object.create(null);\n this._wrappedGetters = Object.create(null);\n this._modules = new ModuleCollection(options);\n this._modulesNamespaceMap = Object.create(null);\n this._subscribers = [];\n this._makeLocalGettersCache = Object.create(null);\n\n // bind commit and dispatch to self\n var store = this;\n var ref = this;\n var dispatch = ref.dispatch;\n var commit = ref.commit;\n this.dispatch = function boundDispatch (type, payload) {\n return dispatch.call(store, type, payload)\n };\n this.commit = function boundCommit (type, payload, options) {\n return commit.call(store, type, payload, options)\n };\n\n // strict mode\n this.strict = strict;\n\n var state = this._modules.root.state;\n\n // init root module.\n // this also recursively registers all sub-modules\n // and collects all module getters inside this._wrappedGetters\n installModule(this, state, [], this._modules.root);\n\n // initialize the store state, which is responsible for the reactivity\n // (also registers _wrappedGetters as computed properties)\n resetStoreState(this, state);\n\n // apply plugins\n plugins.forEach(function (plugin) { return plugin(this$1); });\n\n var useDevtools = options.devtools !== undefined ? options.devtools : /* Vue.config.devtools */ true;\n if (useDevtools) {\n devtoolPlugin(this);\n }\n};\n\nvar prototypeAccessors$1 = { state: { configurable: true } };\n\nStore.prototype.install = function install (app, injectKey) {\n app.provide(injectKey || storeKey, this);\n app.config.globalProperties.$store = this;\n};\n\nprototypeAccessors$1.state.get = function () {\n return this._state.data\n};\n\nprototypeAccessors$1.state.set = function (v) {\n {\n assert(false, \"use store.replaceState() to explicit replace store state.\");\n }\n};\n\nStore.prototype.commit = function commit (_type, _payload, _options) {\n var this$1 = this;\n\n // check object-style commit\n var ref = unifyObjectStyle(_type, _payload, _options);\n var type = ref.type;\n var payload = ref.payload;\n var options = ref.options;\n\n var mutation = { type: type, payload: payload };\n var entry = this._mutations[type];\n if (!entry) {\n {\n console.error((\"[vuex] unknown mutation type: \" + type));\n }\n return\n }\n this._withCommit(function () {\n entry.forEach(function commitIterator (handler) {\n handler(payload);\n });\n });\n\n this._subscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .forEach(function (sub) { return sub(mutation, this$1.state); });\n\n if (\n \n options && options.silent\n ) {\n console.warn(\n \"[vuex] mutation type: \" + type + \". Silent option has been removed. \" +\n 'Use the filter functionality in the vue-devtools'\n );\n }\n};\n\nStore.prototype.dispatch = function dispatch (_type, _payload) {\n var this$1 = this;\n\n // check object-style dispatch\n var ref = unifyObjectStyle(_type, _payload);\n var type = ref.type;\n var payload = ref.payload;\n\n var action = { type: type, payload: payload };\n var entry = this._actions[type];\n if (!entry) {\n {\n console.error((\"[vuex] unknown action type: \" + type));\n }\n return\n }\n\n try {\n this._actionSubscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .filter(function (sub) { return sub.before; })\n .forEach(function (sub) { return sub.before(action, this$1.state); });\n } catch (e) {\n {\n console.warn(\"[vuex] error in before action subscribers: \");\n console.error(e);\n }\n }\n\n var result = entry.length > 1\n ? Promise.all(entry.map(function (handler) { return handler(payload); }))\n : entry[0](payload);\n\n return new Promise(function (resolve, reject) {\n result.then(function (res) {\n try {\n this$1._actionSubscribers\n .filter(function (sub) { return sub.after; })\n .forEach(function (sub) { return sub.after(action, this$1.state); });\n } catch (e) {\n {\n console.warn(\"[vuex] error in after action subscribers: \");\n console.error(e);\n }\n }\n resolve(res);\n }, function (error) {\n try {\n this$1._actionSubscribers\n .filter(function (sub) { return sub.error; })\n .forEach(function (sub) { return sub.error(action, this$1.state, error); });\n } catch (e) {\n {\n console.warn(\"[vuex] error in error action subscribers: \");\n console.error(e);\n }\n }\n reject(error);\n });\n })\n};\n\nStore.prototype.subscribe = function subscribe (fn, options) {\n return genericSubscribe(fn, this._subscribers, options)\n};\n\nStore.prototype.subscribeAction = function subscribeAction (fn, options) {\n var subs = typeof fn === 'function' ? { before: fn } : fn;\n return genericSubscribe(subs, this._actionSubscribers, options)\n};\n\nStore.prototype.watch = function watch$1 (getter, cb, options) {\n var this$1 = this;\n\n {\n assert(typeof getter === 'function', \"store.watch only accepts a function.\");\n }\n return watch(function () { return getter(this$1.state, this$1.getters); }, cb, Object.assign({}, options))\n};\n\nStore.prototype.replaceState = function replaceState (state) {\n var this$1 = this;\n\n this._withCommit(function () {\n this$1._state.data = state;\n });\n};\n\nStore.prototype.registerModule = function registerModule (path, rawModule, options) {\n if ( options === void 0 ) options = {};\n\n if (typeof path === 'string') { path = [path]; }\n\n {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n assert(path.length > 0, 'cannot register the root module by using registerModule.');\n }\n\n this._modules.register(path, rawModule);\n installModule(this, this.state, path, this._modules.get(path), options.preserveState);\n // reset store to update getters...\n resetStoreState(this, this.state);\n};\n\nStore.prototype.unregisterModule = function unregisterModule (path) {\n var this$1 = this;\n\n if (typeof path === 'string') { path = [path]; }\n\n {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n this._modules.unregister(path);\n this._withCommit(function () {\n var parentState = getNestedState(this$1.state, path.slice(0, -1));\n delete parentState[path[path.length - 1]];\n });\n resetStore(this);\n};\n\nStore.prototype.hasModule = function hasModule (path) {\n if (typeof path === 'string') { path = [path]; }\n\n {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n return this._modules.isRegistered(path)\n};\n\nStore.prototype.hotUpdate = function hotUpdate (newOptions) {\n this._modules.update(newOptions);\n resetStore(this, true);\n};\n\nStore.prototype._withCommit = function _withCommit (fn) {\n var committing = this._committing;\n this._committing = true;\n fn();\n this._committing = committing;\n};\n\nObject.defineProperties( Store.prototype, prototypeAccessors$1 );\n\nfunction genericSubscribe (fn, subs, options) {\n if (subs.indexOf(fn) < 0) {\n options && options.prepend\n ? subs.unshift(fn)\n : subs.push(fn);\n }\n return function () {\n var i = subs.indexOf(fn);\n if (i > -1) {\n subs.splice(i, 1);\n }\n }\n}\n\nfunction resetStore (store, hot) {\n store._actions = Object.create(null);\n store._mutations = Object.create(null);\n store._wrappedGetters = Object.create(null);\n store._modulesNamespaceMap = Object.create(null);\n var state = store.state;\n // init all modules\n installModule(store, state, [], store._modules.root, true);\n // reset state\n resetStoreState(store, state, hot);\n}\n\nfunction resetStoreState (store, state, hot) {\n var oldState = store._state;\n\n // bind store public getters\n store.getters = {};\n // reset local getters cache\n store._makeLocalGettersCache = Object.create(null);\n var wrappedGetters = store._wrappedGetters;\n var computedObj = {};\n forEachValue(wrappedGetters, function (fn, key) {\n // use computed to leverage its lazy-caching mechanism\n // direct inline function use will lead to closure preserving oldState.\n // using partial to return function with only arguments preserved in closure environment.\n computedObj[key] = partial(fn, store);\n Object.defineProperty(store.getters, key, {\n // TODO: use `computed` when it's possible. at the moment we can't due to\n // https://github.com/vuejs/vuex/pull/1883\n get: function () { return computedObj[key](); },\n enumerable: true // for local getters\n });\n });\n\n store._state = reactive({\n data: state\n });\n\n // enable strict mode for new state\n if (store.strict) {\n enableStrictMode(store);\n }\n\n if (oldState) {\n if (hot) {\n // dispatch changes in all subscribed watchers\n // to force getter re-evaluation for hot reloading.\n store._withCommit(function () {\n oldState.data = null;\n });\n }\n }\n}\n\nfunction installModule (store, rootState, path, module, hot) {\n var isRoot = !path.length;\n var namespace = store._modules.getNamespace(path);\n\n // register in namespace map\n if (module.namespaced) {\n if (store._modulesNamespaceMap[namespace] && true) {\n console.error((\"[vuex] duplicate namespace \" + namespace + \" for the namespaced module \" + (path.join('/'))));\n }\n store._modulesNamespaceMap[namespace] = module;\n }\n\n // set state\n if (!isRoot && !hot) {\n var parentState = getNestedState(rootState, path.slice(0, -1));\n var moduleName = path[path.length - 1];\n store._withCommit(function () {\n {\n if (moduleName in parentState) {\n console.warn(\n (\"[vuex] state field \\\"\" + moduleName + \"\\\" was overridden by a module with the same name at \\\"\" + (path.join('.')) + \"\\\"\")\n );\n }\n }\n parentState[moduleName] = module.state;\n });\n }\n\n var local = module.context = makeLocalContext(store, namespace, path);\n\n module.forEachMutation(function (mutation, key) {\n var namespacedType = namespace + key;\n registerMutation(store, namespacedType, mutation, local);\n });\n\n module.forEachAction(function (action, key) {\n var type = action.root ? key : namespace + key;\n var handler = action.handler || action;\n registerAction(store, type, handler, local);\n });\n\n module.forEachGetter(function (getter, key) {\n var namespacedType = namespace + key;\n registerGetter(store, namespacedType, getter, local);\n });\n\n module.forEachChild(function (child, key) {\n installModule(store, rootState, path.concat(key), child, hot);\n });\n}\n\n/**\n * make localized dispatch, commit, getters and state\n * if there is no namespace, just use root ones\n */\nfunction makeLocalContext (store, namespace, path) {\n var noNamespace = namespace === '';\n\n var local = {\n dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ( !store._actions[type]) {\n console.error((\"[vuex] unknown local action type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n return store.dispatch(type, payload)\n },\n\n commit: noNamespace ? store.commit : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ( !store._mutations[type]) {\n console.error((\"[vuex] unknown local mutation type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n store.commit(type, payload, options);\n }\n };\n\n // getters and state object must be gotten lazily\n // because they will be changed by state update\n Object.defineProperties(local, {\n getters: {\n get: noNamespace\n ? function () { return store.getters; }\n : function () { return makeLocalGetters(store, namespace); }\n },\n state: {\n get: function () { return getNestedState(store.state, path); }\n }\n });\n\n return local\n}\n\nfunction makeLocalGetters (store, namespace) {\n if (!store._makeLocalGettersCache[namespace]) {\n var gettersProxy = {};\n var splitPos = namespace.length;\n Object.keys(store.getters).forEach(function (type) {\n // skip if the target getter is not match this namespace\n if (type.slice(0, splitPos) !== namespace) { return }\n\n // extract local getter type\n var localType = type.slice(splitPos);\n\n // Add a port to the getters proxy.\n // Define as getter property because\n // we do not want to evaluate the getters in this time.\n Object.defineProperty(gettersProxy, localType, {\n get: function () { return store.getters[type]; },\n enumerable: true\n });\n });\n store._makeLocalGettersCache[namespace] = gettersProxy;\n }\n\n return store._makeLocalGettersCache[namespace]\n}\n\nfunction registerMutation (store, type, handler, local) {\n var entry = store._mutations[type] || (store._mutations[type] = []);\n entry.push(function wrappedMutationHandler (payload) {\n handler.call(store, local.state, payload);\n });\n}\n\nfunction registerAction (store, type, handler, local) {\n var entry = store._actions[type] || (store._actions[type] = []);\n entry.push(function wrappedActionHandler (payload) {\n var res = handler.call(store, {\n dispatch: local.dispatch,\n commit: local.commit,\n getters: local.getters,\n state: local.state,\n rootGetters: store.getters,\n rootState: store.state\n }, payload);\n if (!isPromise(res)) {\n res = Promise.resolve(res);\n }\n if (store._devtoolHook) {\n return res.catch(function (err) {\n store._devtoolHook.emit('vuex:error', err);\n throw err\n })\n } else {\n return res\n }\n });\n}\n\nfunction registerGetter (store, type, rawGetter, local) {\n if (store._wrappedGetters[type]) {\n {\n console.error((\"[vuex] duplicate getter key: \" + type));\n }\n return\n }\n store._wrappedGetters[type] = function wrappedGetter (store) {\n return rawGetter(\n local.state, // local state\n local.getters, // local getters\n store.state, // root state\n store.getters // root getters\n )\n };\n}\n\nfunction enableStrictMode (store) {\n watch(function () { return store._state.data; }, function () {\n {\n assert(store._committing, \"do not mutate vuex store state outside mutation handlers.\");\n }\n }, { deep: true, flush: 'sync' });\n}\n\nfunction getNestedState (state, path) {\n return path.reduce(function (state, key) { return state[key]; }, state)\n}\n\nfunction unifyObjectStyle (type, payload, options) {\n if (isObject(type) && type.type) {\n options = payload;\n payload = type;\n type = type.type;\n }\n\n {\n assert(typeof type === 'string', (\"expects string as the type, but found \" + (typeof type) + \".\"));\n }\n\n return { type: type, payload: payload, options: options }\n}\n\n/**\n * Reduce the code which written in Vue.js for getting the state.\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.\n * @param {Object}\n */\nvar mapState = normalizeNamespace(function (namespace, states) {\n var res = {};\n if ( !isValidMap(states)) {\n console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(states).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedState () {\n var state = this.$store.state;\n var getters = this.$store.getters;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapState', namespace);\n if (!module) {\n return\n }\n state = module.context.state;\n getters = module.context.getters;\n }\n return typeof val === 'function'\n ? val.call(this, state, getters)\n : state[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for committing the mutation\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapMutations = normalizeNamespace(function (namespace, mutations) {\n var res = {};\n if ( !isValidMap(mutations)) {\n console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(mutations).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedMutation () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // Get the commit method from store\n var commit = this.$store.commit;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);\n if (!module) {\n return\n }\n commit = module.context.commit;\n }\n return typeof val === 'function'\n ? val.apply(this, [commit].concat(args))\n : commit.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for getting the getters\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} getters\n * @return {Object}\n */\nvar mapGetters = normalizeNamespace(function (namespace, getters) {\n var res = {};\n if ( !isValidMap(getters)) {\n console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(getters).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n // The namespace has been mutated by normalizeNamespace\n val = namespace + val;\n res[key] = function mappedGetter () {\n if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {\n return\n }\n if ( !(val in this.$store.getters)) {\n console.error((\"[vuex] unknown getter: \" + val));\n return\n }\n return this.$store.getters[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for dispatch the action\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapActions = normalizeNamespace(function (namespace, actions) {\n var res = {};\n if ( !isValidMap(actions)) {\n console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(actions).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedAction () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // get dispatch function from store\n var dispatch = this.$store.dispatch;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapActions', namespace);\n if (!module) {\n return\n }\n dispatch = module.context.dispatch;\n }\n return typeof val === 'function'\n ? val.apply(this, [dispatch].concat(args))\n : dispatch.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object\n * @param {String} namespace\n * @return {Object}\n */\nvar createNamespacedHelpers = function (namespace) { return ({\n mapState: mapState.bind(null, namespace),\n mapGetters: mapGetters.bind(null, namespace),\n mapMutations: mapMutations.bind(null, namespace),\n mapActions: mapActions.bind(null, namespace)\n}); };\n\n/**\n * Normalize the map\n * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]\n * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]\n * @param {Array|Object} map\n * @return {Object}\n */\nfunction normalizeMap (map) {\n if (!isValidMap(map)) {\n return []\n }\n return Array.isArray(map)\n ? map.map(function (key) { return ({ key: key, val: key }); })\n : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })\n}\n\n/**\n * Validate whether given map is valid or not\n * @param {*} map\n * @return {Boolean}\n */\nfunction isValidMap (map) {\n return Array.isArray(map) || isObject(map)\n}\n\n/**\n * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.\n * @param {Function} fn\n * @return {Function}\n */\nfunction normalizeNamespace (fn) {\n return function (namespace, map) {\n if (typeof namespace !== 'string') {\n map = namespace;\n namespace = '';\n } else if (namespace.charAt(namespace.length - 1) !== '/') {\n namespace += '/';\n }\n return fn(namespace, map)\n }\n}\n\n/**\n * Search a special module from store by namespace. if module not exist, print error message.\n * @param {Object} store\n * @param {String} helper\n * @param {String} namespace\n * @return {Object}\n */\nfunction getModuleByNamespace (store, helper, namespace) {\n var module = store._modulesNamespaceMap[namespace];\n if ( !module) {\n console.error((\"[vuex] module namespace not found in \" + helper + \"(): \" + namespace));\n }\n return module\n}\n\n// Credits: borrowed code from fcomb/redux-logger\n\nfunction createLogger (ref) {\n if ( ref === void 0 ) ref = {};\n var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;\n var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };\n var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };\n var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };\n var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };\n var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };\n var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;\n var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;\n var logger = ref.logger; if ( logger === void 0 ) logger = console;\n\n return function (store) {\n var prevState = deepCopy(store.state);\n\n if (typeof logger === 'undefined') {\n return\n }\n\n if (logMutations) {\n store.subscribe(function (mutation, state) {\n var nextState = deepCopy(state);\n\n if (filter(mutation, prevState, nextState)) {\n var formattedTime = getFormattedTime();\n var formattedMutation = mutationTransformer(mutation);\n var message = \"mutation \" + (mutation.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));\n logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);\n logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));\n endMessage(logger);\n }\n\n prevState = nextState;\n });\n }\n\n if (logActions) {\n store.subscribeAction(function (action, state) {\n if (actionFilter(action, state)) {\n var formattedTime = getFormattedTime();\n var formattedAction = actionTransformer(action);\n var message = \"action \" + (action.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);\n endMessage(logger);\n }\n });\n }\n }\n}\n\nfunction startMessage (logger, message, collapsed) {\n var startMessage = collapsed\n ? logger.groupCollapsed\n : logger.group;\n\n // render\n try {\n startMessage.call(logger, message);\n } catch (e) {\n logger.log(message);\n }\n}\n\nfunction endMessage (logger) {\n try {\n logger.groupEnd();\n } catch (e) {\n logger.log('—— log end ——');\n }\n}\n\nfunction getFormattedTime () {\n var time = new Date();\n return (\" @ \" + (pad(time.getHours(), 2)) + \":\" + (pad(time.getMinutes(), 2)) + \":\" + (pad(time.getSeconds(), 2)) + \".\" + (pad(time.getMilliseconds(), 3)))\n}\n\nfunction repeat (str, times) {\n return (new Array(times + 1)).join(str)\n}\n\nfunction pad (num, maxLength) {\n return repeat('0', maxLength - num.toString().length) + num\n}\n\nvar index = {\n version: '4.0.0',\n Store: Store,\n storeKey: storeKey,\n createStore: createStore,\n useStore: useStore,\n mapState: mapState,\n mapMutations: mapMutations,\n mapGetters: mapGetters,\n mapActions: mapActions,\n createNamespacedHelpers: createNamespacedHelpers,\n createLogger: createLogger\n};\n\nexport default index;\nexport { Store, createLogger, createNamespacedHelpers, createStore, mapActions, mapGetters, mapMutations, mapState, storeKey, useStore };\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","import { EMPTY_OBJ, isArray, isMap, isIntegerKey, isSymbol, extend, hasOwn, isObject, hasChanged, makeMap, capitalize, toRawType, def, isFunction, NOOP } from '@vue/shared';\n\nconst targetMap = new WeakMap();\r\nconst effectStack = [];\r\nlet activeEffect;\r\nconst ITERATE_KEY = Symbol((process.env.NODE_ENV !== 'production') ? 'iterate' : '');\r\nconst MAP_KEY_ITERATE_KEY = Symbol((process.env.NODE_ENV !== 'production') ? 'Map key iterate' : '');\r\nfunction isEffect(fn) {\r\n return fn && fn._isEffect === true;\r\n}\r\nfunction effect(fn, options = EMPTY_OBJ) {\r\n if (isEffect(fn)) {\r\n fn = fn.raw;\r\n }\r\n const effect = createReactiveEffect(fn, options);\r\n if (!options.lazy) {\r\n effect();\r\n }\r\n return effect;\r\n}\r\nfunction stop(effect) {\r\n if (effect.active) {\r\n cleanup(effect);\r\n if (effect.options.onStop) {\r\n effect.options.onStop();\r\n }\r\n effect.active = false;\r\n }\r\n}\r\nlet uid = 0;\r\nfunction createReactiveEffect(fn, options) {\r\n const effect = function reactiveEffect() {\r\n if (!effect.active) {\r\n return options.scheduler ? undefined : fn();\r\n }\r\n if (!effectStack.includes(effect)) {\r\n cleanup(effect);\r\n try {\r\n enableTracking();\r\n effectStack.push(effect);\r\n activeEffect = effect;\r\n return fn();\r\n }\r\n finally {\r\n effectStack.pop();\r\n resetTracking();\r\n activeEffect = effectStack[effectStack.length - 1];\r\n }\r\n }\r\n };\r\n effect.id = uid++;\r\n effect.allowRecurse = !!options.allowRecurse;\r\n effect._isEffect = true;\r\n effect.active = true;\r\n effect.raw = fn;\r\n effect.deps = [];\r\n effect.options = options;\r\n return effect;\r\n}\r\nfunction cleanup(effect) {\r\n const { deps } = effect;\r\n if (deps.length) {\r\n for (let i = 0; i < deps.length; i++) {\r\n deps[i].delete(effect);\r\n }\r\n deps.length = 0;\r\n }\r\n}\r\nlet shouldTrack = true;\r\nconst trackStack = [];\r\nfunction pauseTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = false;\r\n}\r\nfunction enableTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = true;\r\n}\r\nfunction resetTracking() {\r\n const last = trackStack.pop();\r\n shouldTrack = last === undefined ? true : last;\r\n}\r\nfunction track(target, type, key) {\r\n if (!shouldTrack || activeEffect === undefined) {\r\n return;\r\n }\r\n let depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n targetMap.set(target, (depsMap = new Map()));\r\n }\r\n let dep = depsMap.get(key);\r\n if (!dep) {\r\n depsMap.set(key, (dep = new Set()));\r\n }\r\n if (!dep.has(activeEffect)) {\r\n dep.add(activeEffect);\r\n activeEffect.deps.push(dep);\r\n if ((process.env.NODE_ENV !== 'production') && activeEffect.options.onTrack) {\r\n activeEffect.options.onTrack({\r\n effect: activeEffect,\r\n target,\r\n type,\r\n key\r\n });\r\n }\r\n }\r\n}\r\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\r\n const depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n // never been tracked\r\n return;\r\n }\r\n const effects = new Set();\r\n const add = (effectsToAdd) => {\r\n if (effectsToAdd) {\r\n effectsToAdd.forEach(effect => {\r\n if (effect !== activeEffect || effect.allowRecurse) {\r\n effects.add(effect);\r\n }\r\n });\r\n }\r\n };\r\n if (type === \"clear\" /* CLEAR */) {\r\n // collection being cleared\r\n // trigger all effects for target\r\n depsMap.forEach(add);\r\n }\r\n else if (key === 'length' && isArray(target)) {\r\n depsMap.forEach((dep, key) => {\r\n if (key === 'length' || key >= newValue) {\r\n add(dep);\r\n }\r\n });\r\n }\r\n else {\r\n // schedule runs for SET | ADD | DELETE\r\n if (key !== void 0) {\r\n add(depsMap.get(key));\r\n }\r\n // also run for iteration key on ADD | DELETE | Map.SET\r\n switch (type) {\r\n case \"add\" /* ADD */:\r\n if (!isArray(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n add(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n else if (isIntegerKey(key)) {\r\n // new index added to array -> length changes\r\n add(depsMap.get('length'));\r\n }\r\n break;\r\n case \"delete\" /* DELETE */:\r\n if (!isArray(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n add(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n break;\r\n case \"set\" /* SET */:\r\n if (isMap(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n }\r\n break;\r\n }\r\n }\r\n const run = (effect) => {\r\n if ((process.env.NODE_ENV !== 'production') && effect.options.onTrigger) {\r\n effect.options.onTrigger({\r\n effect,\r\n target,\r\n key,\r\n type,\r\n newValue,\r\n oldValue,\r\n oldTarget\r\n });\r\n }\r\n if (effect.options.scheduler) {\r\n effect.options.scheduler(effect);\r\n }\r\n else {\r\n effect();\r\n }\r\n };\r\n effects.forEach(run);\r\n}\n\nconst isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);\r\nconst builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\r\n .map(key => Symbol[key])\r\n .filter(isSymbol));\r\nconst get = /*#__PURE__*/ createGetter();\r\nconst shallowGet = /*#__PURE__*/ createGetter(false, true);\r\nconst readonlyGet = /*#__PURE__*/ createGetter(true);\r\nconst shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\r\nconst arrayInstrumentations = {};\r\n['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\r\n const method = Array.prototype[key];\r\n arrayInstrumentations[key] = function (...args) {\r\n const arr = toRaw(this);\r\n for (let i = 0, l = this.length; i < l; i++) {\r\n track(arr, \"get\" /* GET */, i + '');\r\n }\r\n // we run the method using the original args first (which may be reactive)\r\n const res = method.apply(arr, args);\r\n if (res === -1 || res === false) {\r\n // if that didn't work, run it again using raw values.\r\n return method.apply(arr, args.map(toRaw));\r\n }\r\n else {\r\n return res;\r\n }\r\n };\r\n});\r\n['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\r\n const method = Array.prototype[key];\r\n arrayInstrumentations[key] = function (...args) {\r\n pauseTracking();\r\n const res = method.apply(this, args);\r\n resetTracking();\r\n return res;\r\n };\r\n});\r\nfunction createGetter(isReadonly = false, shallow = false) {\r\n return function get(target, key, receiver) {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */ &&\r\n receiver ===\r\n (isReadonly\r\n ? shallow\r\n ? shallowReadonlyMap\r\n : readonlyMap\r\n : shallow\r\n ? shallowReactiveMap\r\n : reactiveMap).get(target)) {\r\n return target;\r\n }\r\n const targetIsArray = isArray(target);\r\n if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\r\n return Reflect.get(arrayInstrumentations, key, receiver);\r\n }\r\n const res = Reflect.get(target, key, receiver);\r\n if (isSymbol(key)\r\n ? builtInSymbols.has(key)\r\n : isNonTrackableKeys(key)) {\r\n return res;\r\n }\r\n if (!isReadonly) {\r\n track(target, \"get\" /* GET */, key);\r\n }\r\n if (shallow) {\r\n return res;\r\n }\r\n if (isRef(res)) {\r\n // ref unwrapping - does not apply for Array + integer key.\r\n const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\r\n return shouldUnwrap ? res.value : res;\r\n }\r\n if (isObject(res)) {\r\n // Convert returned value into a proxy as well. we do the isObject check\r\n // here to avoid invalid value warning. Also need to lazy access readonly\r\n // and reactive here to avoid circular dependency.\r\n return isReadonly ? readonly(res) : reactive(res);\r\n }\r\n return res;\r\n };\r\n}\r\nconst set = /*#__PURE__*/ createSetter();\r\nconst shallowSet = /*#__PURE__*/ createSetter(true);\r\nfunction createSetter(shallow = false) {\r\n return function set(target, key, value, receiver) {\r\n let oldValue = target[key];\r\n if (!shallow) {\r\n value = toRaw(value);\r\n oldValue = toRaw(oldValue);\r\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n }\r\n const hadKey = isArray(target) && isIntegerKey(key)\r\n ? Number(key) < target.length\r\n : hasOwn(target, key);\r\n const result = Reflect.set(target, key, value, receiver);\r\n // don't trigger if target is something up in the prototype chain of original\r\n if (target === toRaw(receiver)) {\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n }\r\n return result;\r\n };\r\n}\r\nfunction deleteProperty(target, key) {\r\n const hadKey = hasOwn(target, key);\r\n const oldValue = target[key];\r\n const result = Reflect.deleteProperty(target, key);\r\n if (result && hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction has(target, key) {\r\n const result = Reflect.has(target, key);\r\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\r\n track(target, \"has\" /* HAS */, key);\r\n }\r\n return result;\r\n}\r\nfunction ownKeys(target) {\r\n track(target, \"iterate\" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);\r\n return Reflect.ownKeys(target);\r\n}\r\nconst mutableHandlers = {\r\n get,\r\n set,\r\n deleteProperty,\r\n has,\r\n ownKeys\r\n};\r\nconst readonlyHandlers = {\r\n get: readonlyGet,\r\n set(target, key) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\r\n }\r\n return true;\r\n },\r\n deleteProperty(target, key) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\r\n }\r\n return true;\r\n }\r\n};\r\nconst shallowReactiveHandlers = extend({}, mutableHandlers, {\r\n get: shallowGet,\r\n set: shallowSet\r\n});\r\n// Props handlers are special in the sense that it should not unwrap top-level\r\n// refs (in order to allow refs to be explicitly passed down), but should\r\n// retain the reactivity of the normal readonly object.\r\nconst shallowReadonlyHandlers = extend({}, readonlyHandlers, {\r\n get: shallowReadonlyGet\r\n});\n\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\r\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\r\nconst toShallow = (value) => value;\r\nconst getProto = (v) => Reflect.getPrototypeOf(v);\r\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\r\n // #1772: readonly(reactive(Map)) should return readonly + reactive version\r\n // of the value\r\n target = target[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const rawKey = toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, rawKey);\r\n const { has } = getProto(rawTarget);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n if (has.call(rawTarget, key)) {\r\n return wrap(target.get(key));\r\n }\r\n else if (has.call(rawTarget, rawKey)) {\r\n return wrap(target.get(rawKey));\r\n }\r\n}\r\nfunction has$1(key, isReadonly = false) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const rawKey = toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, rawKey);\r\n return key === rawKey\r\n ? target.has(key)\r\n : target.has(key) || target.has(rawKey);\r\n}\r\nfunction size(target, isReadonly = false) {\r\n target = target[\"__v_raw\" /* RAW */];\r\n !isReadonly && track(toRaw(target), \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return Reflect.get(target, 'size', target);\r\n}\r\nfunction add(value) {\r\n value = toRaw(value);\r\n const target = toRaw(this);\r\n const proto = getProto(target);\r\n const hadKey = proto.has.call(target, value);\r\n if (!hadKey) {\r\n target.add(value);\r\n trigger(target, \"add\" /* ADD */, value, value);\r\n }\r\n return this;\r\n}\r\nfunction set$1(key, value) {\r\n value = toRaw(value);\r\n const target = toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n checkIdentityKeys(target, has, key);\r\n }\r\n const oldValue = get.call(target, key);\r\n target.set(key, value);\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n return this;\r\n}\r\nfunction deleteEntry(key) {\r\n const target = toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n checkIdentityKeys(target, has, key);\r\n }\r\n const oldValue = get ? get.call(target, key) : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.delete(key);\r\n if (hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction clear() {\r\n const target = toRaw(this);\r\n const hadItems = target.size !== 0;\r\n const oldTarget = (process.env.NODE_ENV !== 'production')\r\n ? isMap(target)\r\n ? new Map(target)\r\n : new Set(target)\r\n : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.clear();\r\n if (hadItems) {\r\n trigger(target, \"clear\" /* CLEAR */, undefined, undefined, oldTarget);\r\n }\r\n return result;\r\n}\r\nfunction createForEach(isReadonly, isShallow) {\r\n return function forEach(callback, thisArg) {\r\n const observed = this;\r\n const target = observed[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n !isReadonly && track(rawTarget, \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return target.forEach((value, key) => {\r\n // important: make sure the callback is\r\n // 1. invoked with the reactive map as `this` and 3rd arg\r\n // 2. the value received should be a corresponding reactive/readonly.\r\n return callback.call(thisArg, wrap(value), wrap(key), observed);\r\n });\r\n };\r\n}\r\nfunction createIterableMethod(method, isReadonly, isShallow) {\r\n return function (...args) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const targetIsMap = isMap(rawTarget);\r\n const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);\r\n const isKeyOnly = method === 'keys' && targetIsMap;\r\n const innerIterator = target[method](...args);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n !isReadonly &&\r\n track(rawTarget, \"iterate\" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\r\n // return a wrapped iterator which returns observed versions of the\r\n // values emitted from the real iterator\r\n return {\r\n // iterator protocol\r\n next() {\r\n const { value, done } = innerIterator.next();\r\n return done\r\n ? { value, done }\r\n : {\r\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\r\n done\r\n };\r\n },\r\n // iterable protocol\r\n [Symbol.iterator]() {\r\n return this;\r\n }\r\n };\r\n };\r\n}\r\nfunction createReadonlyMethod(type) {\r\n return function (...args) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\r\n console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));\r\n }\r\n return type === \"delete\" /* DELETE */ ? false : this;\r\n };\r\n}\r\nconst mutableInstrumentations = {\r\n get(key) {\r\n return get$1(this, key);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, false)\r\n};\r\nconst shallowInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, false, true);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, true)\r\n};\r\nconst readonlyInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, true);\r\n },\r\n get size() {\r\n return size(this, true);\r\n },\r\n has(key) {\r\n return has$1.call(this, key, true);\r\n },\r\n add: createReadonlyMethod(\"add\" /* ADD */),\r\n set: createReadonlyMethod(\"set\" /* SET */),\r\n delete: createReadonlyMethod(\"delete\" /* DELETE */),\r\n clear: createReadonlyMethod(\"clear\" /* CLEAR */),\r\n forEach: createForEach(true, false)\r\n};\r\nconst shallowReadonlyInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, true, true);\r\n },\r\n get size() {\r\n return size(this, true);\r\n },\r\n has(key) {\r\n return has$1.call(this, key, true);\r\n },\r\n add: createReadonlyMethod(\"add\" /* ADD */),\r\n set: createReadonlyMethod(\"set\" /* SET */),\r\n delete: createReadonlyMethod(\"delete\" /* DELETE */),\r\n clear: createReadonlyMethod(\"clear\" /* CLEAR */),\r\n forEach: createForEach(true, true)\r\n};\r\nconst iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\r\niteratorMethods.forEach(method => {\r\n mutableInstrumentations[method] = createIterableMethod(method, false, false);\r\n readonlyInstrumentations[method] = createIterableMethod(method, true, false);\r\n shallowInstrumentations[method] = createIterableMethod(method, false, true);\r\n shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);\r\n});\r\nfunction createInstrumentationGetter(isReadonly, shallow) {\r\n const instrumentations = shallow\r\n ? isReadonly\r\n ? shallowReadonlyInstrumentations\r\n : shallowInstrumentations\r\n : isReadonly\r\n ? readonlyInstrumentations\r\n : mutableInstrumentations;\r\n return (target, key, receiver) => {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */) {\r\n return target;\r\n }\r\n return Reflect.get(hasOwn(instrumentations, key) && key in target\r\n ? instrumentations\r\n : target, key, receiver);\r\n };\r\n}\r\nconst mutableCollectionHandlers = {\r\n get: createInstrumentationGetter(false, false)\r\n};\r\nconst shallowCollectionHandlers = {\r\n get: createInstrumentationGetter(false, true)\r\n};\r\nconst readonlyCollectionHandlers = {\r\n get: createInstrumentationGetter(true, false)\r\n};\r\nconst shallowReadonlyCollectionHandlers = {\r\n get: createInstrumentationGetter(true, true)\r\n};\r\nfunction checkIdentityKeys(target, has, key) {\r\n const rawKey = toRaw(key);\r\n if (rawKey !== key && has.call(target, rawKey)) {\r\n const type = toRawType(target);\r\n console.warn(`Reactive ${type} contains both the raw and reactive ` +\r\n `versions of the same object${type === `Map` ? ` as keys` : ``}, ` +\r\n `which can lead to inconsistencies. ` +\r\n `Avoid differentiating between the raw and reactive versions ` +\r\n `of an object and only use the reactive version if possible.`);\r\n }\r\n}\n\nconst reactiveMap = new WeakMap();\r\nconst shallowReactiveMap = new WeakMap();\r\nconst readonlyMap = new WeakMap();\r\nconst shallowReadonlyMap = new WeakMap();\r\nfunction targetTypeMap(rawType) {\r\n switch (rawType) {\r\n case 'Object':\r\n case 'Array':\r\n return 1 /* COMMON */;\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return 2 /* COLLECTION */;\r\n default:\r\n return 0 /* INVALID */;\r\n }\r\n}\r\nfunction getTargetType(value) {\r\n return value[\"__v_skip\" /* SKIP */] || !Object.isExtensible(value)\r\n ? 0 /* INVALID */\r\n : targetTypeMap(toRawType(value));\r\n}\r\nfunction reactive(target) {\r\n // if trying to observe a readonly proxy, return the readonly version.\r\n if (target && target[\"__v_isReadonly\" /* IS_READONLY */]) {\r\n return target;\r\n }\r\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\r\n}\r\n/**\r\n * Return a shallowly-reactive copy of the original object, where only the root\r\n * level properties are reactive. It also does not auto-unwrap refs (even at the\r\n * root level).\r\n */\r\nfunction shallowReactive(target) {\r\n return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\r\n}\r\n/**\r\n * Creates a readonly copy of the original object. Note the returned copy is not\r\n * made reactive, but `readonly` can be called on an already reactive object.\r\n */\r\nfunction readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\r\n}\r\n/**\r\n * Returns a reactive-copy of the original object, where only the root level\r\n * properties are readonly, and does NOT unwrap refs nor recursively convert\r\n * returned properties.\r\n * This is used for creating the props proxy object for stateful components.\r\n */\r\nfunction shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}\r\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\r\n if (!isObject(target)) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`value cannot be made reactive: ${String(target)}`);\r\n }\r\n return target;\r\n }\r\n // target is already a Proxy, return it.\r\n // exception: calling readonly() on a reactive object\r\n if (target[\"__v_raw\" /* RAW */] &&\r\n !(isReadonly && target[\"__v_isReactive\" /* IS_REACTIVE */])) {\r\n return target;\r\n }\r\n // target already has corresponding Proxy\r\n const existingProxy = proxyMap.get(target);\r\n if (existingProxy) {\r\n return existingProxy;\r\n }\r\n // only a whitelist of value types can be observed.\r\n const targetType = getTargetType(target);\r\n if (targetType === 0 /* INVALID */) {\r\n return target;\r\n }\r\n const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);\r\n proxyMap.set(target, proxy);\r\n return proxy;\r\n}\r\nfunction isReactive(value) {\r\n if (isReadonly(value)) {\r\n return isReactive(value[\"__v_raw\" /* RAW */]);\r\n }\r\n return !!(value && value[\"__v_isReactive\" /* IS_REACTIVE */]);\r\n}\r\nfunction isReadonly(value) {\r\n return !!(value && value[\"__v_isReadonly\" /* IS_READONLY */]);\r\n}\r\nfunction isProxy(value) {\r\n return isReactive(value) || isReadonly(value);\r\n}\r\nfunction toRaw(observed) {\r\n return ((observed && toRaw(observed[\"__v_raw\" /* RAW */])) || observed);\r\n}\r\nfunction markRaw(value) {\r\n def(value, \"__v_skip\" /* SKIP */, true);\r\n return value;\r\n}\n\nconst convert = (val) => isObject(val) ? reactive(val) : val;\r\nfunction isRef(r) {\r\n return Boolean(r && r.__v_isRef === true);\r\n}\r\nfunction ref(value) {\r\n return createRef(value);\r\n}\r\nfunction shallowRef(value) {\r\n return createRef(value, true);\r\n}\r\nclass RefImpl {\r\n constructor(_rawValue, _shallow = false) {\r\n this._rawValue = _rawValue;\r\n this._shallow = _shallow;\r\n this.__v_isRef = true;\r\n this._value = _shallow ? _rawValue : convert(_rawValue);\r\n }\r\n get value() {\r\n track(toRaw(this), \"get\" /* GET */, 'value');\r\n return this._value;\r\n }\r\n set value(newVal) {\r\n if (hasChanged(toRaw(newVal), this._rawValue)) {\r\n this._rawValue = newVal;\r\n this._value = this._shallow ? newVal : convert(newVal);\r\n trigger(toRaw(this), \"set\" /* SET */, 'value', newVal);\r\n }\r\n }\r\n}\r\nfunction createRef(rawValue, shallow = false) {\r\n if (isRef(rawValue)) {\r\n return rawValue;\r\n }\r\n return new RefImpl(rawValue, shallow);\r\n}\r\nfunction triggerRef(ref) {\r\n trigger(toRaw(ref), \"set\" /* SET */, 'value', (process.env.NODE_ENV !== 'production') ? ref.value : void 0);\r\n}\r\nfunction unref(ref) {\r\n return isRef(ref) ? ref.value : ref;\r\n}\r\nconst shallowUnwrapHandlers = {\r\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\r\n set: (target, key, value, receiver) => {\r\n const oldValue = target[key];\r\n if (isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n else {\r\n return Reflect.set(target, key, value, receiver);\r\n }\r\n }\r\n};\r\nfunction proxyRefs(objectWithRefs) {\r\n return isReactive(objectWithRefs)\r\n ? objectWithRefs\r\n : new Proxy(objectWithRefs, shallowUnwrapHandlers);\r\n}\r\nclass CustomRefImpl {\r\n constructor(factory) {\r\n this.__v_isRef = true;\r\n const { get, set } = factory(() => track(this, \"get\" /* GET */, 'value'), () => trigger(this, \"set\" /* SET */, 'value'));\r\n this._get = get;\r\n this._set = set;\r\n }\r\n get value() {\r\n return this._get();\r\n }\r\n set value(newVal) {\r\n this._set(newVal);\r\n }\r\n}\r\nfunction customRef(factory) {\r\n return new CustomRefImpl(factory);\r\n}\r\nfunction toRefs(object) {\r\n if ((process.env.NODE_ENV !== 'production') && !isProxy(object)) {\r\n console.warn(`toRefs() expects a reactive object but received a plain one.`);\r\n }\r\n const ret = isArray(object) ? new Array(object.length) : {};\r\n for (const key in object) {\r\n ret[key] = toRef(object, key);\r\n }\r\n return ret;\r\n}\r\nclass ObjectRefImpl {\r\n constructor(_object, _key) {\r\n this._object = _object;\r\n this._key = _key;\r\n this.__v_isRef = true;\r\n }\r\n get value() {\r\n return this._object[this._key];\r\n }\r\n set value(newVal) {\r\n this._object[this._key] = newVal;\r\n }\r\n}\r\nfunction toRef(object, key) {\r\n return isRef(object[key])\r\n ? object[key]\r\n : new ObjectRefImpl(object, key);\r\n}\n\nclass ComputedRefImpl {\r\n constructor(getter, _setter, isReadonly) {\r\n this._setter = _setter;\r\n this._dirty = true;\r\n this.__v_isRef = true;\r\n this.effect = effect(getter, {\r\n lazy: true,\r\n scheduler: () => {\r\n if (!this._dirty) {\r\n this._dirty = true;\r\n trigger(toRaw(this), \"set\" /* SET */, 'value');\r\n }\r\n }\r\n });\r\n this[\"__v_isReadonly\" /* IS_READONLY */] = isReadonly;\r\n }\r\n get value() {\r\n // the computed ref may get wrapped by other proxies e.g. readonly() #3376\r\n const self = toRaw(this);\r\n if (self._dirty) {\r\n self._value = this.effect();\r\n self._dirty = false;\r\n }\r\n track(self, \"get\" /* GET */, 'value');\r\n return self._value;\r\n }\r\n set value(newValue) {\r\n this._setter(newValue);\r\n }\r\n}\r\nfunction computed(getterOrOptions) {\r\n let getter;\r\n let setter;\r\n if (isFunction(getterOrOptions)) {\r\n getter = getterOrOptions;\r\n setter = (process.env.NODE_ENV !== 'production')\r\n ? () => {\r\n console.warn('Write operation failed: computed value is readonly');\r\n }\r\n : NOOP;\r\n }\r\n else {\r\n getter = getterOrOptions.get;\r\n setter = getterOrOptions.set;\r\n }\r\n return new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);\r\n}\n\nexport { ITERATE_KEY, computed, customRef, effect, enableTracking, isProxy, isReactive, isReadonly, isRef, markRaw, pauseTracking, proxyRefs, reactive, readonly, ref, resetTracking, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, track, trigger, triggerRef, unref };\n","import { pauseTracking, resetTracking, isRef, toRaw, shallowReactive, trigger, isReactive, effect, stop, ref, isProxy, proxyRefs, toRef, reactive, shallowReadonly, track, computed as computed$1, isReadonly } from '@vue/reactivity';\nexport { customRef, isProxy, isReactive, isReadonly, isRef, markRaw, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';\nimport { isString, isFunction, isPromise, isArray, extend, EMPTY_OBJ, toHandlerKey, toNumber, hyphenate, camelize, isOn, hasOwn, isModelListener, def, isReservedProp, EMPTY_ARR, isObject, capitalize, toRawType, makeMap, remove, NOOP, hasChanged, isSet, isMap, invokeArrayFns, NO, getGlobalThis, normalizeClass, normalizeStyle, isGloballyWhitelisted } from '@vue/shared';\nexport { camelize, capitalize, toDisplayString, toHandlerKey } from '@vue/shared';\n\nconst stack = [];\r\nfunction pushWarningContext(vnode) {\r\n stack.push(vnode);\r\n}\r\nfunction popWarningContext() {\r\n stack.pop();\r\n}\r\nfunction warn(msg, ...args) {\r\n // avoid props formatting or warn handler tracking deps that might be mutated\r\n // during patch, leading to infinite recursion.\r\n pauseTracking();\r\n const instance = stack.length ? stack[stack.length - 1].component : null;\r\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\r\n const trace = getComponentTrace();\r\n if (appWarnHandler) {\r\n callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [\r\n msg + args.join(''),\r\n instance && instance.proxy,\r\n trace\r\n .map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)\r\n .join('\\n'),\r\n trace\r\n ]);\r\n }\r\n else {\r\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\r\n /* istanbul ignore if */\r\n if (trace.length &&\r\n // avoid spamming console during tests\r\n !false) {\r\n warnArgs.push(`\\n`, ...formatTrace(trace));\r\n }\r\n console.warn(...warnArgs);\r\n }\r\n resetTracking();\r\n}\r\nfunction getComponentTrace() {\r\n let currentVNode = stack[stack.length - 1];\r\n if (!currentVNode) {\r\n return [];\r\n }\r\n // we can't just use the stack because it will be incomplete during updates\r\n // that did not start from the root. Re-construct the parent chain using\r\n // instance parent pointers.\r\n const normalizedStack = [];\r\n while (currentVNode) {\r\n const last = normalizedStack[0];\r\n if (last && last.vnode === currentVNode) {\r\n last.recurseCount++;\r\n }\r\n else {\r\n normalizedStack.push({\r\n vnode: currentVNode,\r\n recurseCount: 0\r\n });\r\n }\r\n const parentInstance = currentVNode.component && currentVNode.component.parent;\r\n currentVNode = parentInstance && parentInstance.vnode;\r\n }\r\n return normalizedStack;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatTrace(trace) {\r\n const logs = [];\r\n trace.forEach((entry, i) => {\r\n logs.push(...(i === 0 ? [] : [`\\n`]), ...formatTraceEntry(entry));\r\n });\r\n return logs;\r\n}\r\nfunction formatTraceEntry({ vnode, recurseCount }) {\r\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\r\n const isRoot = vnode.component ? vnode.component.parent == null : false;\r\n const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;\r\n const close = `>` + postfix;\r\n return vnode.props\r\n ? [open, ...formatProps(vnode.props), close]\r\n : [open + close];\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProps(props) {\r\n const res = [];\r\n const keys = Object.keys(props);\r\n keys.slice(0, 3).forEach(key => {\r\n res.push(...formatProp(key, props[key]));\r\n });\r\n if (keys.length > 3) {\r\n res.push(` ...`);\r\n }\r\n return res;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProp(key, value, raw) {\r\n if (isString(value)) {\r\n value = JSON.stringify(value);\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (typeof value === 'number' ||\r\n typeof value === 'boolean' ||\r\n value == null) {\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (isRef(value)) {\r\n value = formatProp(key, toRaw(value.value), true);\r\n return raw ? value : [`${key}=Ref<`, value, `>`];\r\n }\r\n else if (isFunction(value)) {\r\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\r\n }\r\n else {\r\n value = toRaw(value);\r\n return raw ? value : [`${key}=`, value];\r\n }\r\n}\n\nconst ErrorTypeStrings = {\r\n [\"bc\" /* BEFORE_CREATE */]: 'beforeCreate hook',\r\n [\"c\" /* CREATED */]: 'created hook',\r\n [\"bm\" /* BEFORE_MOUNT */]: 'beforeMount hook',\r\n [\"m\" /* MOUNTED */]: 'mounted hook',\r\n [\"bu\" /* BEFORE_UPDATE */]: 'beforeUpdate hook',\r\n [\"u\" /* UPDATED */]: 'updated',\r\n [\"bum\" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',\r\n [\"um\" /* UNMOUNTED */]: 'unmounted hook',\r\n [\"a\" /* ACTIVATED */]: 'activated hook',\r\n [\"da\" /* DEACTIVATED */]: 'deactivated hook',\r\n [\"ec\" /* ERROR_CAPTURED */]: 'errorCaptured hook',\r\n [\"rtc\" /* RENDER_TRACKED */]: 'renderTracked hook',\r\n [\"rtg\" /* RENDER_TRIGGERED */]: 'renderTriggered hook',\r\n [0 /* SETUP_FUNCTION */]: 'setup function',\r\n [1 /* RENDER_FUNCTION */]: 'render function',\r\n [2 /* WATCH_GETTER */]: 'watcher getter',\r\n [3 /* WATCH_CALLBACK */]: 'watcher callback',\r\n [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',\r\n [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',\r\n [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',\r\n [7 /* VNODE_HOOK */]: 'vnode hook',\r\n [8 /* DIRECTIVE_HOOK */]: 'directive hook',\r\n [9 /* TRANSITION_HOOK */]: 'transition hook',\r\n [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',\r\n [11 /* APP_WARN_HANDLER */]: 'app warnHandler',\r\n [12 /* FUNCTION_REF */]: 'ref function',\r\n [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',\r\n [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +\r\n 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'\r\n};\r\nfunction callWithErrorHandling(fn, instance, type, args) {\r\n let res;\r\n try {\r\n res = args ? fn(...args) : fn();\r\n }\r\n catch (err) {\r\n handleError(err, instance, type);\r\n }\r\n return res;\r\n}\r\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\r\n if (isFunction(fn)) {\r\n const res = callWithErrorHandling(fn, instance, type, args);\r\n if (res && isPromise(res)) {\r\n res.catch(err => {\r\n handleError(err, instance, type);\r\n });\r\n }\r\n return res;\r\n }\r\n const values = [];\r\n for (let i = 0; i < fn.length; i++) {\r\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\r\n }\r\n return values;\r\n}\r\nfunction handleError(err, instance, type, throwInDev = true) {\r\n const contextVNode = instance ? instance.vnode : null;\r\n if (instance) {\r\n let cur = instance.parent;\r\n // the exposed instance is the render proxy to keep it consistent with 2.x\r\n const exposedInstance = instance.proxy;\r\n // in production the hook receives only the error code\r\n const errorInfo = (process.env.NODE_ENV !== 'production') ? ErrorTypeStrings[type] : type;\r\n while (cur) {\r\n const errorCapturedHooks = cur.ec;\r\n if (errorCapturedHooks) {\r\n for (let i = 0; i < errorCapturedHooks.length; i++) {\r\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\r\n return;\r\n }\r\n }\r\n }\r\n cur = cur.parent;\r\n }\r\n // app-level handling\r\n const appErrorHandler = instance.appContext.config.errorHandler;\r\n if (appErrorHandler) {\r\n callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);\r\n return;\r\n }\r\n }\r\n logError(err, type, contextVNode, throwInDev);\r\n}\r\nfunction logError(err, type, contextVNode, throwInDev = true) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const info = ErrorTypeStrings[type];\r\n if (contextVNode) {\r\n pushWarningContext(contextVNode);\r\n }\r\n warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\r\n if (contextVNode) {\r\n popWarningContext();\r\n }\r\n // crash in dev by default so it's more noticeable\r\n if (throwInDev) {\r\n throw err;\r\n }\r\n else {\r\n console.error(err);\r\n }\r\n }\r\n else {\r\n // recover in prod to reduce the impact on end-user\r\n console.error(err);\r\n }\r\n}\n\nlet isFlushing = false;\r\nlet isFlushPending = false;\r\nconst queue = [];\r\nlet flushIndex = 0;\r\nconst pendingPreFlushCbs = [];\r\nlet activePreFlushCbs = null;\r\nlet preFlushIndex = 0;\r\nconst pendingPostFlushCbs = [];\r\nlet activePostFlushCbs = null;\r\nlet postFlushIndex = 0;\r\nconst resolvedPromise = Promise.resolve();\r\nlet currentFlushPromise = null;\r\nlet currentPreFlushParentJob = null;\r\nconst RECURSION_LIMIT = 100;\r\nfunction nextTick(fn) {\r\n const p = currentFlushPromise || resolvedPromise;\r\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\r\n}\r\n// #2768\r\n// Use binary-search to find a suitable position in the queue,\r\n// so that the queue maintains the increasing order of job's id,\r\n// which can prevent the job from being skipped and also can avoid repeated patching.\r\nfunction findInsertionIndex(job) {\r\n // the start index should be `flushIndex + 1`\r\n let start = flushIndex + 1;\r\n let end = queue.length;\r\n const jobId = getId(job);\r\n while (start < end) {\r\n const middle = (start + end) >>> 1;\r\n const middleJobId = getId(queue[middle]);\r\n middleJobId < jobId ? (start = middle + 1) : (end = middle);\r\n }\r\n return start;\r\n}\r\nfunction queueJob(job) {\r\n // the dedupe search uses the startIndex argument of Array.includes()\r\n // by default the search index includes the current job that is being run\r\n // so it cannot recursively trigger itself again.\r\n // if the job is a watch() callback, the search will start with a +1 index to\r\n // allow it recursively trigger itself - it is the user's responsibility to\r\n // ensure it doesn't end up in an infinite loop.\r\n if ((!queue.length ||\r\n !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&\r\n job !== currentPreFlushParentJob) {\r\n const pos = findInsertionIndex(job);\r\n if (pos > -1) {\r\n queue.splice(pos, 0, job);\r\n }\r\n else {\r\n queue.push(job);\r\n }\r\n queueFlush();\r\n }\r\n}\r\nfunction queueFlush() {\r\n if (!isFlushing && !isFlushPending) {\r\n isFlushPending = true;\r\n currentFlushPromise = resolvedPromise.then(flushJobs);\r\n }\r\n}\r\nfunction invalidateJob(job) {\r\n const i = queue.indexOf(job);\r\n if (i > flushIndex) {\r\n queue.splice(i, 1);\r\n }\r\n}\r\nfunction queueCb(cb, activeQueue, pendingQueue, index) {\r\n if (!isArray(cb)) {\r\n if (!activeQueue ||\r\n !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {\r\n pendingQueue.push(cb);\r\n }\r\n }\r\n else {\r\n // if cb is an array, it is a component lifecycle hook which can only be\r\n // triggered by a job, which is already deduped in the main queue, so\r\n // we can skip duplicate check here to improve perf\r\n pendingQueue.push(...cb);\r\n }\r\n queueFlush();\r\n}\r\nfunction queuePreFlushCb(cb) {\r\n queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\r\n}\r\nfunction queuePostFlushCb(cb) {\r\n queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\r\n}\r\nfunction flushPreFlushCbs(seen, parentJob = null) {\r\n if (pendingPreFlushCbs.length) {\r\n currentPreFlushParentJob = parentJob;\r\n activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\r\n pendingPreFlushCbs.length = 0;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex]);\r\n }\r\n activePreFlushCbs[preFlushIndex]();\r\n }\r\n activePreFlushCbs = null;\r\n preFlushIndex = 0;\r\n currentPreFlushParentJob = null;\r\n // recursively flush until it drains\r\n flushPreFlushCbs(seen, parentJob);\r\n }\r\n}\r\nfunction flushPostFlushCbs(seen) {\r\n if (pendingPostFlushCbs.length) {\r\n const deduped = [...new Set(pendingPostFlushCbs)];\r\n pendingPostFlushCbs.length = 0;\r\n // #1947 already has active queue, nested flushPostFlushCbs call\r\n if (activePostFlushCbs) {\r\n activePostFlushCbs.push(...deduped);\r\n return;\r\n }\r\n activePostFlushCbs = deduped;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\r\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex]);\r\n }\r\n activePostFlushCbs[postFlushIndex]();\r\n }\r\n activePostFlushCbs = null;\r\n postFlushIndex = 0;\r\n }\r\n}\r\nconst getId = (job) => job.id == null ? Infinity : job.id;\r\nfunction flushJobs(seen) {\r\n isFlushPending = false;\r\n isFlushing = true;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n flushPreFlushCbs(seen);\r\n // Sort queue before flush.\r\n // This ensures that:\r\n // 1. Components are updated from parent to child. (because parent is always\r\n // created before the child so its render effect will have smaller\r\n // priority number)\r\n // 2. If a component is unmounted during a parent component's update,\r\n // its update can be skipped.\r\n queue.sort((a, b) => getId(a) - getId(b));\r\n try {\r\n for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\r\n const job = queue[flushIndex];\r\n if (job) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, job);\r\n }\r\n callWithErrorHandling(job, null, 14 /* SCHEDULER */);\r\n }\r\n }\r\n }\r\n finally {\r\n flushIndex = 0;\r\n queue.length = 0;\r\n flushPostFlushCbs(seen);\r\n isFlushing = false;\r\n currentFlushPromise = null;\r\n // some postFlushCb queued jobs!\r\n // keep flushing until it drains.\r\n if (queue.length || pendingPostFlushCbs.length) {\r\n flushJobs(seen);\r\n }\r\n }\r\n}\r\nfunction checkRecursiveUpdates(seen, fn) {\r\n if (!seen.has(fn)) {\r\n seen.set(fn, 1);\r\n }\r\n else {\r\n const count = seen.get(fn);\r\n if (count > RECURSION_LIMIT) {\r\n throw new Error(`Maximum recursive updates exceeded. ` +\r\n `This means you have a reactive effect that is mutating its own ` +\r\n `dependencies and thus recursively triggering itself. Possible sources ` +\r\n `include component template, render function, updated hook or ` +\r\n `watcher source function.`);\r\n }\r\n else {\r\n seen.set(fn, count + 1);\r\n }\r\n }\r\n}\n\n/* eslint-disable no-restricted-globals */\r\nlet isHmrUpdating = false;\r\nconst hmrDirtyComponents = new Set();\r\n// Expose the HMR runtime on the global object\r\n// This makes it entirely tree-shakable without polluting the exports and makes\r\n// it easier to be used in toolings like vue-loader\r\n// Note: for a component to be eligible for HMR it also needs the __hmrId option\r\n// to be set so that its instances can be registered / removed.\r\nif ((process.env.NODE_ENV !== 'production')) {\r\n const globalObject = typeof global !== 'undefined'\r\n ? global\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : {};\r\n globalObject.__VUE_HMR_RUNTIME__ = {\r\n createRecord: tryWrap(createRecord),\r\n rerender: tryWrap(rerender),\r\n reload: tryWrap(reload)\r\n };\r\n}\r\nconst map = new Map();\r\nfunction registerHMR(instance) {\r\n const id = instance.type.__hmrId;\r\n let record = map.get(id);\r\n if (!record) {\r\n createRecord(id, instance.type);\r\n record = map.get(id);\r\n }\r\n record.instances.add(instance);\r\n}\r\nfunction unregisterHMR(instance) {\r\n map.get(instance.type.__hmrId).instances.delete(instance);\r\n}\r\nfunction createRecord(id, component) {\r\n if (!component) {\r\n warn(`HMR API usage is out of date.\\n` +\r\n `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +\r\n `dependency that handles Vue SFC compilation.`);\r\n component = {};\r\n }\r\n if (map.has(id)) {\r\n return false;\r\n }\r\n map.set(id, {\r\n component: isClassComponent(component) ? component.__vccOpts : component,\r\n instances: new Set()\r\n });\r\n return true;\r\n}\r\nfunction rerender(id, newRender) {\r\n const record = map.get(id);\r\n if (!record)\r\n return;\r\n if (newRender)\r\n record.component.render = newRender;\r\n // Array.from creates a snapshot which avoids the set being mutated during\r\n // updates\r\n Array.from(record.instances).forEach(instance => {\r\n if (newRender) {\r\n instance.render = newRender;\r\n }\r\n instance.renderCache = [];\r\n // this flag forces child components with slot content to update\r\n isHmrUpdating = true;\r\n instance.update();\r\n isHmrUpdating = false;\r\n });\r\n}\r\nfunction reload(id, newComp) {\r\n const record = map.get(id);\r\n if (!record)\r\n return;\r\n // Array.from creates a snapshot which avoids the set being mutated during\r\n // updates\r\n const { component, instances } = record;\r\n if (!hmrDirtyComponents.has(component)) {\r\n // 1. Update existing comp definition to match new one\r\n newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;\r\n extend(component, newComp);\r\n for (const key in component) {\r\n if (!(key in newComp)) {\r\n delete component[key];\r\n }\r\n }\r\n // 2. Mark component dirty. This forces the renderer to replace the component\r\n // on patch.\r\n hmrDirtyComponents.add(component);\r\n // 3. Make sure to unmark the component after the reload.\r\n queuePostFlushCb(() => {\r\n hmrDirtyComponents.delete(component);\r\n });\r\n }\r\n Array.from(instances).forEach(instance => {\r\n if (instance.parent) {\r\n // 4. Force the parent instance to re-render. This will cause all updated\r\n // components to be unmounted and re-mounted. Queue the update so that we\r\n // don't end up forcing the same parent to re-render multiple times.\r\n queueJob(instance.parent.update);\r\n }\r\n else if (instance.appContext.reload) {\r\n // root instance mounted via createApp() has a reload method\r\n instance.appContext.reload();\r\n }\r\n else if (typeof window !== 'undefined') {\r\n // root instance inside tree created via raw render(). Force reload.\r\n window.location.reload();\r\n }\r\n else {\r\n console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');\r\n }\r\n });\r\n}\r\nfunction tryWrap(fn) {\r\n return (id, arg) => {\r\n try {\r\n return fn(id, arg);\r\n }\r\n catch (e) {\r\n console.error(e);\r\n console.warn(`[HMR] Something went wrong during Vue component hot-reload. ` +\r\n `Full reload required.`);\r\n }\r\n };\r\n}\n\nlet devtools;\r\nfunction setDevtoolsHook(hook) {\r\n devtools = hook;\r\n}\r\nfunction devtoolsInitApp(app, version) {\r\n // TODO queue if devtools is undefined\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"app:init\" /* APP_INIT */, app, version, {\r\n Fragment,\r\n Text,\r\n Comment,\r\n Static\r\n });\r\n}\r\nfunction devtoolsUnmountApp(app) {\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"app:unmount\" /* APP_UNMOUNT */, app);\r\n}\r\nconst devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */);\r\nconst devtoolsComponentUpdated = /*#__PURE__*/ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\r\nconst devtoolsComponentRemoved = /*#__PURE__*/ createDevtoolsComponentHook(\"component:removed\" /* COMPONENT_REMOVED */);\r\nfunction createDevtoolsComponentHook(hook) {\r\n return (component) => {\r\n if (!devtools)\r\n return;\r\n devtools.emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);\r\n };\r\n}\r\nfunction devtoolsComponentEmit(component, event, params) {\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"component:emit\" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);\r\n}\n\nfunction emit(instance, event, ...rawArgs) {\r\n const props = instance.vnode.props || EMPTY_OBJ;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const { emitsOptions, propsOptions: [propsOptions] } = instance;\r\n if (emitsOptions) {\r\n if (!(event in emitsOptions)) {\r\n if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {\r\n warn(`Component emitted event \"${event}\" but it is neither declared in ` +\r\n `the emits option nor as an \"${toHandlerKey(event)}\" prop.`);\r\n }\r\n }\r\n else {\r\n const validator = emitsOptions[event];\r\n if (isFunction(validator)) {\r\n const isValid = validator(...rawArgs);\r\n if (!isValid) {\r\n warn(`Invalid event arguments: event validation failed for event \"${event}\".`);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n let args = rawArgs;\r\n const isModelListener = event.startsWith('update:');\r\n // for v-model update:xxx events, apply modifiers on args\r\n const modelArg = isModelListener && event.slice(7);\r\n if (modelArg && modelArg in props) {\r\n const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;\r\n const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\r\n if (trim) {\r\n args = rawArgs.map(a => a.trim());\r\n }\r\n else if (number) {\r\n args = rawArgs.map(toNumber);\r\n }\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsComponentEmit(instance, event, args);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const lowerCaseEvent = event.toLowerCase();\r\n if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {\r\n warn(`Event \"${lowerCaseEvent}\" is emitted in component ` +\r\n `${formatComponentName(instance, instance.type)} but the handler is registered for \"${event}\". ` +\r\n `Note that HTML attributes are case-insensitive and you cannot use ` +\r\n `v-on to listen to camelCase events when using in-DOM templates. ` +\r\n `You should probably use \"${hyphenate(event)}\" instead of \"${event}\".`);\r\n }\r\n }\r\n let handlerName;\r\n let handler = props[(handlerName = toHandlerKey(event))] ||\r\n // also try camelCase event handler (#2249)\r\n props[(handlerName = toHandlerKey(camelize(event)))];\r\n // for v-model update:xxx events, also trigger kebab-case equivalent\r\n // for props passed via kebab-case\r\n if (!handler && isModelListener) {\r\n handler = props[(handlerName = toHandlerKey(hyphenate(event)))];\r\n }\r\n if (handler) {\r\n callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n const onceHandler = props[handlerName + `Once`];\r\n if (onceHandler) {\r\n if (!instance.emitted) {\r\n (instance.emitted = {})[handlerName] = true;\r\n }\r\n else if (instance.emitted[handlerName]) {\r\n return;\r\n }\r\n callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n}\r\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\r\n if (!appContext.deopt && comp.__emits !== undefined) {\r\n return comp.__emits;\r\n }\r\n const raw = comp.emits;\r\n let normalized = {};\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\r\n const extendEmits = (raw) => {\r\n const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true);\r\n if (normalizedFromExtend) {\r\n hasExtends = true;\r\n extend(normalized, normalizedFromExtend);\r\n }\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendEmits);\r\n }\r\n if (comp.extends) {\r\n extendEmits(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendEmits);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n return (comp.__emits = null);\r\n }\r\n if (isArray(raw)) {\r\n raw.forEach(key => (normalized[key] = null));\r\n }\r\n else {\r\n extend(normalized, raw);\r\n }\r\n return (comp.__emits = normalized);\r\n}\r\n// Check if an incoming prop key is a declared emit event listener.\r\n// e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are\r\n// both considered matched listeners.\r\nfunction isEmitListener(options, key) {\r\n if (!options || !isOn(key)) {\r\n return false;\r\n }\r\n key = key.slice(2).replace(/Once$/, '');\r\n return (hasOwn(options, key[0].toLowerCase() + key.slice(1)) ||\r\n hasOwn(options, hyphenate(key)) ||\r\n hasOwn(options, key));\r\n}\n\nlet isRenderingCompiledSlot = 0;\r\nconst setCompiledSlotRendering = (n) => (isRenderingCompiledSlot += n);\r\n/**\r\n * Compiler runtime helper for rendering `<slot/>`\r\n * @private\r\n */\r\nfunction renderSlot(slots, name, props = {}, \r\n// this is not a user-facing function, so the fallback is always generated by\r\n// the compiler and guaranteed to be a function returning an array\r\nfallback, noSlotted) {\r\n let slot = slots[name];\r\n if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {\r\n warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +\r\n `function. You need to mark this component with $dynamic-slots in the ` +\r\n `parent template.`);\r\n slot = () => [];\r\n }\r\n // a compiled slot disables block tracking by default to avoid manual\r\n // invocation interfering with template-based block tracking, but in\r\n // `renderSlot` we can be sure that it's template-based so we can force\r\n // enable it.\r\n isRenderingCompiledSlot++;\r\n openBlock();\r\n const validSlotContent = slot && ensureValidVNode(slot(props));\r\n const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */\r\n ? 64 /* STABLE_FRAGMENT */\r\n : -2 /* BAIL */);\r\n if (!noSlotted && rendered.scopeId) {\r\n rendered.slotScopeIds = [rendered.scopeId + '-s'];\r\n }\r\n isRenderingCompiledSlot--;\r\n return rendered;\r\n}\r\nfunction ensureValidVNode(vnodes) {\r\n return vnodes.some(child => {\r\n if (!isVNode(child))\r\n return true;\r\n if (child.type === Comment)\r\n return false;\r\n if (child.type === Fragment &&\r\n !ensureValidVNode(child.children))\r\n return false;\r\n return true;\r\n })\r\n ? vnodes\r\n : null;\r\n}\n\n/**\r\n * mark the current rendering instance for asset resolution (e.g.\r\n * resolveComponent, resolveDirective) during render\r\n */\r\nlet currentRenderingInstance = null;\r\nlet currentScopeId = null;\r\n/**\r\n * Note: rendering calls maybe nested. The function returns the parent rendering\r\n * instance if present, which should be restored after the render is done:\r\n *\r\n * ```js\r\n * const prev = setCurrentRenderingInstance(i)\r\n * // ...render\r\n * setCurrentRenderingInstance(prev)\r\n * ```\r\n */\r\nfunction setCurrentRenderingInstance(instance) {\r\n const prev = currentRenderingInstance;\r\n currentRenderingInstance = instance;\r\n currentScopeId = (instance && instance.type.__scopeId) || null;\r\n return prev;\r\n}\r\n/**\r\n * Set scope id when creating hoisted vnodes.\r\n * @private compiler helper\r\n */\r\nfunction pushScopeId(id) {\r\n currentScopeId = id;\r\n}\r\n/**\r\n * Technically we no longer need this after 3.0.8 but we need to keep the same\r\n * API for backwards compat w/ code generated by compilers.\r\n * @private\r\n */\r\nfunction popScopeId() {\r\n currentScopeId = null;\r\n}\r\n/**\r\n * Only for backwards compat\r\n * @private\r\n */\r\nconst withScopeId = (_id) => withCtx;\r\n/**\r\n * Wrap a slot function to memoize current rendering instance\r\n * @private compiler helper\r\n */\r\nfunction withCtx(fn, ctx = currentRenderingInstance) {\r\n if (!ctx)\r\n return fn;\r\n const renderFnWithContext = (...args) => {\r\n // If a user calls a compiled slot inside a template expression (#1745), it\r\n // can mess up block tracking, so by default we need to push a null block to\r\n // avoid that. This isn't necessary if rendering a compiled `<slot>`.\r\n if (!isRenderingCompiledSlot) {\r\n openBlock(true /* null block that disables tracking */);\r\n }\r\n const prevInstance = setCurrentRenderingInstance(ctx);\r\n const res = fn(...args);\r\n setCurrentRenderingInstance(prevInstance);\r\n if (!isRenderingCompiledSlot) {\r\n closeBlock();\r\n }\r\n return res;\r\n };\r\n // mark this as a compiled slot function.\r\n // this is used in vnode.ts -> normalizeChildren() to set the slot\r\n // rendering flag.\r\n renderFnWithContext._c = true;\r\n return renderFnWithContext;\r\n}\n\n/**\r\n * dev only flag to track whether $attrs was used during render.\r\n * If $attrs was used during render then the warning for failed attrs\r\n * fallthrough can be suppressed.\r\n */\r\nlet accessedAttrs = false;\r\nfunction markAttrsAccessed() {\r\n accessedAttrs = true;\r\n}\r\nfunction renderComponentRoot(instance) {\r\n const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx } = instance;\r\n let result;\r\n const prev = setCurrentRenderingInstance(instance);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n accessedAttrs = false;\r\n }\r\n try {\r\n let fallthroughAttrs;\r\n if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\r\n // withProxy is a proxy with a different `has` trap only for\r\n // runtime-compiled render functions using `with` block.\r\n const proxyToUse = withProxy || proxy;\r\n result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));\r\n fallthroughAttrs = attrs;\r\n }\r\n else {\r\n // functional\r\n const render = Component;\r\n // in dev, mark attrs accessed if optional props (attrs === props)\r\n if ((process.env.NODE_ENV !== 'production') && attrs === props) {\r\n markAttrsAccessed();\r\n }\r\n result = normalizeVNode(render.length > 1\r\n ? render(props, (process.env.NODE_ENV !== 'production')\r\n ? {\r\n get attrs() {\r\n markAttrsAccessed();\r\n return attrs;\r\n },\r\n slots,\r\n emit\r\n }\r\n : { attrs, slots, emit })\r\n : render(props, null /* we know it doesn't need it */));\r\n fallthroughAttrs = Component.props\r\n ? attrs\r\n : getFunctionalFallthrough(attrs);\r\n }\r\n // attr merging\r\n // in dev mode, comments are preserved, and it's possible for a template\r\n // to have comments along side the root element which makes it a fragment\r\n let root = result;\r\n let setRoot = undefined;\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n result.patchFlag > 0 &&\r\n result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {\r\n ;\r\n [root, setRoot] = getChildRoot(result);\r\n }\r\n if (Component.inheritAttrs !== false && fallthroughAttrs) {\r\n const keys = Object.keys(fallthroughAttrs);\r\n const { shapeFlag } = root;\r\n if (keys.length) {\r\n if (shapeFlag & 1 /* ELEMENT */ ||\r\n shapeFlag & 6 /* COMPONENT */) {\r\n if (propsOptions && keys.some(isModelListener)) {\r\n // If a v-model listener (onUpdate:xxx) has a corresponding declared\r\n // prop, it indicates this component expects to handle v-model and\r\n // it should not fallthrough.\r\n // related: #1543, #1643, #1989\r\n fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);\r\n }\r\n root = cloneVNode(root, fallthroughAttrs);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production') && !accessedAttrs && root.type !== Comment) {\r\n const allAttrs = Object.keys(attrs);\r\n const eventAttrs = [];\r\n const extraAttrs = [];\r\n for (let i = 0, l = allAttrs.length; i < l; i++) {\r\n const key = allAttrs[i];\r\n if (isOn(key)) {\r\n // ignore v-model handlers when they fail to fallthrough\r\n if (!isModelListener(key)) {\r\n // remove `on`, lowercase first letter to reflect event casing\r\n // accurately\r\n eventAttrs.push(key[2].toLowerCase() + key.slice(3));\r\n }\r\n }\r\n else {\r\n extraAttrs.push(key);\r\n }\r\n }\r\n if (extraAttrs.length) {\r\n warn(`Extraneous non-props attributes (` +\r\n `${extraAttrs.join(', ')}) ` +\r\n `were passed to component but could not be automatically inherited ` +\r\n `because component renders fragment or text root nodes.`);\r\n }\r\n if (eventAttrs.length) {\r\n warn(`Extraneous non-emits event listeners (` +\r\n `${eventAttrs.join(', ')}) ` +\r\n `were passed to component but could not be automatically inherited ` +\r\n `because component renders fragment or text root nodes. ` +\r\n `If the listener is intended to be a component custom event listener only, ` +\r\n `declare it using the \"emits\" option.`);\r\n }\r\n }\r\n }\r\n }\r\n // inherit directives\r\n if (vnode.dirs) {\r\n if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {\r\n warn(`Runtime directive used on component with non-element root node. ` +\r\n `The directives will not function as intended.`);\r\n }\r\n root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\r\n }\r\n // inherit transition data\r\n if (vnode.transition) {\r\n if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {\r\n warn(`Component inside <Transition> renders non-element root node ` +\r\n `that cannot be animated.`);\r\n }\r\n root.transition = vnode.transition;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && setRoot) {\r\n setRoot(root);\r\n }\r\n else {\r\n result = root;\r\n }\r\n }\r\n catch (err) {\r\n blockStack.length = 0;\r\n handleError(err, instance, 1 /* RENDER_FUNCTION */);\r\n result = createVNode(Comment);\r\n }\r\n setCurrentRenderingInstance(prev);\r\n return result;\r\n}\r\n/**\r\n * dev only\r\n * In dev mode, template root level comments are rendered, which turns the\r\n * template into a fragment root, but we need to locate the single element\r\n * root for attrs and scope id processing.\r\n */\r\nconst getChildRoot = (vnode) => {\r\n const rawChildren = vnode.children;\r\n const dynamicChildren = vnode.dynamicChildren;\r\n const childRoot = filterSingleRoot(rawChildren);\r\n if (!childRoot) {\r\n return [vnode, undefined];\r\n }\r\n const index = rawChildren.indexOf(childRoot);\r\n const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\r\n const setRoot = (updatedRoot) => {\r\n rawChildren[index] = updatedRoot;\r\n if (dynamicChildren) {\r\n if (dynamicIndex > -1) {\r\n dynamicChildren[dynamicIndex] = updatedRoot;\r\n }\r\n else if (updatedRoot.patchFlag > 0) {\r\n vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\r\n }\r\n }\r\n };\r\n return [normalizeVNode(childRoot), setRoot];\r\n};\r\nfunction filterSingleRoot(children) {\r\n let singleRoot;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (isVNode(child)) {\r\n // ignore user comment\r\n if (child.type !== Comment || child.children === 'v-if') {\r\n if (singleRoot) {\r\n // has more than 1 non-comment child, return now\r\n return;\r\n }\r\n else {\r\n singleRoot = child;\r\n }\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n return singleRoot;\r\n}\r\nconst getFunctionalFallthrough = (attrs) => {\r\n let res;\r\n for (const key in attrs) {\r\n if (key === 'class' || key === 'style' || isOn(key)) {\r\n (res || (res = {}))[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst filterModelListeners = (attrs, props) => {\r\n const res = {};\r\n for (const key in attrs) {\r\n if (!isModelListener(key) || !(key.slice(9) in props)) {\r\n res[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst isElementRoot = (vnode) => {\r\n return (vnode.shapeFlag & 6 /* COMPONENT */ ||\r\n vnode.shapeFlag & 1 /* ELEMENT */ ||\r\n vnode.type === Comment // potential v-if branch switch\r\n );\r\n};\r\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\r\n const { props: prevProps, children: prevChildren, component } = prevVNode;\r\n const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\r\n const emits = component.emitsOptions;\r\n // Parent component's render function was hot-updated. Since this may have\r\n // caused the child component's slots content to have changed, we need to\r\n // force the child to update as well.\r\n if ((process.env.NODE_ENV !== 'production') && (prevChildren || nextChildren) && isHmrUpdating) {\r\n return true;\r\n }\r\n // force child update for runtime directive or transition on component vnode.\r\n if (nextVNode.dirs || nextVNode.transition) {\r\n return true;\r\n }\r\n if (optimized && patchFlag >= 0) {\r\n if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {\r\n // slot content that references values that might have changed,\r\n // e.g. in a v-for\r\n return true;\r\n }\r\n if (patchFlag & 16 /* FULL_PROPS */) {\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n // presence of this flag indicates props are always non-null\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n else if (patchFlag & 8 /* PROPS */) {\r\n const dynamicProps = nextVNode.dynamicProps;\r\n for (let i = 0; i < dynamicProps.length; i++) {\r\n const key = dynamicProps[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emits, key)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // this path is only taken by manually written render functions\r\n // so presence of any children leads to a forced update\r\n if (prevChildren || nextChildren) {\r\n if (!nextChildren || !nextChildren.$stable) {\r\n return true;\r\n }\r\n }\r\n if (prevProps === nextProps) {\r\n return false;\r\n }\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n if (!nextProps) {\r\n return true;\r\n }\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n return false;\r\n}\r\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\r\n const nextKeys = Object.keys(nextProps);\r\n if (nextKeys.length !== Object.keys(prevProps).length) {\r\n return true;\r\n }\r\n for (let i = 0; i < nextKeys.length; i++) {\r\n const key = nextKeys[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emitsOptions, key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction updateHOCHostEl({ vnode, parent }, el // HostNode\r\n) {\r\n while (parent && parent.subTree === vnode) {\r\n (vnode = parent.vnode).el = el;\r\n parent = parent.parent;\r\n }\r\n}\n\nconst isSuspense = (type) => type.__isSuspense;\r\n// Suspense exposes a component-like API, and is treated like a component\r\n// in the compiler, but internally it's a special built-in type that hooks\r\n// directly into the renderer.\r\nconst SuspenseImpl = {\r\n name: 'Suspense',\r\n // In order to make Suspense tree-shakable, we need to avoid importing it\r\n // directly in the renderer. The renderer checks for the __isSuspense flag\r\n // on a vnode's type and calls the `process` method, passing in renderer\r\n // internals.\r\n __isSuspense: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, \r\n // platform-specific impl passed from renderer\r\n rendererInternals) {\r\n if (n1 == null) {\r\n mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals);\r\n }\r\n else {\r\n patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, rendererInternals);\r\n }\r\n },\r\n hydrate: hydrateSuspense,\r\n create: createSuspenseBoundary\r\n};\r\n// Force-casted public typing for h and TSX props inference\r\nconst Suspense = (SuspenseImpl\r\n );\r\nfunction mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {\r\n const { p: patch, o: { createElement } } = rendererInternals;\r\n const hiddenContainer = createElement('div');\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals));\r\n // start mounting the content subtree in an off-dom container\r\n patch(null, (suspense.pendingBranch = vnode.ssContent), hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds);\r\n // now check if we have encountered any async deps\r\n if (suspense.deps > 0) {\r\n // has async\r\n // mount the fallback tree\r\n patch(null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds);\r\n setActiveBranch(suspense, vnode.ssFallback);\r\n }\r\n else {\r\n // Suspense has no async deps. Just resolve.\r\n suspense.resolve();\r\n }\r\n}\r\nfunction patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {\r\n const suspense = (n2.suspense = n1.suspense);\r\n suspense.vnode = n2;\r\n n2.el = n1.el;\r\n const newBranch = n2.ssContent;\r\n const newFallback = n2.ssFallback;\r\n const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\r\n if (pendingBranch) {\r\n suspense.pendingBranch = newBranch;\r\n if (isSameVNodeType(newBranch, pendingBranch)) {\r\n // same root type but content may have changed.\r\n patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else if (isInFallback) {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else {\r\n // toggled before pending tree is resolved\r\n suspense.pendingId++;\r\n if (isHydrating) {\r\n // if toggled before hydration is finished, the current DOM tree is\r\n // no longer valid. set it as the active branch so it will be unmounted\r\n // when resolved\r\n suspense.isHydrating = false;\r\n suspense.activeBranch = pendingBranch;\r\n }\r\n else {\r\n unmount(pendingBranch, parentComponent, suspense);\r\n }\r\n // increment pending ID. this is used to invalidate async callbacks\r\n // reset suspense state\r\n suspense.deps = 0;\r\n // discard effects from pending branch\r\n suspense.effects.length = 0;\r\n // discard previous container\r\n suspense.hiddenContainer = createElement('div');\r\n if (isInFallback) {\r\n // already in fallback state\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // toggled \"back\" to current active branch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n // force resolve\r\n suspense.resolve(true);\r\n }\r\n else {\r\n // switched to a 3rd branch\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // root did not change, just normal patch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newBranch);\r\n }\r\n else {\r\n // root node toggled\r\n // invoke @pending event\r\n const onPending = n2.props && n2.props.onPending;\r\n if (isFunction(onPending)) {\r\n onPending();\r\n }\r\n // mount pending branch in off-dom container\r\n suspense.pendingBranch = newBranch;\r\n suspense.pendingId++;\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n // incoming branch has no async deps, resolve now.\r\n suspense.resolve();\r\n }\r\n else {\r\n const { timeout, pendingId } = suspense;\r\n if (timeout > 0) {\r\n setTimeout(() => {\r\n if (suspense.pendingId === pendingId) {\r\n suspense.fallback(newFallback);\r\n }\r\n }, timeout);\r\n }\r\n else if (timeout === 0) {\r\n suspense.fallback(newFallback);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nlet hasWarned = false;\r\nfunction createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {\r\n /* istanbul ignore if */\r\n if ((process.env.NODE_ENV !== 'production') && !false && !hasWarned) {\r\n hasWarned = true;\r\n // @ts-ignore `console.info` cannot be null error\r\n console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);\r\n }\r\n const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;\r\n const timeout = toNumber(vnode.props && vnode.props.timeout);\r\n const suspense = {\r\n vnode,\r\n parent,\r\n parentComponent,\r\n isSVG,\r\n container,\r\n hiddenContainer,\r\n anchor,\r\n deps: 0,\r\n pendingId: 0,\r\n timeout: typeof timeout === 'number' ? timeout : -1,\r\n activeBranch: null,\r\n pendingBranch: null,\r\n isInFallback: true,\r\n isHydrating,\r\n isUnmounted: false,\r\n effects: [],\r\n resolve(resume = false) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n if (!resume && !suspense.pendingBranch) {\r\n throw new Error(`suspense.resolve() is called without a pending branch.`);\r\n }\r\n if (suspense.isUnmounted) {\r\n throw new Error(`suspense.resolve() is called on an already unmounted suspense boundary.`);\r\n }\r\n }\r\n const { vnode, activeBranch, pendingBranch, pendingId, effects, parentComponent, container } = suspense;\r\n if (suspense.isHydrating) {\r\n suspense.isHydrating = false;\r\n }\r\n else if (!resume) {\r\n const delayEnter = activeBranch &&\r\n pendingBranch.transition &&\r\n pendingBranch.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = () => {\r\n if (pendingId === suspense.pendingId) {\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n };\r\n }\r\n // this is initial anchor on mount\r\n let { anchor } = suspense;\r\n // unmount current active tree\r\n if (activeBranch) {\r\n // if the fallback tree was mounted, it may have been moved\r\n // as part of a parent suspense. get the latest anchor for insertion\r\n anchor = next(activeBranch);\r\n unmount(activeBranch, parentComponent, suspense, true);\r\n }\r\n if (!delayEnter) {\r\n // move content from off-dom container to actual container\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n }\r\n setActiveBranch(suspense, pendingBranch);\r\n suspense.pendingBranch = null;\r\n suspense.isInFallback = false;\r\n // flush buffered effects\r\n // check if there is a pending parent suspense\r\n let parent = suspense.parent;\r\n let hasUnresolvedAncestor = false;\r\n while (parent) {\r\n if (parent.pendingBranch) {\r\n // found a pending parent suspense, merge buffered post jobs\r\n // into that parent\r\n parent.effects.push(...effects);\r\n hasUnresolvedAncestor = true;\r\n break;\r\n }\r\n parent = parent.parent;\r\n }\r\n // no pending parent suspense, flush all jobs\r\n if (!hasUnresolvedAncestor) {\r\n queuePostFlushCb(effects);\r\n }\r\n suspense.effects = [];\r\n // invoke @resolve event\r\n const onResolve = vnode.props && vnode.props.onResolve;\r\n if (isFunction(onResolve)) {\r\n onResolve();\r\n }\r\n },\r\n fallback(fallbackVNode) {\r\n if (!suspense.pendingBranch) {\r\n return;\r\n }\r\n const { vnode, activeBranch, parentComponent, container, isSVG } = suspense;\r\n // invoke @fallback event\r\n const onFallback = vnode.props && vnode.props.onFallback;\r\n if (isFunction(onFallback)) {\r\n onFallback();\r\n }\r\n const anchor = next(activeBranch);\r\n const mountFallback = () => {\r\n if (!suspense.isInFallback) {\r\n return;\r\n }\r\n // mount the fallback tree\r\n patch(null, fallbackVNode, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, fallbackVNode);\r\n };\r\n const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = mountFallback;\r\n }\r\n // unmount current active branch\r\n unmount(activeBranch, parentComponent, null, // no suspense so unmount hooks fire now\r\n true // shouldRemove\r\n );\r\n suspense.isInFallback = true;\r\n if (!delayEnter) {\r\n mountFallback();\r\n }\r\n },\r\n move(container, anchor, type) {\r\n suspense.activeBranch &&\r\n move(suspense.activeBranch, container, anchor, type);\r\n suspense.container = container;\r\n },\r\n next() {\r\n return suspense.activeBranch && next(suspense.activeBranch);\r\n },\r\n registerDep(instance, setupRenderEffect) {\r\n const isInPendingSuspense = !!suspense.pendingBranch;\r\n if (isInPendingSuspense) {\r\n suspense.deps++;\r\n }\r\n const hydratedEl = instance.vnode.el;\r\n instance\r\n .asyncDep.catch(err => {\r\n handleError(err, instance, 0 /* SETUP_FUNCTION */);\r\n })\r\n .then(asyncSetupResult => {\r\n // retry when the setup() promise resolves.\r\n // component may have been unmounted before resolve.\r\n if (instance.isUnmounted ||\r\n suspense.isUnmounted ||\r\n suspense.pendingId !== instance.suspenseId) {\r\n return;\r\n }\r\n // retry from this component\r\n instance.asyncResolved = true;\r\n const { vnode } = instance;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n pushWarningContext(vnode);\r\n }\r\n handleSetupResult(instance, asyncSetupResult, false);\r\n if (hydratedEl) {\r\n // vnode may have been replaced if an update happened before the\r\n // async dep is resolved.\r\n vnode.el = hydratedEl;\r\n }\r\n const placeholder = !hydratedEl && instance.subTree.el;\r\n setupRenderEffect(instance, vnode, \r\n // component may have been moved before resolve.\r\n // if this is not a hydration, instance.subTree will be the comment\r\n // placeholder.\r\n parentNode(hydratedEl || instance.subTree.el), \r\n // anchor will not be used if this is hydration, so only need to\r\n // consider the comment placeholder case.\r\n hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized);\r\n if (placeholder) {\r\n remove(placeholder);\r\n }\r\n updateHOCHostEl(instance, vnode.el);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n popWarningContext();\r\n }\r\n // only decrease deps count if suspense is not already resolved\r\n if (isInPendingSuspense && --suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n });\r\n },\r\n unmount(parentSuspense, doRemove) {\r\n suspense.isUnmounted = true;\r\n if (suspense.activeBranch) {\r\n unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n if (suspense.pendingBranch) {\r\n unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n }\r\n };\r\n return suspense;\r\n}\r\nfunction hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {\r\n /* eslint-disable no-restricted-globals */\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement('div'), null, isSVG, slotScopeIds, optimized, rendererInternals, true /* hydrating */));\r\n // there are two possible scenarios for server-rendered suspense:\r\n // - success: ssr content should be fully resolved\r\n // - failure: ssr content should be the fallback branch.\r\n // however, on the client we don't really know if it has failed or not\r\n // attempt to hydrate the DOM assuming it has succeeded, but we still\r\n // need to construct a suspense boundary first\r\n const result = hydrateNode(node, (suspense.pendingBranch = vnode.ssContent), parentComponent, suspense, slotScopeIds, optimized);\r\n if (suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n return result;\r\n /* eslint-enable no-restricted-globals */\r\n}\r\nfunction normalizeSuspenseChildren(vnode) {\r\n const { shapeFlag, children } = vnode;\r\n let content;\r\n let fallback;\r\n if (shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n content = normalizeSuspenseSlot(children.default);\r\n fallback = normalizeSuspenseSlot(children.fallback);\r\n }\r\n else {\r\n content = normalizeSuspenseSlot(children);\r\n fallback = normalizeVNode(null);\r\n }\r\n return {\r\n content,\r\n fallback\r\n };\r\n}\r\nfunction normalizeSuspenseSlot(s) {\r\n if (isFunction(s)) {\r\n s = s();\r\n }\r\n if (isArray(s)) {\r\n const singleChild = filterSingleRoot(s);\r\n if ((process.env.NODE_ENV !== 'production') && !singleChild) {\r\n warn(`<Suspense> slots expect a single root node.`);\r\n }\r\n s = singleChild;\r\n }\r\n return normalizeVNode(s);\r\n}\r\nfunction queueEffectWithSuspense(fn, suspense) {\r\n if (suspense && suspense.pendingBranch) {\r\n if (isArray(fn)) {\r\n suspense.effects.push(...fn);\r\n }\r\n else {\r\n suspense.effects.push(fn);\r\n }\r\n }\r\n else {\r\n queuePostFlushCb(fn);\r\n }\r\n}\r\nfunction setActiveBranch(suspense, branch) {\r\n suspense.activeBranch = branch;\r\n const { vnode, parentComponent } = suspense;\r\n const el = (vnode.el = branch.el);\r\n // in case suspense is the root node of a component,\r\n // recursively update the HOC el\r\n if (parentComponent && parentComponent.subTree === vnode) {\r\n parentComponent.vnode.el = el;\r\n updateHOCHostEl(parentComponent, el);\r\n }\r\n}\n\nfunction initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\r\nisSSR = false) {\r\n const props = {};\r\n const attrs = {};\r\n def(attrs, InternalObjectKey, 1);\r\n instance.propsDefaults = Object.create(null);\r\n setFullProps(instance, rawProps, props, attrs);\r\n // validation\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateProps(rawProps || {}, props, instance);\r\n }\r\n if (isStateful) {\r\n // stateful\r\n instance.props = isSSR ? props : shallowReactive(props);\r\n }\r\n else {\r\n if (!instance.type.props) {\r\n // functional w/ optional props, props === attrs\r\n instance.props = attrs;\r\n }\r\n else {\r\n // functional w/ declared props\r\n instance.props = props;\r\n }\r\n }\r\n instance.attrs = attrs;\r\n}\r\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\r\n const { props, attrs, vnode: { patchFlag } } = instance;\r\n const rawCurrentProps = toRaw(props);\r\n const [options] = instance.propsOptions;\r\n if (\r\n // always force full diff in dev\r\n // - #1942 if hmr is enabled with sfc component\r\n // - vite#872 non-sfc component used by sfc component\r\n !((process.env.NODE_ENV !== 'production') &&\r\n (instance.type.__hmrId ||\r\n (instance.parent && instance.parent.type.__hmrId))) &&\r\n (optimized || patchFlag > 0) &&\r\n !(patchFlag & 16 /* FULL_PROPS */)) {\r\n if (patchFlag & 8 /* PROPS */) {\r\n // Compiler-generated props & no keys change, just set the updated\r\n // the props.\r\n const propsToUpdate = instance.vnode.dynamicProps;\r\n for (let i = 0; i < propsToUpdate.length; i++) {\r\n const key = propsToUpdate[i];\r\n // PROPS flag guarantees rawProps to be non-null\r\n const value = rawProps[key];\r\n if (options) {\r\n // attr / props separation was done on init and will be consistent\r\n // in this code path, so just check if attrs have it.\r\n if (hasOwn(attrs, key)) {\r\n attrs[key] = value;\r\n }\r\n else {\r\n const camelizedKey = camelize(key);\r\n props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance);\r\n }\r\n }\r\n else {\r\n attrs[key] = value;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // full props update.\r\n setFullProps(instance, rawProps, props, attrs);\r\n // in case of dynamic props, check if we need to delete keys from\r\n // the props object\r\n let kebabKey;\r\n for (const key in rawCurrentProps) {\r\n if (!rawProps ||\r\n // for camelCase\r\n (!hasOwn(rawProps, key) &&\r\n // it's possible the original props was passed in as kebab-case\r\n // and converted to camelCase (#955)\r\n ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))) {\r\n if (options) {\r\n if (rawPrevProps &&\r\n // for camelCase\r\n (rawPrevProps[key] !== undefined ||\r\n // for kebab-case\r\n rawPrevProps[kebabKey] !== undefined)) {\r\n props[key] = resolvePropValue(options, rawProps || EMPTY_OBJ, key, undefined, instance);\r\n }\r\n }\r\n else {\r\n delete props[key];\r\n }\r\n }\r\n }\r\n // in the case of functional component w/o props declaration, props and\r\n // attrs point to the same object so it should already have been updated.\r\n if (attrs !== rawCurrentProps) {\r\n for (const key in attrs) {\r\n if (!rawProps || !hasOwn(rawProps, key)) {\r\n delete attrs[key];\r\n }\r\n }\r\n }\r\n }\r\n // trigger updates for $attrs in case it's used in component slots\r\n trigger(instance, \"set\" /* SET */, '$attrs');\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateProps(rawProps || {}, props, instance);\r\n }\r\n}\r\nfunction setFullProps(instance, rawProps, props, attrs) {\r\n const [options, needCastKeys] = instance.propsOptions;\r\n if (rawProps) {\r\n for (const key in rawProps) {\r\n const value = rawProps[key];\r\n // key, ref are reserved and never passed down\r\n if (isReservedProp(key)) {\r\n continue;\r\n }\r\n // prop option names are camelized during normalization, so to support\r\n // kebab -> camel conversion here we need to camelize the key.\r\n let camelKey;\r\n if (options && hasOwn(options, (camelKey = camelize(key)))) {\r\n props[camelKey] = value;\r\n }\r\n else if (!isEmitListener(instance.emitsOptions, key)) {\r\n // Any non-declared (either as a prop or an emitted event) props are put\r\n // into a separate `attrs` object for spreading. Make sure to preserve\r\n // original key casing\r\n attrs[key] = value;\r\n }\r\n }\r\n }\r\n if (needCastKeys) {\r\n const rawCurrentProps = toRaw(props);\r\n for (let i = 0; i < needCastKeys.length; i++) {\r\n const key = needCastKeys[i];\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);\r\n }\r\n }\r\n}\r\nfunction resolvePropValue(options, props, key, value, instance) {\r\n const opt = options[key];\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default');\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default;\r\n if (opt.type !== Function && isFunction(defaultValue)) {\r\n const { propsDefaults } = instance;\r\n if (key in propsDefaults) {\r\n value = propsDefaults[key];\r\n }\r\n else {\r\n setCurrentInstance(instance);\r\n value = propsDefaults[key] = defaultValue(props);\r\n setCurrentInstance(null);\r\n }\r\n }\r\n else {\r\n value = defaultValue;\r\n }\r\n }\r\n // boolean casting\r\n if (opt[0 /* shouldCast */]) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false;\r\n }\r\n else if (opt[1 /* shouldCastTrue */] &&\r\n (value === '' || value === hyphenate(key))) {\r\n value = true;\r\n }\r\n }\r\n }\r\n return value;\r\n}\r\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\r\n if (!appContext.deopt && comp.__props) {\r\n return comp.__props;\r\n }\r\n const raw = comp.props;\r\n const normalized = {};\r\n const needCastKeys = [];\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\r\n const extendProps = (raw) => {\r\n hasExtends = true;\r\n const [props, keys] = normalizePropsOptions(raw, appContext, true);\r\n extend(normalized, props);\r\n if (keys)\r\n needCastKeys.push(...keys);\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendProps);\r\n }\r\n if (comp.extends) {\r\n extendProps(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendProps);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n return (comp.__props = EMPTY_ARR);\r\n }\r\n if (isArray(raw)) {\r\n for (let i = 0; i < raw.length; i++) {\r\n if ((process.env.NODE_ENV !== 'production') && !isString(raw[i])) {\r\n warn(`props must be strings when using array syntax.`, raw[i]);\r\n }\r\n const normalizedKey = camelize(raw[i]);\r\n if (validatePropName(normalizedKey)) {\r\n normalized[normalizedKey] = EMPTY_OBJ;\r\n }\r\n }\r\n }\r\n else if (raw) {\r\n if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {\r\n warn(`invalid props options`, raw);\r\n }\r\n for (const key in raw) {\r\n const normalizedKey = camelize(key);\r\n if (validatePropName(normalizedKey)) {\r\n const opt = raw[key];\r\n const prop = (normalized[normalizedKey] =\r\n isArray(opt) || isFunction(opt) ? { type: opt } : opt);\r\n if (prop) {\r\n const booleanIndex = getTypeIndex(Boolean, prop.type);\r\n const stringIndex = getTypeIndex(String, prop.type);\r\n prop[0 /* shouldCast */] = booleanIndex > -1;\r\n prop[1 /* shouldCastTrue */] =\r\n stringIndex < 0 || booleanIndex < stringIndex;\r\n // if the prop needs boolean casting or default value\r\n if (booleanIndex > -1 || hasOwn(prop, 'default')) {\r\n needCastKeys.push(normalizedKey);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return (comp.__props = [normalized, needCastKeys]);\r\n}\r\nfunction validatePropName(key) {\r\n if (key[0] !== '$') {\r\n return true;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Invalid prop name: \"${key}\" is a reserved property.`);\r\n }\r\n return false;\r\n}\r\n// use function string name to check type constructors\r\n// so that it works across vms / iframes.\r\nfunction getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}\r\nfunction isSameType(a, b) {\r\n return getType(a) === getType(b);\r\n}\r\nfunction getTypeIndex(type, expectedTypes) {\r\n if (isArray(expectedTypes)) {\r\n return expectedTypes.findIndex(t => isSameType(t, type));\r\n }\r\n else if (isFunction(expectedTypes)) {\r\n return isSameType(expectedTypes, type) ? 0 : -1;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProps(rawProps, props, instance) {\r\n const resolvedValues = toRaw(props);\r\n const options = instance.propsOptions[0];\r\n for (const key in options) {\r\n let opt = options[key];\r\n if (opt == null)\r\n continue;\r\n validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProp(name, value, prop, isAbsent) {\r\n const { type, required, validator } = prop;\r\n // required!\r\n if (required && isAbsent) {\r\n warn('Missing required prop: \"' + name + '\"');\r\n return;\r\n }\r\n // missing but optional\r\n if (value == null && !prop.required) {\r\n return;\r\n }\r\n // type check\r\n if (type != null && type !== true) {\r\n let isValid = false;\r\n const types = isArray(type) ? type : [type];\r\n const expectedTypes = [];\r\n // value is valid as long as one of the specified types match\r\n for (let i = 0; i < types.length && !isValid; i++) {\r\n const { valid, expectedType } = assertType(value, types[i]);\r\n expectedTypes.push(expectedType || '');\r\n isValid = valid;\r\n }\r\n if (!isValid) {\r\n warn(getInvalidTypeMessage(name, value, expectedTypes));\r\n return;\r\n }\r\n }\r\n // custom validator\r\n if (validator && !validator(value)) {\r\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".');\r\n }\r\n}\r\nconst isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');\r\n/**\r\n * dev only\r\n */\r\nfunction assertType(value, type) {\r\n let valid;\r\n const expectedType = getType(type);\r\n if (isSimpleType(expectedType)) {\r\n const t = typeof value;\r\n valid = t === expectedType.toLowerCase();\r\n // for primitive wrapper objects\r\n if (!valid && t === 'object') {\r\n valid = value instanceof type;\r\n }\r\n }\r\n else if (expectedType === 'Object') {\r\n valid = isObject(value);\r\n }\r\n else if (expectedType === 'Array') {\r\n valid = isArray(value);\r\n }\r\n else {\r\n valid = value instanceof type;\r\n }\r\n return {\r\n valid,\r\n expectedType\r\n };\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\r\n let message = `Invalid prop: type check failed for prop \"${name}\".` +\r\n ` Expected ${expectedTypes.map(capitalize).join(', ')}`;\r\n const expectedType = expectedTypes[0];\r\n const receivedType = toRawType(value);\r\n const expectedValue = styleValue(value, expectedType);\r\n const receivedValue = styleValue(value, receivedType);\r\n // check if we need to specify expected value\r\n if (expectedTypes.length === 1 &&\r\n isExplicable(expectedType) &&\r\n !isBoolean(expectedType, receivedType)) {\r\n message += ` with value ${expectedValue}`;\r\n }\r\n message += `, got ${receivedType} `;\r\n // check if we need to specify received value\r\n if (isExplicable(receivedType)) {\r\n message += `with value ${receivedValue}.`;\r\n }\r\n return message;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction styleValue(value, type) {\r\n if (type === 'String') {\r\n return `\"${value}\"`;\r\n }\r\n else if (type === 'Number') {\r\n return `${Number(value)}`;\r\n }\r\n else {\r\n return `${value}`;\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isExplicable(type) {\r\n const explicitTypes = ['string', 'number', 'boolean'];\r\n return explicitTypes.some(elem => type.toLowerCase() === elem);\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isBoolean(...args) {\r\n return args.some(elem => elem.toLowerCase() === 'boolean');\r\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\r\n if (target) {\r\n const hooks = target[type] || (target[type] = []);\r\n // cache the error handling wrapper for injected hooks so the same hook\r\n // can be properly deduped by the scheduler. \"__weh\" stands for \"with error\r\n // handling\".\r\n const wrappedHook = hook.__weh ||\r\n (hook.__weh = (...args) => {\r\n if (target.isUnmounted) {\r\n return;\r\n }\r\n // disable tracking inside all lifecycle hooks\r\n // since they can potentially be called inside effects.\r\n pauseTracking();\r\n // Set currentInstance during hook invocation.\r\n // This assumes the hook does not synchronously trigger other hooks, which\r\n // can only be false when the user does something really funky.\r\n setCurrentInstance(target);\r\n const res = callWithAsyncErrorHandling(hook, target, type, args);\r\n setCurrentInstance(null);\r\n resetTracking();\r\n return res;\r\n });\r\n if (prepend) {\r\n hooks.unshift(wrappedHook);\r\n }\r\n else {\r\n hooks.push(wrappedHook);\r\n }\r\n return wrappedHook;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));\r\n warn(`${apiName} is called when there is no active component instance to be ` +\r\n `associated with. ` +\r\n `Lifecycle injection APIs can only be used during execution of setup().` +\r\n (` If you are using async setup(), make sure to register lifecycle ` +\r\n `hooks before the first await statement.`\r\n ));\r\n }\r\n}\r\nconst createHook = (lifecycle) => (hook, target = currentInstance) => \r\n// post-create lifecycle registrations are noops during SSR\r\n!isInSSRComponentSetup && injectHook(lifecycle, hook, target);\r\nconst onBeforeMount = createHook(\"bm\" /* BEFORE_MOUNT */);\r\nconst onMounted = createHook(\"m\" /* MOUNTED */);\r\nconst onBeforeUpdate = createHook(\"bu\" /* BEFORE_UPDATE */);\r\nconst onUpdated = createHook(\"u\" /* UPDATED */);\r\nconst onBeforeUnmount = createHook(\"bum\" /* BEFORE_UNMOUNT */);\r\nconst onUnmounted = createHook(\"um\" /* UNMOUNTED */);\r\nconst onRenderTriggered = createHook(\"rtg\" /* RENDER_TRIGGERED */);\r\nconst onRenderTracked = createHook(\"rtc\" /* RENDER_TRACKED */);\r\nconst onErrorCaptured = (hook, target = currentInstance) => {\r\n injectHook(\"ec\" /* ERROR_CAPTURED */, hook, target);\r\n};\n\n// Simple effect.\r\nfunction watchEffect(effect, options) {\r\n return doWatch(effect, null, options);\r\n}\r\n// initial value for watchers to trigger on undefined initial values\r\nconst INITIAL_WATCHER_VALUE = {};\r\n// implementation\r\nfunction watch(source, cb, options) {\r\n if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {\r\n warn(`\\`watch(fn, options?)\\` signature has been moved to a separate API. ` +\r\n `Use \\`watchEffect(fn, options?)\\` instead. \\`watch\\` now only ` +\r\n `supports \\`watch(source, cb, options?) signature.`);\r\n }\r\n return doWatch(source, cb, options);\r\n}\r\nfunction doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {\r\n if ((process.env.NODE_ENV !== 'production') && !cb) {\r\n if (immediate !== undefined) {\r\n warn(`watch() \"immediate\" option is only respected when using the ` +\r\n `watch(source, callback, options?) signature.`);\r\n }\r\n if (deep !== undefined) {\r\n warn(`watch() \"deep\" option is only respected when using the ` +\r\n `watch(source, callback, options?) signature.`);\r\n }\r\n }\r\n const warnInvalidSource = (s) => {\r\n warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +\r\n `a reactive object, or an array of these types.`);\r\n };\r\n let getter;\r\n let forceTrigger = false;\r\n if (isRef(source)) {\r\n getter = () => source.value;\r\n forceTrigger = !!source._shallow;\r\n }\r\n else if (isReactive(source)) {\r\n getter = () => source;\r\n deep = true;\r\n }\r\n else if (isArray(source)) {\r\n getter = () => source.map(s => {\r\n if (isRef(s)) {\r\n return s.value;\r\n }\r\n else if (isReactive(s)) {\r\n return traverse(s);\r\n }\r\n else if (isFunction(s)) {\r\n return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */, [\r\n instance && instance.proxy\r\n ]);\r\n }\r\n else {\r\n (process.env.NODE_ENV !== 'production') && warnInvalidSource(s);\r\n }\r\n });\r\n }\r\n else if (isFunction(source)) {\r\n if (cb) {\r\n // getter with cb\r\n getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */, [\r\n instance && instance.proxy\r\n ]);\r\n }\r\n else {\r\n // no cb -> simple effect\r\n getter = () => {\r\n if (instance && instance.isUnmounted) {\r\n return;\r\n }\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);\r\n };\r\n }\r\n }\r\n else {\r\n getter = NOOP;\r\n (process.env.NODE_ENV !== 'production') && warnInvalidSource(source);\r\n }\r\n if (cb && deep) {\r\n const baseGetter = getter;\r\n getter = () => traverse(baseGetter());\r\n }\r\n let cleanup;\r\n let onInvalidate = (fn) => {\r\n cleanup = runner.options.onStop = () => {\r\n callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\r\n };\r\n };\r\n let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;\r\n const job = () => {\r\n if (!runner.active) {\r\n return;\r\n }\r\n if (cb) {\r\n // watch(source, cb)\r\n const newValue = runner();\r\n if (deep || forceTrigger || hasChanged(newValue, oldValue)) {\r\n // cleanup before running cb again\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\r\n newValue,\r\n // pass undefined as the old value when it's changed for the first time\r\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\r\n onInvalidate\r\n ]);\r\n oldValue = newValue;\r\n }\r\n }\r\n else {\r\n // watchEffect\r\n runner();\r\n }\r\n };\r\n // important: mark the job as a watcher callback so that scheduler knows\r\n // it is allowed to self-trigger (#1727)\r\n job.allowRecurse = !!cb;\r\n let scheduler;\r\n if (flush === 'sync') {\r\n scheduler = job;\r\n }\r\n else if (flush === 'post') {\r\n scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\r\n }\r\n else {\r\n // default: 'pre'\r\n scheduler = () => {\r\n if (!instance || instance.isMounted) {\r\n queuePreFlushCb(job);\r\n }\r\n else {\r\n // with 'pre' option, the first call must happen before\r\n // the component is mounted so it is called synchronously.\r\n job();\r\n }\r\n };\r\n }\r\n const runner = effect(getter, {\r\n lazy: true,\r\n onTrack,\r\n onTrigger,\r\n scheduler\r\n });\r\n recordInstanceBoundEffect(runner, instance);\r\n // initial run\r\n if (cb) {\r\n if (immediate) {\r\n job();\r\n }\r\n else {\r\n oldValue = runner();\r\n }\r\n }\r\n else if (flush === 'post') {\r\n queuePostRenderEffect(runner, instance && instance.suspense);\r\n }\r\n else {\r\n runner();\r\n }\r\n return () => {\r\n stop(runner);\r\n if (instance) {\r\n remove(instance.effects, runner);\r\n }\r\n };\r\n}\r\n// this.$watch\r\nfunction instanceWatch(source, cb, options) {\r\n const publicThis = this.proxy;\r\n const getter = isString(source)\r\n ? () => publicThis[source]\r\n : source.bind(publicThis);\r\n return doWatch(getter, cb.bind(publicThis), options, this);\r\n}\r\nfunction traverse(value, seen = new Set()) {\r\n if (!isObject(value) || seen.has(value)) {\r\n return value;\r\n }\r\n seen.add(value);\r\n if (isRef(value)) {\r\n traverse(value.value, seen);\r\n }\r\n else if (isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n traverse(value[i], seen);\r\n }\r\n }\r\n else if (isSet(value) || isMap(value)) {\r\n value.forEach((v) => {\r\n traverse(v, seen);\r\n });\r\n }\r\n else {\r\n for (const key in value) {\r\n traverse(value[key], seen);\r\n }\r\n }\r\n return value;\r\n}\n\nfunction useTransitionState() {\r\n const state = {\r\n isMounted: false,\r\n isLeaving: false,\r\n isUnmounting: false,\r\n leavingVNodes: new Map()\r\n };\r\n onMounted(() => {\r\n state.isMounted = true;\r\n });\r\n onBeforeUnmount(() => {\r\n state.isUnmounting = true;\r\n });\r\n return state;\r\n}\r\nconst TransitionHookValidator = [Function, Array];\r\nconst BaseTransitionImpl = {\r\n name: `BaseTransition`,\r\n props: {\r\n mode: String,\r\n appear: Boolean,\r\n persisted: Boolean,\r\n // enter\r\n onBeforeEnter: TransitionHookValidator,\r\n onEnter: TransitionHookValidator,\r\n onAfterEnter: TransitionHookValidator,\r\n onEnterCancelled: TransitionHookValidator,\r\n // leave\r\n onBeforeLeave: TransitionHookValidator,\r\n onLeave: TransitionHookValidator,\r\n onAfterLeave: TransitionHookValidator,\r\n onLeaveCancelled: TransitionHookValidator,\r\n // appear\r\n onBeforeAppear: TransitionHookValidator,\r\n onAppear: TransitionHookValidator,\r\n onAfterAppear: TransitionHookValidator,\r\n onAppearCancelled: TransitionHookValidator\r\n },\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevTransitionKey;\r\n return () => {\r\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\r\n if (!children || !children.length) {\r\n return;\r\n }\r\n // warn multiple elements\r\n if ((process.env.NODE_ENV !== 'production') && children.length > 1) {\r\n warn('<transition> can only be used on a single element or component. Use ' +\r\n '<transition-group> for lists.');\r\n }\r\n // there's no need to track reactivity for these props so use the raw\r\n // props for a bit better perf\r\n const rawProps = toRaw(props);\r\n const { mode } = rawProps;\r\n // check mode\r\n if ((process.env.NODE_ENV !== 'production') && mode && !['in-out', 'out-in', 'default'].includes(mode)) {\r\n warn(`invalid <transition> mode: ${mode}`);\r\n }\r\n // at this point children has a guaranteed length of 1.\r\n const child = children[0];\r\n if (state.isLeaving) {\r\n return emptyPlaceholder(child);\r\n }\r\n // in the case of <transition><keep-alive/></transition>, we need to\r\n // compare the type of the kept-alive children.\r\n const innerChild = getKeepAliveChild(child);\r\n if (!innerChild) {\r\n return emptyPlaceholder(child);\r\n }\r\n const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);\r\n setTransitionHooks(innerChild, enterHooks);\r\n const oldChild = instance.subTree;\r\n const oldInnerChild = oldChild && getKeepAliveChild(oldChild);\r\n let transitionKeyChanged = false;\r\n const { getTransitionKey } = innerChild.type;\r\n if (getTransitionKey) {\r\n const key = getTransitionKey();\r\n if (prevTransitionKey === undefined) {\r\n prevTransitionKey = key;\r\n }\r\n else if (key !== prevTransitionKey) {\r\n prevTransitionKey = key;\r\n transitionKeyChanged = true;\r\n }\r\n }\r\n // handle mode\r\n if (oldInnerChild &&\r\n oldInnerChild.type !== Comment &&\r\n (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {\r\n const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);\r\n // update old tree's hooks in case of dynamic transition\r\n setTransitionHooks(oldInnerChild, leavingHooks);\r\n // switching between different views\r\n if (mode === 'out-in') {\r\n state.isLeaving = true;\r\n // return placeholder node and queue update when leave finishes\r\n leavingHooks.afterLeave = () => {\r\n state.isLeaving = false;\r\n instance.update();\r\n };\r\n return emptyPlaceholder(child);\r\n }\r\n else if (mode === 'in-out' && innerChild.type !== Comment) {\r\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\r\n const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);\r\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\r\n // early removal callback\r\n el._leaveCb = () => {\r\n earlyRemove();\r\n el._leaveCb = undefined;\r\n delete enterHooks.delayedLeave;\r\n };\r\n enterHooks.delayedLeave = delayedLeave;\r\n };\r\n }\r\n }\r\n return child;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst BaseTransition = BaseTransitionImpl;\r\nfunction getLeavingNodesForType(state, vnode) {\r\n const { leavingVNodes } = state;\r\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\r\n if (!leavingVNodesCache) {\r\n leavingVNodesCache = Object.create(null);\r\n leavingVNodes.set(vnode.type, leavingVNodesCache);\r\n }\r\n return leavingVNodesCache;\r\n}\r\n// The transition hooks are attached to the vnode as vnode.transition\r\n// and will be called at appropriate timing in the renderer.\r\nfunction resolveTransitionHooks(vnode, props, state, instance) {\r\n const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;\r\n const key = String(vnode.key);\r\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\r\n const callHook = (hook, args) => {\r\n hook &&\r\n callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);\r\n };\r\n const hooks = {\r\n mode,\r\n persisted,\r\n beforeEnter(el) {\r\n let hook = onBeforeEnter;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onBeforeAppear || onBeforeEnter;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n // for same element (v-show)\r\n if (el._leaveCb) {\r\n el._leaveCb(true /* cancelled */);\r\n }\r\n // for toggled element with same key (v-if)\r\n const leavingVNode = leavingVNodesCache[key];\r\n if (leavingVNode &&\r\n isSameVNodeType(vnode, leavingVNode) &&\r\n leavingVNode.el._leaveCb) {\r\n // force early removal (not cancelled)\r\n leavingVNode.el._leaveCb();\r\n }\r\n callHook(hook, [el]);\r\n },\r\n enter(el) {\r\n let hook = onEnter;\r\n let afterHook = onAfterEnter;\r\n let cancelHook = onEnterCancelled;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onAppear || onEnter;\r\n afterHook = onAfterAppear || onAfterEnter;\r\n cancelHook = onAppearCancelled || onEnterCancelled;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n let called = false;\r\n const done = (el._enterCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n if (cancelled) {\r\n callHook(cancelHook, [el]);\r\n }\r\n else {\r\n callHook(afterHook, [el]);\r\n }\r\n if (hooks.delayedLeave) {\r\n hooks.delayedLeave();\r\n }\r\n el._enterCb = undefined;\r\n });\r\n if (hook) {\r\n hook(el, done);\r\n if (hook.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n leave(el, remove) {\r\n const key = String(vnode.key);\r\n if (el._enterCb) {\r\n el._enterCb(true /* cancelled */);\r\n }\r\n if (state.isUnmounting) {\r\n return remove();\r\n }\r\n callHook(onBeforeLeave, [el]);\r\n let called = false;\r\n const done = (el._leaveCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n remove();\r\n if (cancelled) {\r\n callHook(onLeaveCancelled, [el]);\r\n }\r\n else {\r\n callHook(onAfterLeave, [el]);\r\n }\r\n el._leaveCb = undefined;\r\n if (leavingVNodesCache[key] === vnode) {\r\n delete leavingVNodesCache[key];\r\n }\r\n });\r\n leavingVNodesCache[key] = vnode;\r\n if (onLeave) {\r\n onLeave(el, done);\r\n if (onLeave.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n clone(vnode) {\r\n return resolveTransitionHooks(vnode, props, state, instance);\r\n }\r\n };\r\n return hooks;\r\n}\r\n// the placeholder really only handles one special case: KeepAlive\r\n// in the case of a KeepAlive in a leave phase we need to return a KeepAlive\r\n// placeholder with empty content to avoid the KeepAlive instance from being\r\n// unmounted.\r\nfunction emptyPlaceholder(vnode) {\r\n if (isKeepAlive(vnode)) {\r\n vnode = cloneVNode(vnode);\r\n vnode.children = null;\r\n return vnode;\r\n }\r\n}\r\nfunction getKeepAliveChild(vnode) {\r\n return isKeepAlive(vnode)\r\n ? vnode.children\r\n ? vnode.children[0]\r\n : undefined\r\n : vnode;\r\n}\r\nfunction setTransitionHooks(vnode, hooks) {\r\n if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {\r\n setTransitionHooks(vnode.component.subTree, hooks);\r\n }\r\n else if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\r\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\r\n }\r\n else {\r\n vnode.transition = hooks;\r\n }\r\n}\r\nfunction getTransitionRawChildren(children, keepComment = false) {\r\n let ret = [];\r\n let keyedFragmentCount = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n // handle fragment children case, e.g. v-for\r\n if (child.type === Fragment) {\r\n if (child.patchFlag & 128 /* KEYED_FRAGMENT */)\r\n keyedFragmentCount++;\r\n ret = ret.concat(getTransitionRawChildren(child.children, keepComment));\r\n }\r\n // comment placeholders should be skipped, e.g. v-if\r\n else if (keepComment || child.type !== Comment) {\r\n ret.push(child);\r\n }\r\n }\r\n // #1126 if a transition children list contains multiple sub fragments, these\r\n // fragments will be merged into a flat children array. Since each v-for\r\n // fragment may contain different static bindings inside, we need to de-op\r\n // these children to force full diffs to ensure correct behavior.\r\n if (keyedFragmentCount > 1) {\r\n for (let i = 0; i < ret.length; i++) {\r\n ret[i].patchFlag = -2 /* BAIL */;\r\n }\r\n }\r\n return ret;\r\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\r\nconst KeepAliveImpl = {\r\n name: `KeepAlive`,\r\n // Marker for special handling inside the renderer. We are not using a ===\r\n // check directly on KeepAlive in the renderer, because importing it directly\r\n // would prevent it from being tree-shaken.\r\n __isKeepAlive: true,\r\n props: {\r\n include: [String, RegExp, Array],\r\n exclude: [String, RegExp, Array],\r\n max: [String, Number]\r\n },\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n // KeepAlive communicates with the instantiated renderer via the\r\n // ctx where the renderer passes in its internals,\r\n // and the KeepAlive instance exposes activate/deactivate implementations.\r\n // The whole point of this is to avoid importing KeepAlive directly in the\r\n // renderer to facilitate tree-shaking.\r\n const sharedContext = instance.ctx;\r\n // if the internal renderer is not registered, it indicates that this is server-side rendering,\r\n // for KeepAlive, we just need to render its children\r\n if (!sharedContext.renderer) {\r\n return slots.default;\r\n }\r\n const cache = new Map();\r\n const keys = new Set();\r\n let current = null;\r\n const parentSuspense = instance.suspense;\r\n const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext;\r\n const storageContainer = createElement('div');\r\n sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {\r\n const instance = vnode.component;\r\n move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);\r\n // in case props have changed\r\n patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);\r\n queuePostRenderEffect(() => {\r\n instance.isDeactivated = false;\r\n if (instance.a) {\r\n invokeArrayFns(instance.a);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n }, parentSuspense);\r\n };\r\n sharedContext.deactivate = (vnode) => {\r\n const instance = vnode.component;\r\n move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);\r\n queuePostRenderEffect(() => {\r\n if (instance.da) {\r\n invokeArrayFns(instance.da);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n instance.isDeactivated = true;\r\n }, parentSuspense);\r\n };\r\n function unmount(vnode) {\r\n // reset the shapeFlag so it can be properly unmounted\r\n resetShapeFlag(vnode);\r\n _unmount(vnode, instance, parentSuspense);\r\n }\r\n function pruneCache(filter) {\r\n cache.forEach((vnode, key) => {\r\n const name = getComponentName(vnode.type);\r\n if (name && (!filter || !filter(name))) {\r\n pruneCacheEntry(key);\r\n }\r\n });\r\n }\r\n function pruneCacheEntry(key) {\r\n const cached = cache.get(key);\r\n if (!current || cached.type !== current.type) {\r\n unmount(cached);\r\n }\r\n else if (current) {\r\n // current active instance should no longer be kept-alive.\r\n // we can't unmount it now but it might be later, so reset its flag now.\r\n resetShapeFlag(current);\r\n }\r\n cache.delete(key);\r\n keys.delete(key);\r\n }\r\n // prune cache on include/exclude prop change\r\n watch(() => [props.include, props.exclude], ([include, exclude]) => {\r\n include && pruneCache(name => matches(include, name));\r\n exclude && pruneCache(name => !matches(exclude, name));\r\n }, \r\n // prune post-render after `current` has been updated\r\n { flush: 'post', deep: true });\r\n // cache sub tree after render\r\n let pendingCacheKey = null;\r\n const cacheSubtree = () => {\r\n // fix #1621, the pendingCacheKey could be 0\r\n if (pendingCacheKey != null) {\r\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\r\n }\r\n };\r\n onMounted(cacheSubtree);\r\n onUpdated(cacheSubtree);\r\n onBeforeUnmount(() => {\r\n cache.forEach(cached => {\r\n const { subTree, suspense } = instance;\r\n const vnode = getInnerChild(subTree);\r\n if (cached.type === vnode.type) {\r\n // current instance will be unmounted as part of keep-alive's unmount\r\n resetShapeFlag(vnode);\r\n // but invoke its deactivated hook here\r\n const da = vnode.component.da;\r\n da && queuePostRenderEffect(da, suspense);\r\n return;\r\n }\r\n unmount(cached);\r\n });\r\n });\r\n return () => {\r\n pendingCacheKey = null;\r\n if (!slots.default) {\r\n return null;\r\n }\r\n const children = slots.default();\r\n const rawVNode = children[0];\r\n if (children.length > 1) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`KeepAlive should contain exactly one component child.`);\r\n }\r\n current = null;\r\n return children;\r\n }\r\n else if (!isVNode(rawVNode) ||\r\n (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&\r\n !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {\r\n current = null;\r\n return rawVNode;\r\n }\r\n let vnode = getInnerChild(rawVNode);\r\n const comp = vnode.type;\r\n const name = getComponentName(comp);\r\n const { include, exclude, max } = props;\r\n if ((include && (!name || !matches(include, name))) ||\r\n (exclude && name && matches(exclude, name))) {\r\n current = vnode;\r\n return rawVNode;\r\n }\r\n const key = vnode.key == null ? comp : vnode.key;\r\n const cachedVNode = cache.get(key);\r\n // clone vnode if it's reused because we are going to mutate it\r\n if (vnode.el) {\r\n vnode = cloneVNode(vnode);\r\n if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {\r\n rawVNode.ssContent = vnode;\r\n }\r\n }\r\n // #1513 it's possible for the returned vnode to be cloned due to attr\r\n // fallthrough or scopeId, so the vnode here may not be the final vnode\r\n // that is mounted. Instead of caching it directly, we store the pending\r\n // key and cache `instance.subTree` (the normalized vnode) in\r\n // beforeMount/beforeUpdate hooks.\r\n pendingCacheKey = key;\r\n if (cachedVNode) {\r\n // copy over mounted state\r\n vnode.el = cachedVNode.el;\r\n vnode.component = cachedVNode.component;\r\n if (vnode.transition) {\r\n // recursively update transition hooks on subTree\r\n setTransitionHooks(vnode, vnode.transition);\r\n }\r\n // avoid vnode being mounted as fresh\r\n vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;\r\n // make this key the freshest\r\n keys.delete(key);\r\n keys.add(key);\r\n }\r\n else {\r\n keys.add(key);\r\n // prune oldest entry\r\n if (max && keys.size > parseInt(max, 10)) {\r\n pruneCacheEntry(keys.values().next().value);\r\n }\r\n }\r\n // avoid vnode being unmounted\r\n vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n current = vnode;\r\n return rawVNode;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst KeepAlive = KeepAliveImpl;\r\nfunction matches(pattern, name) {\r\n if (isArray(pattern)) {\r\n return pattern.some((p) => matches(p, name));\r\n }\r\n else if (isString(pattern)) {\r\n return pattern.split(',').indexOf(name) > -1;\r\n }\r\n else if (pattern.test) {\r\n return pattern.test(name);\r\n }\r\n /* istanbul ignore next */\r\n return false;\r\n}\r\nfunction onActivated(hook, target) {\r\n registerKeepAliveHook(hook, \"a\" /* ACTIVATED */, target);\r\n}\r\nfunction onDeactivated(hook, target) {\r\n registerKeepAliveHook(hook, \"da\" /* DEACTIVATED */, target);\r\n}\r\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\r\n // cache the deactivate branch check wrapper for injected hooks so the same\r\n // hook can be properly deduped by the scheduler. \"__wdc\" stands for \"with\r\n // deactivation check\".\r\n const wrappedHook = hook.__wdc ||\r\n (hook.__wdc = () => {\r\n // only fire the hook if the target instance is NOT in a deactivated branch.\r\n let current = target;\r\n while (current) {\r\n if (current.isDeactivated) {\r\n return;\r\n }\r\n current = current.parent;\r\n }\r\n hook();\r\n });\r\n injectHook(type, wrappedHook, target);\r\n // In addition to registering it on the target instance, we walk up the parent\r\n // chain and register it on all ancestor instances that are keep-alive roots.\r\n // This avoids the need to walk the entire component tree when invoking these\r\n // hooks, and more importantly, avoids the need to track child components in\r\n // arrays.\r\n if (target) {\r\n let current = target.parent;\r\n while (current && current.parent) {\r\n if (isKeepAlive(current.parent.vnode)) {\r\n injectToKeepAliveRoot(wrappedHook, type, target, current);\r\n }\r\n current = current.parent;\r\n }\r\n }\r\n}\r\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\r\n // injectHook wraps the original for error handling, so make sure to remove\r\n // the wrapped version.\r\n const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);\r\n onUnmounted(() => {\r\n remove(keepAliveRoot[type], injected);\r\n }, target);\r\n}\r\nfunction resetShapeFlag(vnode) {\r\n let shapeFlag = vnode.shapeFlag;\r\n if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n }\r\n if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\r\n shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;\r\n }\r\n vnode.shapeFlag = shapeFlag;\r\n}\r\nfunction getInnerChild(vnode) {\r\n return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;\r\n}\n\nconst isInternalKey = (key) => key[0] === '_' || key === '$stable';\r\nconst normalizeSlotValue = (value) => isArray(value)\r\n ? value.map(normalizeVNode)\r\n : [normalizeVNode(value)];\r\nconst normalizeSlot = (key, rawSlot, ctx) => withCtx((props) => {\r\n if ((process.env.NODE_ENV !== 'production') && currentInstance) {\r\n warn(`Slot \"${key}\" invoked outside of the render function: ` +\r\n `this will not track dependencies used in the slot. ` +\r\n `Invoke the slot function inside the render function instead.`);\r\n }\r\n return normalizeSlotValue(rawSlot(props));\r\n}, ctx);\r\nconst normalizeObjectSlots = (rawSlots, slots) => {\r\n const ctx = rawSlots._ctx;\r\n for (const key in rawSlots) {\r\n if (isInternalKey(key))\r\n continue;\r\n const value = rawSlots[key];\r\n if (isFunction(value)) {\r\n slots[key] = normalizeSlot(key, value, ctx);\r\n }\r\n else if (value != null) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Non-function value encountered for slot \"${key}\". ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(value);\r\n slots[key] = () => normalized;\r\n }\r\n }\r\n};\r\nconst normalizeVNodeSlots = (instance, children) => {\r\n if ((process.env.NODE_ENV !== 'production') && !isKeepAlive(instance.vnode)) {\r\n warn(`Non-function value encountered for default slot. ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(children);\r\n instance.slots.default = () => normalized;\r\n};\r\nconst initSlots = (instance, children) => {\r\n if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n instance.slots = children;\r\n // make compiler marker non-enumerable\r\n def(children, '_', type);\r\n }\r\n else {\r\n normalizeObjectSlots(children, (instance.slots = {}));\r\n }\r\n }\r\n else {\r\n instance.slots = {};\r\n if (children) {\r\n normalizeVNodeSlots(instance, children);\r\n }\r\n }\r\n def(instance.slots, InternalObjectKey, 1);\r\n};\r\nconst updateSlots = (instance, children, optimized) => {\r\n const { vnode, slots } = instance;\r\n let needDeletionCheck = true;\r\n let deletionComparisonTarget = EMPTY_OBJ;\r\n if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n // compiled slots.\r\n if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {\r\n // Parent was HMR updated so slot content may have changed.\r\n // force update slots and mark instance for hmr as well\r\n extend(slots, children);\r\n }\r\n else if (optimized && type === 1 /* STABLE */) {\r\n // compiled AND stable.\r\n // no need to update, and skip stale slots removal.\r\n needDeletionCheck = false;\r\n }\r\n else {\r\n // compiled but dynamic (v-if/v-for on slots) - update slots, but skip\r\n // normalization.\r\n extend(slots, children);\r\n // #2893\r\n // when rendering the optimized slots by manually written render function,\r\n // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,\r\n // i.e. let the `renderSlot` create the bailed Fragment\r\n if (!optimized && type === 1 /* STABLE */) {\r\n delete slots._;\r\n }\r\n }\r\n }\r\n else {\r\n needDeletionCheck = !children.$stable;\r\n normalizeObjectSlots(children, slots);\r\n }\r\n deletionComparisonTarget = children;\r\n }\r\n else if (children) {\r\n // non slot object children (direct value) passed to a component\r\n normalizeVNodeSlots(instance, children);\r\n deletionComparisonTarget = { default: 1 };\r\n }\r\n // delete stale slots\r\n if (needDeletionCheck) {\r\n for (const key in slots) {\r\n if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\r\n delete slots[key];\r\n }\r\n }\r\n }\r\n};\n\n/**\r\nRuntime helper for applying directives to a vnode. Example usage:\r\n\nconst comp = resolveComponent('comp')\r\nconst foo = resolveDirective('foo')\r\nconst bar = resolveDirective('bar')\r\n\nreturn withDirectives(h(comp), [\r\n [foo, this.x],\r\n [bar, this.y]\r\n])\r\n*/\r\nconst isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');\r\nfunction validateDirectiveName(name) {\r\n if (isBuiltInDirective(name)) {\r\n warn('Do not use built-in directive ids as custom directive id: ' + name);\r\n }\r\n}\r\n/**\r\n * Adds directives to a VNode.\r\n */\r\nfunction withDirectives(vnode, directives) {\r\n const internalInstance = currentRenderingInstance;\r\n if (internalInstance === null) {\r\n (process.env.NODE_ENV !== 'production') && warn(`withDirectives can only be used inside render functions.`);\r\n return vnode;\r\n }\r\n const instance = internalInstance.proxy;\r\n const bindings = vnode.dirs || (vnode.dirs = []);\r\n for (let i = 0; i < directives.length; i++) {\r\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\r\n if (isFunction(dir)) {\r\n dir = {\r\n mounted: dir,\r\n updated: dir\r\n };\r\n }\r\n bindings.push({\r\n dir,\r\n instance,\r\n value,\r\n oldValue: void 0,\r\n arg,\r\n modifiers\r\n });\r\n }\r\n return vnode;\r\n}\r\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\r\n const bindings = vnode.dirs;\r\n const oldBindings = prevVNode && prevVNode.dirs;\r\n for (let i = 0; i < bindings.length; i++) {\r\n const binding = bindings[i];\r\n if (oldBindings) {\r\n binding.oldValue = oldBindings[i].value;\r\n }\r\n const hook = binding.dir[name];\r\n if (hook) {\r\n callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\r\n vnode.el,\r\n binding,\r\n vnode,\r\n prevVNode\r\n ]);\r\n }\r\n }\r\n}\n\nfunction createAppContext() {\r\n return {\r\n app: null,\r\n config: {\r\n isNativeTag: NO,\r\n performance: false,\r\n globalProperties: {},\r\n optionMergeStrategies: {},\r\n isCustomElement: NO,\r\n errorHandler: undefined,\r\n warnHandler: undefined\r\n },\r\n mixins: [],\r\n components: {},\r\n directives: {},\r\n provides: Object.create(null)\r\n };\r\n}\r\nlet uid = 0;\r\nfunction createAppAPI(render, hydrate) {\r\n return function createApp(rootComponent, rootProps = null) {\r\n if (rootProps != null && !isObject(rootProps)) {\r\n (process.env.NODE_ENV !== 'production') && warn(`root props passed to app.mount() must be an object.`);\r\n rootProps = null;\r\n }\r\n const context = createAppContext();\r\n const installedPlugins = new Set();\r\n let isMounted = false;\r\n const app = (context.app = {\r\n _uid: uid++,\r\n _component: rootComponent,\r\n _props: rootProps,\r\n _container: null,\r\n _context: context,\r\n version,\r\n get config() {\r\n return context.config;\r\n },\r\n set config(v) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`app.config cannot be replaced. Modify individual options instead.`);\r\n }\r\n },\r\n use(plugin, ...options) {\r\n if (installedPlugins.has(plugin)) {\r\n (process.env.NODE_ENV !== 'production') && warn(`Plugin has already been applied to target app.`);\r\n }\r\n else if (plugin && isFunction(plugin.install)) {\r\n installedPlugins.add(plugin);\r\n plugin.install(app, ...options);\r\n }\r\n else if (isFunction(plugin)) {\r\n installedPlugins.add(plugin);\r\n plugin(app, ...options);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`A plugin must either be a function or an object with an \"install\" ` +\r\n `function.`);\r\n }\r\n return app;\r\n },\r\n mixin(mixin) {\r\n if (__VUE_OPTIONS_API__) {\r\n if (!context.mixins.includes(mixin)) {\r\n context.mixins.push(mixin);\r\n // global mixin with props/emits de-optimizes props/emits\r\n // normalization caching.\r\n if (mixin.props || mixin.emits) {\r\n context.deopt = true;\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Mixin has already been applied to target app' +\r\n (mixin.name ? `: ${mixin.name}` : ''));\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Mixins are only available in builds supporting Options API');\r\n }\r\n return app;\r\n },\r\n component(name, component) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateComponentName(name, context.config);\r\n }\r\n if (!component) {\r\n return context.components[name];\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && context.components[name]) {\r\n warn(`Component \"${name}\" has already been registered in target app.`);\r\n }\r\n context.components[name] = component;\r\n return app;\r\n },\r\n directive(name, directive) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateDirectiveName(name);\r\n }\r\n if (!directive) {\r\n return context.directives[name];\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && context.directives[name]) {\r\n warn(`Directive \"${name}\" has already been registered in target app.`);\r\n }\r\n context.directives[name] = directive;\r\n return app;\r\n },\r\n mount(rootContainer, isHydrate, isSVG) {\r\n if (!isMounted) {\r\n const vnode = createVNode(rootComponent, rootProps);\r\n // store app context on the root VNode.\r\n // this will be set on the root instance on initial mount.\r\n vnode.appContext = context;\r\n // HMR root reload\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n context.reload = () => {\r\n render(cloneVNode(vnode), rootContainer, isSVG);\r\n };\r\n }\r\n if (isHydrate && hydrate) {\r\n hydrate(vnode, rootContainer);\r\n }\r\n else {\r\n render(vnode, rootContainer, isSVG);\r\n }\r\n isMounted = true;\r\n app._container = rootContainer;\r\n rootContainer.__vue_app__ = app;\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsInitApp(app, version);\r\n }\r\n return vnode.component.proxy;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`App has already been mounted.\\n` +\r\n `If you want to remount the same app, move your app creation logic ` +\r\n `into a factory function and create fresh app instances for each ` +\r\n `mount - e.g. \\`const createMyApp = () => createApp(App)\\``);\r\n }\r\n },\r\n unmount() {\r\n if (isMounted) {\r\n render(null, app._container);\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsUnmountApp(app);\r\n }\r\n delete app._container.__vue_app__;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Cannot unmount an app that is not mounted.`);\r\n }\r\n },\r\n provide(key, value) {\r\n if ((process.env.NODE_ENV !== 'production') && key in context.provides) {\r\n warn(`App already provides property with key \"${String(key)}\". ` +\r\n `It will be overwritten with the new value.`);\r\n }\r\n // TypeScript doesn't allow symbols as index type\r\n // https://github.com/Microsoft/TypeScript/issues/24587\r\n context.provides[key] = value;\r\n return app;\r\n }\r\n });\r\n return app;\r\n };\r\n}\n\nlet hasMismatch = false;\r\nconst isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';\r\nconst isComment = (node) => node.nodeType === 8 /* COMMENT */;\r\n// Note: hydration is DOM-specific\r\n// But we have to place it in core due to tight coupling with core - splitting\r\n// it out creates a ton of unnecessary complexity.\r\n// Hydration also depends on some renderer internal logic which needs to be\r\n// passed in via arguments.\r\nfunction createHydrationFunctions(rendererInternals) {\r\n const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;\r\n const hydrate = (vnode, container) => {\r\n if ((process.env.NODE_ENV !== 'production') && !container.hasChildNodes()) {\r\n warn(`Attempting to hydrate existing markup but container is empty. ` +\r\n `Performing full mount instead.`);\r\n patch(null, vnode, container);\r\n return;\r\n }\r\n hasMismatch = false;\r\n hydrateNode(container.firstChild, vnode, null, null, null);\r\n flushPostFlushCbs();\r\n if (hasMismatch && !false) {\r\n // this error should show up in production\r\n console.error(`Hydration completed but contains mismatches.`);\r\n }\r\n };\r\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {\r\n const isFragmentStart = isComment(node) && node.data === '[';\r\n const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);\r\n const { type, ref, shapeFlag } = vnode;\r\n const domType = node.nodeType;\r\n vnode.el = node;\r\n let nextNode = null;\r\n switch (type) {\r\n case Text:\r\n if (domType !== 3 /* TEXT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n if (node.data !== vnode.children) {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration text mismatch:` +\r\n `\\n- Client: ${JSON.stringify(node.data)}` +\r\n `\\n- Server: ${JSON.stringify(vnode.children)}`);\r\n node.data = vnode.children;\r\n }\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Comment:\r\n if (domType !== 8 /* COMMENT */ || isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Static:\r\n if (domType !== 1 /* ELEMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n // determine anchor, adopt content\r\n nextNode = node;\r\n // if the static vnode has its content stripped during build,\r\n // adopt it from the server-rendered HTML.\r\n const needToAdoptContent = !vnode.children.length;\r\n for (let i = 0; i < vnode.staticCount; i++) {\r\n if (needToAdoptContent)\r\n vnode.children += nextNode.outerHTML;\r\n if (i === vnode.staticCount - 1) {\r\n vnode.anchor = nextNode;\r\n }\r\n nextNode = nextSibling(nextNode);\r\n }\r\n return nextNode;\r\n }\r\n break;\r\n case Fragment:\r\n if (!isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n if (domType !== 1 /* ELEMENT */ ||\r\n vnode.type.toLowerCase() !==\r\n node.tagName.toLowerCase()) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n // when setting up the render effect, if the initial vnode already\r\n // has .el set, the component will perform hydration instead of mount\r\n // on its sub-tree.\r\n vnode.slotScopeIds = slotScopeIds;\r\n const container = parentNode(node);\r\n const hydrateComponent = () => {\r\n mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized);\r\n };\r\n // async component\r\n const loadAsync = vnode.type.__asyncLoader;\r\n if (loadAsync) {\r\n loadAsync().then(hydrateComponent);\r\n }\r\n else {\r\n hydrateComponent();\r\n }\r\n // component may be async, so in the case of fragments we cannot rely\r\n // on component's rendered output to determine the end of the fragment\r\n // instead, we do a lookahead to find the end anchor node.\r\n nextNode = isFragmentStart\r\n ? locateClosingAsyncAnchor(node)\r\n : nextSibling(node);\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n if (domType !== 8 /* COMMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);\r\n }\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid HostVNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode);\r\n }\r\n return nextNode;\r\n };\r\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n optimized = optimized || !!vnode.dynamicChildren;\r\n const { props, patchFlag, shapeFlag, dirs } = vnode;\r\n // skip props & children if this is hoisted static nodes\r\n if (patchFlag !== -1 /* HOISTED */) {\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n // props\r\n if (props) {\r\n if (!optimized ||\r\n (patchFlag & 16 /* FULL_PROPS */ ||\r\n patchFlag & 32 /* HYDRATE_EVENTS */)) {\r\n for (const key in props) {\r\n if (!isReservedProp(key) && isOn(key)) {\r\n patchProp(el, key, null, props[key]);\r\n }\r\n }\r\n }\r\n else if (props.onClick) {\r\n // Fast path for click listeners (which is most often) to avoid\r\n // iterating through props.\r\n patchProp(el, 'onClick', null, props.onClick);\r\n }\r\n }\r\n // vnode / directive hooks\r\n let vnodeHooks;\r\n if ((vnodeHooks = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {\r\n queueEffectWithSuspense(() => {\r\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n // children\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&\r\n // skip if element has innerHTML / textContent\r\n !(props && (props.innerHTML || props.textContent))) {\r\n let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n let hasWarned = false;\r\n while (next) {\r\n hasMismatch = true;\r\n if ((process.env.NODE_ENV !== 'production') && !hasWarned) {\r\n warn(`Hydration children mismatch in <${vnode.type}>: ` +\r\n `server rendered element contains more child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n // The SSRed DOM contains more nodes than it should. Remove them.\r\n const cur = next;\r\n next = next.nextSibling;\r\n remove(cur);\r\n }\r\n }\r\n else if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n if (el.textContent !== vnode.children) {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration text content mismatch in <${vnode.type}>:\\n` +\r\n `- Client: ${el.textContent}\\n` +\r\n `- Server: ${vnode.children}`);\r\n el.textContent = vnode.children;\r\n }\r\n }\r\n }\r\n return el.nextSibling;\r\n };\r\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n optimized = optimized || !!parentVNode.dynamicChildren;\r\n const children = parentVNode.children;\r\n const l = children.length;\r\n let hasWarned = false;\r\n for (let i = 0; i < l; i++) {\r\n const vnode = optimized\r\n ? children[i]\r\n : (children[i] = normalizeVNode(children[i]));\r\n if (node) {\r\n node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n else if (vnode.type === Text && !vnode.children) {\r\n continue;\r\n }\r\n else {\r\n hasMismatch = true;\r\n if ((process.env.NODE_ENV !== 'production') && !hasWarned) {\r\n warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +\r\n `server rendered element contains fewer child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n // the SSRed DOM didn't contain enough nodes. Mount the missing ones.\r\n patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n }\r\n }\r\n return node;\r\n };\r\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n const { slotScopeIds: fragmentSlotScopeIds } = vnode;\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n const container = parentNode(node);\r\n const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n if (next && isComment(next) && next.data === ']') {\r\n return nextSibling((vnode.anchor = next));\r\n }\r\n else {\r\n // fragment didn't hydrate successfully, since we didn't get a end anchor\r\n // back. This should have led to node/children mismatch warnings.\r\n hasMismatch = true;\r\n // since the anchor is missing, we need to create one and insert it\r\n insert((vnode.anchor = createComment(`]`)), container, next);\r\n return next;\r\n }\r\n };\r\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration node mismatch:\\n- Client vnode:`, vnode.type, `\\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */\r\n ? `(text)`\r\n : isComment(node) && node.data === '['\r\n ? `(start of fragment)`\r\n : ``);\r\n vnode.el = null;\r\n if (isFragment) {\r\n // remove excessive fragment nodes\r\n const end = locateClosingAsyncAnchor(node);\r\n while (true) {\r\n const next = nextSibling(node);\r\n if (next && next !== end) {\r\n remove(next);\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n const next = nextSibling(node);\r\n const container = parentNode(node);\r\n remove(node);\r\n patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n return next;\r\n };\r\n const locateClosingAsyncAnchor = (node) => {\r\n let match = 0;\r\n while (node) {\r\n node = nextSibling(node);\r\n if (node && isComment(node)) {\r\n if (node.data === '[')\r\n match++;\r\n if (node.data === ']') {\r\n if (match === 0) {\r\n return nextSibling(node);\r\n }\r\n else {\r\n match--;\r\n }\r\n }\r\n }\r\n }\r\n return node;\r\n };\r\n return [hydrate, hydrateNode];\r\n}\n\nlet supported;\r\nlet perf;\r\nfunction startMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n perf.mark(`vue-${type}-${instance.uid}`);\r\n }\r\n}\r\nfunction endMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n const startTag = `vue-${type}-${instance.uid}`;\r\n const endTag = startTag + `:end`;\r\n perf.mark(endTag);\r\n perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);\r\n perf.clearMarks(startTag);\r\n perf.clearMarks(endTag);\r\n }\r\n}\r\nfunction isSupported() {\r\n if (supported !== undefined) {\r\n return supported;\r\n }\r\n /* eslint-disable no-restricted-globals */\r\n if (typeof window !== 'undefined' && window.performance) {\r\n supported = true;\r\n perf = window.performance;\r\n }\r\n else {\r\n supported = false;\r\n }\r\n /* eslint-enable no-restricted-globals */\r\n return supported;\r\n}\n\n/**\r\n * This is only called in esm-bundler builds.\r\n * It is called when a renderer is created, in `baseCreateRenderer` so that\r\n * importing runtime-core is side-effects free.\r\n *\r\n * istanbul-ignore-next\r\n */\r\nfunction initFeatureFlags() {\r\n let needWarn = false;\r\n if (typeof __VUE_OPTIONS_API__ !== 'boolean') {\r\n needWarn = true;\r\n getGlobalThis().__VUE_OPTIONS_API__ = true;\r\n }\r\n if (typeof __VUE_PROD_DEVTOOLS__ !== 'boolean') {\r\n needWarn = true;\r\n getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && needWarn) {\r\n console.warn(`You are running the esm-bundler build of Vue. It is recommended to ` +\r\n `configure your bundler to explicitly replace feature flag globals ` +\r\n `with boolean literals to get proper tree-shaking in the final bundle. ` +\r\n `See http://link.vuejs.org/feature-flags for more details.`);\r\n }\r\n}\n\n// implementation, close to no-op\r\nfunction defineComponent(options) {\r\n return isFunction(options) ? { setup: options, name: options.name } : options;\r\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\r\nfunction defineAsyncComponent(source) {\r\n if (isFunction(source)) {\r\n source = { loader: source };\r\n }\r\n const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out\r\n suspensible = true, onError: userOnError } = source;\r\n let pendingRequest = null;\r\n let resolvedComp;\r\n let retries = 0;\r\n const retry = () => {\r\n retries++;\r\n pendingRequest = null;\r\n return load();\r\n };\r\n const load = () => {\r\n let thisRequest;\r\n return (pendingRequest ||\r\n (thisRequest = pendingRequest = loader()\r\n .catch(err => {\r\n err = err instanceof Error ? err : new Error(String(err));\r\n if (userOnError) {\r\n return new Promise((resolve, reject) => {\r\n const userRetry = () => resolve(retry());\r\n const userFail = () => reject(err);\r\n userOnError(err, userRetry, userFail, retries + 1);\r\n });\r\n }\r\n else {\r\n throw err;\r\n }\r\n })\r\n .then((comp) => {\r\n if (thisRequest !== pendingRequest && pendingRequest) {\r\n return pendingRequest;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && !comp) {\r\n warn(`Async component loader resolved to undefined. ` +\r\n `If you are using retry(), make sure to return its return value.`);\r\n }\r\n // interop module default\r\n if (comp &&\r\n (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {\r\n comp = comp.default;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && comp && !isObject(comp) && !isFunction(comp)) {\r\n throw new Error(`Invalid async component load result: ${comp}`);\r\n }\r\n resolvedComp = comp;\r\n return comp;\r\n })));\r\n };\r\n return defineComponent({\r\n __asyncLoader: load,\r\n name: 'AsyncComponentWrapper',\r\n setup() {\r\n const instance = currentInstance;\r\n // already resolved\r\n if (resolvedComp) {\r\n return () => createInnerComp(resolvedComp, instance);\r\n }\r\n const onError = (err) => {\r\n pendingRequest = null;\r\n handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);\r\n };\r\n // suspense-controlled or SSR.\r\n if ((suspensible && instance.suspense) ||\r\n (false )) {\r\n return load()\r\n .then(comp => {\r\n return () => createInnerComp(comp, instance);\r\n })\r\n .catch(err => {\r\n onError(err);\r\n return () => errorComponent\r\n ? createVNode(errorComponent, {\r\n error: err\r\n })\r\n : null;\r\n });\r\n }\r\n const loaded = ref(false);\r\n const error = ref();\r\n const delayed = ref(!!delay);\r\n if (delay) {\r\n setTimeout(() => {\r\n delayed.value = false;\r\n }, delay);\r\n }\r\n if (timeout != null) {\r\n setTimeout(() => {\r\n if (!loaded.value && !error.value) {\r\n const err = new Error(`Async component timed out after ${timeout}ms.`);\r\n onError(err);\r\n error.value = err;\r\n }\r\n }, timeout);\r\n }\r\n load()\r\n .then(() => {\r\n loaded.value = true;\r\n })\r\n .catch(err => {\r\n onError(err);\r\n error.value = err;\r\n });\r\n return () => {\r\n if (loaded.value && resolvedComp) {\r\n return createInnerComp(resolvedComp, instance);\r\n }\r\n else if (error.value && errorComponent) {\r\n return createVNode(errorComponent, {\r\n error: error.value\r\n });\r\n }\r\n else if (loadingComponent && !delayed.value) {\r\n return createVNode(loadingComponent);\r\n }\r\n };\r\n }\r\n });\r\n}\r\nfunction createInnerComp(comp, { vnode: { ref, props, children } }) {\r\n const vnode = createVNode(comp, props, children);\r\n // ensure inner component inherits the async wrapper's ref owner\r\n vnode.ref = ref;\r\n return vnode;\r\n}\n\nconst prodEffectOptions = {\r\n scheduler: queueJob,\r\n // #1801, #2043 component render effects should allow recursive updates\r\n allowRecurse: true\r\n};\r\nfunction createDevEffectOptions(instance) {\r\n return {\r\n scheduler: queueJob,\r\n allowRecurse: true,\r\n onTrack: instance.rtc ? e => invokeArrayFns(instance.rtc, e) : void 0,\r\n onTrigger: instance.rtg ? e => invokeArrayFns(instance.rtg, e) : void 0\r\n };\r\n}\r\nconst queuePostRenderEffect = queueEffectWithSuspense\r\n ;\r\nconst setRef = (rawRef, oldRawRef, parentSuspense, vnode) => {\r\n if (isArray(rawRef)) {\r\n rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode));\r\n return;\r\n }\r\n let value;\r\n if (!vnode) {\r\n // means unmount\r\n value = null;\r\n }\r\n else if (isAsyncWrapper(vnode)) {\r\n // when mounting async components, nothing needs to be done,\r\n // because the template ref is forwarded to inner component\r\n return;\r\n }\r\n else if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\r\n value = vnode.component.exposed || vnode.component.proxy;\r\n }\r\n else {\r\n value = vnode.el;\r\n }\r\n const { i: owner, r: ref } = rawRef;\r\n if ((process.env.NODE_ENV !== 'production') && !owner) {\r\n warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +\r\n `A vnode with ref must be created inside the render function.`);\r\n return;\r\n }\r\n const oldRef = oldRawRef && oldRawRef.r;\r\n const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\r\n const setupState = owner.setupState;\r\n // unset old ref\r\n if (oldRef != null && oldRef !== ref) {\r\n if (isString(oldRef)) {\r\n refs[oldRef] = null;\r\n if (hasOwn(setupState, oldRef)) {\r\n setupState[oldRef] = null;\r\n }\r\n }\r\n else if (isRef(oldRef)) {\r\n oldRef.value = null;\r\n }\r\n }\r\n if (isString(ref)) {\r\n const doSet = () => {\r\n refs[ref] = value;\r\n if (hasOwn(setupState, ref)) {\r\n setupState[ref] = value;\r\n }\r\n };\r\n // #1789: for non-null values, set them after render\r\n // null values means this is unmount and it should not overwrite another\r\n // ref with the same key\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isRef(ref)) {\r\n const doSet = () => {\r\n ref.value = value;\r\n };\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isFunction(ref)) {\r\n callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid template ref type:', value, `(${typeof value})`);\r\n }\r\n};\r\n/**\r\n * The createRenderer function accepts two generic arguments:\r\n * HostNode and HostElement, corresponding to Node and Element types in the\r\n * host environment. For example, for runtime-dom, HostNode would be the DOM\r\n * `Node` interface and HostElement would be the DOM `Element` interface.\r\n *\r\n * Custom renderers can pass in the platform specific types like this:\r\n *\r\n * ``` js\r\n * const { render, createApp } = createRenderer<Node, Element>({\r\n * patchProp,\r\n * ...nodeOps\r\n * })\r\n * ```\r\n */\r\nfunction createRenderer(options) {\r\n return baseCreateRenderer(options);\r\n}\r\n// Separate API for creating hydration-enabled renderer.\r\n// Hydration logic is only used when calling this function, making it\r\n// tree-shakable.\r\nfunction createHydrationRenderer(options) {\r\n return baseCreateRenderer(options, createHydrationFunctions);\r\n}\r\n// implementation\r\nfunction baseCreateRenderer(options, createHydrationFns) {\r\n // compile-time feature flags check\r\n {\r\n initFeatureFlags();\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n const target = getGlobalThis();\r\n target.__VUE__ = true;\r\n setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);\r\n }\r\n const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\r\n // Note: functions inside this closure should use `const xxx = () => {}`\r\n // style in order to prevent being inlined by minifiers.\r\n const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false) => {\r\n // patching & not same type, unmount old tree\r\n if (n1 && !isSameVNodeType(n1, n2)) {\r\n anchor = getNextHostNode(n1);\r\n unmount(n1, parentComponent, parentSuspense, true);\r\n n1 = null;\r\n }\r\n if (n2.patchFlag === -2 /* BAIL */) {\r\n optimized = false;\r\n n2.dynamicChildren = null;\r\n }\r\n const { type, ref, shapeFlag } = n2;\r\n switch (type) {\r\n case Text:\r\n processText(n1, n2, container, anchor);\r\n break;\r\n case Comment:\r\n processCommentNode(n1, n2, container, anchor);\r\n break;\r\n case Static:\r\n if (n1 == null) {\r\n mountStaticNode(n2, container, anchor, isSVG);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n patchStaticNode(n1, n2, container, isSVG);\r\n }\r\n break;\r\n case Fragment:\r\n processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid VNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n // set ref\r\n if (ref != null && parentComponent) {\r\n setRef(ref, n1 && n1.ref, parentSuspense, n2);\r\n }\r\n };\r\n const processText = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\r\n }\r\n else {\r\n const el = (n2.el = n1.el);\r\n if (n2.children !== n1.children) {\r\n hostSetText(el, n2.children);\r\n }\r\n }\r\n };\r\n const processCommentNode = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\r\n }\r\n else {\r\n // there's no support for dynamic comments\r\n n2.el = n1.el;\r\n }\r\n };\r\n const mountStaticNode = (n2, container, anchor, isSVG) => {\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n };\r\n /**\r\n * Dev / HMR only\r\n */\r\n const patchStaticNode = (n1, n2, container, isSVG) => {\r\n // static nodes are only patched during dev for HMR\r\n if (n2.children !== n1.children) {\r\n const anchor = hostNextSibling(n1.anchor);\r\n // remove existing\r\n removeStaticNode(n1);\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n }\r\n else {\r\n n2.el = n1.el;\r\n n2.anchor = n1.anchor;\r\n }\r\n };\r\n const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostInsert(el, container, nextSibling);\r\n el = next;\r\n }\r\n hostInsert(anchor, container, nextSibling);\r\n };\r\n const removeStaticNode = ({ el, anchor }) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostRemove(el);\r\n el = next;\r\n }\r\n hostRemove(anchor);\r\n };\r\n const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n isSVG = isSVG || n2.type === 'svg';\r\n if (n1 == null) {\r\n mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n let el;\r\n let vnodeHook;\r\n const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;\r\n if (!(process.env.NODE_ENV !== 'production') &&\r\n vnode.el &&\r\n hostCloneNode !== undefined &&\r\n patchFlag === -1 /* HOISTED */) {\r\n // If a vnode has non-null el, it means it's being reused.\r\n // Only static vnodes can be reused, so its mounted DOM nodes should be\r\n // exactly the same, and we can simply do a clone here.\r\n // only do this in production since cloned trees cannot be HMR updated.\r\n el = vnode.el = hostCloneNode(vnode.el);\r\n }\r\n else {\r\n el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);\r\n // mount children first, since some props may rely on child content\r\n // being already rendered, e.g. `<select value>`\r\n if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n hostSetElementText(el, vnode.children);\r\n }\r\n else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized || !!vnode.dynamicChildren);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n // props\r\n if (props) {\r\n for (const key in props) {\r\n if (!isReservedProp(key)) {\r\n hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n if ((vnodeHook = props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n }\r\n // scopeId\r\n setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n Object.defineProperty(el, '__vnode', {\r\n value: vnode,\r\n enumerable: false\r\n });\r\n Object.defineProperty(el, '__vueParentComponent', {\r\n value: parentComponent,\r\n enumerable: false\r\n });\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved\r\n // #1689 For inside suspense + suspense resolved case, just call it\r\n const needCallTransitionHooks = (!parentSuspense || (parentSuspense && !parentSuspense.pendingBranch)) &&\r\n transition &&\r\n !transition.persisted;\r\n if (needCallTransitionHooks) {\r\n transition.beforeEnter(el);\r\n }\r\n hostInsert(el, container, anchor);\r\n if ((vnodeHook = props && props.onVnodeMounted) ||\r\n needCallTransitionHooks ||\r\n dirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n needCallTransitionHooks && transition.enter(el);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {\r\n if (scopeId) {\r\n hostSetScopeId(el, scopeId);\r\n }\r\n if (slotScopeIds) {\r\n for (let i = 0; i < slotScopeIds.length; i++) {\r\n hostSetScopeId(el, slotScopeIds[i]);\r\n }\r\n }\r\n if (parentComponent) {\r\n let subTree = parentComponent.subTree;\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n subTree.patchFlag > 0 &&\r\n subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {\r\n subTree =\r\n filterSingleRoot(subTree.children) || subTree;\r\n }\r\n if (vnode === subTree) {\r\n const parentVNode = parentComponent.vnode;\r\n setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);\r\n }\r\n }\r\n };\r\n const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds, start = 0) => {\r\n for (let i = start; i < children.length; i++) {\r\n const child = (children[i] = optimized\r\n ? cloneIfMounted(children[i])\r\n : normalizeVNode(children[i]));\r\n patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds);\r\n }\r\n };\r\n const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n const el = (n2.el = n1.el);\r\n let { patchFlag, dynamicChildren, dirs } = n2;\r\n // #1426 take the old vnode's patch flag into account since user may clone a\r\n // compiler-generated vnode, which de-opts to FULL_PROPS\r\n patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;\r\n const oldProps = n1.props || EMPTY_OBJ;\r\n const newProps = n2.props || EMPTY_OBJ;\r\n let vnodeHook;\r\n if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {\r\n // HMR updated, force full diff\r\n patchFlag = 0;\r\n optimized = false;\r\n dynamicChildren = null;\r\n }\r\n if (patchFlag > 0) {\r\n // the presence of a patchFlag means this element's render code was\r\n // generated by the compiler and can take the fast path.\r\n // in this path old node and new node are guaranteed to have the same shape\r\n // (i.e. at the exact same position in the source template)\r\n if (patchFlag & 16 /* FULL_PROPS */) {\r\n // element props contain dynamic keys, full diff needed\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n else {\r\n // class\r\n // this flag is matched when the element has dynamic class bindings.\r\n if (patchFlag & 2 /* CLASS */) {\r\n if (oldProps.class !== newProps.class) {\r\n hostPatchProp(el, 'class', null, newProps.class, isSVG);\r\n }\r\n }\r\n // style\r\n // this flag is matched when the element has dynamic style bindings\r\n if (patchFlag & 4 /* STYLE */) {\r\n hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);\r\n }\r\n // props\r\n // This flag is matched when the element has dynamic prop/attr bindings\r\n // other than class and style. The keys of dynamic prop/attrs are saved for\r\n // faster iteration.\r\n // Note dynamic keys like :[foo]=\"bar\" will cause this optimization to\r\n // bail out and go through a full diff because we need to unset the old key\r\n if (patchFlag & 8 /* PROPS */) {\r\n // if the flag is present then dynamicProps must be non-null\r\n const propsToUpdate = n2.dynamicProps;\r\n for (let i = 0; i < propsToUpdate.length; i++) {\r\n const key = propsToUpdate[i];\r\n const prev = oldProps[key];\r\n const next = newProps[key];\r\n if (next !== prev ||\r\n (hostForcePatchProp && hostForcePatchProp(el, key))) {\r\n hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n }\r\n // text\r\n // This flag is matched when the element has only dynamic text children.\r\n if (patchFlag & 1 /* TEXT */) {\r\n if (n1.children !== n2.children) {\r\n hostSetElementText(el, n2.children);\r\n }\r\n }\r\n }\r\n else if (!optimized && dynamicChildren == null) {\r\n // unoptimized, full diff\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n const areChildrenSVG = isSVG && n2.type !== 'foreignObject';\r\n if (dynamicChildren) {\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);\r\n if ((process.env.NODE_ENV !== 'production') && parentComponent && parentComponent.type.__hmrId) {\r\n traverseStaticChildren(n1, n2);\r\n }\r\n }\r\n else if (!optimized) {\r\n // full diff\r\n patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);\r\n }\r\n if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated');\r\n }, parentSuspense);\r\n }\r\n };\r\n // The fast path for blocks.\r\n const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {\r\n for (let i = 0; i < newChildren.length; i++) {\r\n const oldVNode = oldChildren[i];\r\n const newVNode = newChildren[i];\r\n // Determine the container (parent element) for the patch.\r\n const container = \r\n // - In the case of a Fragment, we need to provide the actual parent\r\n // of the Fragment itself so it can move its children.\r\n oldVNode.type === Fragment ||\r\n // - In the case of different nodes, there is going to be a replacement\r\n // which also requires the correct parent container\r\n !isSameVNodeType(oldVNode, newVNode) ||\r\n // - In the case of a component, it could contain anything.\r\n oldVNode.shapeFlag & 6 /* COMPONENT */ ||\r\n oldVNode.shapeFlag & 64 /* TELEPORT */\r\n ? hostParentNode(oldVNode.el)\r\n : // In other cases, the parent container is not actually used so we\r\n // just pass the block element here to avoid a DOM parentNode call.\r\n fallbackContainer;\r\n patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);\r\n }\r\n };\r\n const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {\r\n if (oldProps !== newProps) {\r\n for (const key in newProps) {\r\n // empty string is not valid prop\r\n if (isReservedProp(key))\r\n continue;\r\n const next = newProps[key];\r\n const prev = oldProps[key];\r\n if (next !== prev ||\r\n (hostForcePatchProp && hostForcePatchProp(el, key))) {\r\n hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n if (oldProps !== EMPTY_OBJ) {\r\n for (const key in oldProps) {\r\n if (!isReservedProp(key) && !(key in newProps)) {\r\n hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));\r\n const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));\r\n let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\r\n if (patchFlag > 0) {\r\n optimized = true;\r\n }\r\n // check if this is a slot fragment with :slotted scope ids\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {\r\n // HMR updated, force full diff\r\n patchFlag = 0;\r\n optimized = false;\r\n dynamicChildren = null;\r\n }\r\n if (n1 == null) {\r\n hostInsert(fragmentStartAnchor, container, anchor);\r\n hostInsert(fragmentEndAnchor, container, anchor);\r\n // a fragment can only have array children\r\n // since they are either generated by the compiler, or implicitly created\r\n // from arrays.\r\n mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n if (patchFlag > 0 &&\r\n patchFlag & 64 /* STABLE_FRAGMENT */ &&\r\n dynamicChildren &&\r\n // #2715 the previous fragment could've been a BAILed one as a result\r\n // of renderSlot() with no valid children\r\n n1.dynamicChildren) {\r\n // a stable fragment (template root or <template v-for>) doesn't need to\r\n // patch children order, but it may contain dynamicChildren.\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n if ((process.env.NODE_ENV !== 'production') && parentComponent && parentComponent.type.__hmrId) {\r\n traverseStaticChildren(n1, n2);\r\n }\r\n else if (\r\n // #2080 if the stable fragment has a key, it's a <template v-for> that may\r\n // get moved around. Make sure all root level vnodes inherit el.\r\n // #2134 or if it's a component root, it may also get moved around\r\n // as the component is being moved.\r\n n2.key != null ||\r\n (parentComponent && n2 === parentComponent.subTree)) {\r\n traverseStaticChildren(n1, n2, true /* shallow */);\r\n }\r\n }\r\n else {\r\n // keyed / unkeyed, or manual fragments.\r\n // for keyed & unkeyed, since they are compiler generated from v-for,\r\n // each child is guaranteed to be a block so the fragment will never\r\n // have dynamicChildren.\r\n patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n };\r\n const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n n2.slotScopeIds = slotScopeIds;\r\n if (n1 == null) {\r\n if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\r\n parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);\r\n }\r\n else {\r\n mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n }\r\n else {\r\n updateComponent(n1, n2, optimized);\r\n }\r\n };\r\n const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\r\n const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));\r\n if ((process.env.NODE_ENV !== 'production') && instance.type.__hmrId) {\r\n registerHMR(instance);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n pushWarningContext(initialVNode);\r\n startMeasure(instance, `mount`);\r\n }\r\n // inject renderer internals for keepAlive\r\n if (isKeepAlive(initialVNode)) {\r\n instance.ctx.renderer = internals;\r\n }\r\n // resolve props and slots for setup context\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `init`);\r\n }\r\n setupComponent(instance);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `init`);\r\n }\r\n // setup() is async. This component relies on async logic to be resolved\r\n // before proceeding\r\n if (instance.asyncDep) {\r\n parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);\r\n // Give it a placeholder if this is not hydration\r\n // TODO handle self-defined fallback\r\n if (!initialVNode.el) {\r\n const placeholder = (instance.subTree = createVNode(Comment));\r\n processCommentNode(null, placeholder, container, anchor);\r\n }\r\n return;\r\n }\r\n setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n popWarningContext();\r\n endMeasure(instance, `mount`);\r\n }\r\n };\r\n const updateComponent = (n1, n2, optimized) => {\r\n const instance = (n2.component = n1.component);\r\n if (shouldUpdateComponent(n1, n2, optimized)) {\r\n if (instance.asyncDep &&\r\n !instance.asyncResolved) {\r\n // async & still pending - just update props and slots\r\n // since the component's reactive effect for render isn't set-up yet\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n pushWarningContext(n2);\r\n }\r\n updateComponentPreRender(instance, n2, optimized);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n popWarningContext();\r\n }\r\n return;\r\n }\r\n else {\r\n // normal update\r\n instance.next = n2;\r\n // in case the child component is also queued, remove it to avoid\r\n // double updating the same child component in the same flush.\r\n invalidateJob(instance.update);\r\n // instance.update is the reactive effect runner.\r\n instance.update();\r\n }\r\n }\r\n else {\r\n // no update needed. just copy over properties\r\n n2.component = n1.component;\r\n n2.el = n1.el;\r\n instance.vnode = n2;\r\n }\r\n };\r\n const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {\r\n // create reactive effect for rendering\r\n instance.update = effect(function componentEffect() {\r\n if (!instance.isMounted) {\r\n let vnodeHook;\r\n const { el, props } = initialVNode;\r\n const { bm, m, parent } = instance;\r\n // beforeMount hook\r\n if (bm) {\r\n invokeArrayFns(bm);\r\n }\r\n // onVnodeBeforeMount\r\n if ((vnodeHook = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parent, initialVNode);\r\n }\r\n // render\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `render`);\r\n }\r\n const subTree = (instance.subTree = renderComponentRoot(instance));\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `render`);\r\n }\r\n if (el && hydrateNode) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `hydrate`);\r\n }\r\n // vnode has adopted host node - perform hydration instead of mount.\r\n hydrateNode(initialVNode.el, subTree, instance, parentSuspense, null);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `hydrate`);\r\n }\r\n }\r\n else {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `patch`);\r\n }\r\n patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `patch`);\r\n }\r\n initialVNode.el = subTree.el;\r\n }\r\n // mounted hook\r\n if (m) {\r\n queuePostRenderEffect(m, parentSuspense);\r\n }\r\n // onVnodeMounted\r\n if ((vnodeHook = props && props.onVnodeMounted)) {\r\n const scopedInitialVNode = initialVNode;\r\n queuePostRenderEffect(() => {\r\n invokeVNodeHook(vnodeHook, parent, scopedInitialVNode);\r\n }, parentSuspense);\r\n }\r\n // activated hook for keep-alive roots.\r\n // #1742 activated hook must be accessed after first render\r\n // since the hook may be injected by a child keep-alive\r\n const { a } = instance;\r\n if (a &&\r\n initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n queuePostRenderEffect(a, parentSuspense);\r\n }\r\n instance.isMounted = true;\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsComponentAdded(instance);\r\n }\r\n // #2458: deference mount-only object parameters to prevent memleaks\r\n initialVNode = container = anchor = null;\r\n }\r\n else {\r\n // updateComponent\r\n // This is triggered by mutation of component's own state (next: null)\r\n // OR parent calling processComponent (next: VNode)\r\n let { next, bu, u, parent, vnode } = instance;\r\n let originNext = next;\r\n let vnodeHook;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n pushWarningContext(next || instance.vnode);\r\n }\r\n if (next) {\r\n next.el = vnode.el;\r\n updateComponentPreRender(instance, next, optimized);\r\n }\r\n else {\r\n next = vnode;\r\n }\r\n // beforeUpdate hook\r\n if (bu) {\r\n invokeArrayFns(bu);\r\n }\r\n // onVnodeBeforeUpdate\r\n if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parent, next, vnode);\r\n }\r\n // render\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `render`);\r\n }\r\n const nextTree = renderComponentRoot(instance);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `render`);\r\n }\r\n const prevTree = instance.subTree;\r\n instance.subTree = nextTree;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `patch`);\r\n }\r\n patch(prevTree, nextTree, \r\n // parent may have changed if it's in a teleport\r\n hostParentNode(prevTree.el), \r\n // anchor may have changed if it's in a fragment\r\n getNextHostNode(prevTree), instance, parentSuspense, isSVG);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `patch`);\r\n }\r\n next.el = nextTree.el;\r\n if (originNext === null) {\r\n // self-triggered update. In case of HOC, update parent component\r\n // vnode el. HOC is indicated by parent instance's subTree pointing\r\n // to child component's vnode\r\n updateHOCHostEl(instance, nextTree.el);\r\n }\r\n // updated hook\r\n if (u) {\r\n queuePostRenderEffect(u, parentSuspense);\r\n }\r\n // onVnodeUpdated\r\n if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {\r\n queuePostRenderEffect(() => {\r\n invokeVNodeHook(vnodeHook, parent, next, vnode);\r\n }, parentSuspense);\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsComponentUpdated(instance);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n popWarningContext();\r\n }\r\n }\r\n }, (process.env.NODE_ENV !== 'production') ? createDevEffectOptions(instance) : prodEffectOptions);\r\n };\r\n const updateComponentPreRender = (instance, nextVNode, optimized) => {\r\n nextVNode.component = instance;\r\n const prevProps = instance.vnode.props;\r\n instance.vnode = nextVNode;\r\n instance.next = null;\r\n updateProps(instance, nextVNode.props, prevProps, optimized);\r\n updateSlots(instance, nextVNode.children, optimized);\r\n pauseTracking();\r\n // props update may have triggered pre-flush watchers.\r\n // flush them before the render update.\r\n flushPreFlushCbs(undefined, instance.update);\r\n resetTracking();\r\n };\r\n const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {\r\n const c1 = n1 && n1.children;\r\n const prevShapeFlag = n1 ? n1.shapeFlag : 0;\r\n const c2 = n2.children;\r\n const { patchFlag, shapeFlag } = n2;\r\n // fast path\r\n if (patchFlag > 0) {\r\n if (patchFlag & 128 /* KEYED_FRAGMENT */) {\r\n // this could be either fully-keyed or mixed (some keyed some not)\r\n // presence of patchFlag means children are guaranteed to be arrays\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {\r\n // unkeyed\r\n patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n }\r\n // children has 3 possibilities: text, array or no children.\r\n if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n // text children fast path\r\n if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n unmountChildren(c1, parentComponent, parentSuspense);\r\n }\r\n if (c2 !== c1) {\r\n hostSetElementText(container, c2);\r\n }\r\n }\r\n else {\r\n if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n // prev children was array\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n // two arrays, cannot assume anything, do full diff\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n // no new children, just unmount old\r\n unmountChildren(c1, parentComponent, parentSuspense, true);\r\n }\r\n }\r\n else {\r\n // prev children was text OR null\r\n // new children is array OR null\r\n if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {\r\n hostSetElementText(container, '');\r\n }\r\n // mount new if array\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n }\r\n };\r\n const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n c1 = c1 || EMPTY_ARR;\r\n c2 = c2 || EMPTY_ARR;\r\n const oldLength = c1.length;\r\n const newLength = c2.length;\r\n const commonLength = Math.min(oldLength, newLength);\r\n let i;\r\n for (i = 0; i < commonLength; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n if (oldLength > newLength) {\r\n // remove old\r\n unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);\r\n }\r\n else {\r\n // mount new\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);\r\n }\r\n };\r\n // can be all-keyed or mixed\r\n const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n let i = 0;\r\n const l2 = c2.length;\r\n let e1 = c1.length - 1; // prev ending index\r\n let e2 = l2 - 1; // next ending index\r\n // 1. sync from start\r\n // (a b) c\r\n // (a b) d e\r\n while (i <= e1 && i <= e2) {\r\n const n1 = c1[i];\r\n const n2 = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n i++;\r\n }\r\n // 2. sync from end\r\n // a (b c)\r\n // d e (b c)\r\n while (i <= e1 && i <= e2) {\r\n const n1 = c1[e1];\r\n const n2 = (c2[e2] = optimized\r\n ? cloneIfMounted(c2[e2])\r\n : normalizeVNode(c2[e2]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n e1--;\r\n e2--;\r\n }\r\n // 3. common sequence + mount\r\n // (a b)\r\n // (a b) c\r\n // i = 2, e1 = 1, e2 = 2\r\n // (a b)\r\n // c (a b)\r\n // i = 0, e1 = -1, e2 = 0\r\n if (i > e1) {\r\n if (i <= e2) {\r\n const nextPos = e2 + 1;\r\n const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;\r\n while (i <= e2) {\r\n patch(null, (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n i++;\r\n }\r\n }\r\n }\r\n // 4. common sequence + unmount\r\n // (a b) c\r\n // (a b)\r\n // i = 2, e1 = 2, e2 = 1\r\n // a (b c)\r\n // (b c)\r\n // i = 0, e1 = 0, e2 = -1\r\n else if (i > e2) {\r\n while (i <= e1) {\r\n unmount(c1[i], parentComponent, parentSuspense, true);\r\n i++;\r\n }\r\n }\r\n // 5. unknown sequence\r\n // [i ... e1 + 1]: a b [c d e] f g\r\n // [i ... e2 + 1]: a b [e d c h] f g\r\n // i = 2, e1 = 4, e2 = 5\r\n else {\r\n const s1 = i; // prev starting index\r\n const s2 = i; // next starting index\r\n // 5.1 build key:index map for newChildren\r\n const keyToNewIndexMap = new Map();\r\n for (i = s2; i <= e2; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (nextChild.key != null) {\r\n if ((process.env.NODE_ENV !== 'production') && keyToNewIndexMap.has(nextChild.key)) {\r\n warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);\r\n }\r\n keyToNewIndexMap.set(nextChild.key, i);\r\n }\r\n }\r\n // 5.2 loop through old children left to be patched and try to patch\r\n // matching nodes & remove nodes that are no longer present\r\n let j;\r\n let patched = 0;\r\n const toBePatched = e2 - s2 + 1;\r\n let moved = false;\r\n // used to track whether any node has moved\r\n let maxNewIndexSoFar = 0;\r\n // works as Map<newIndex, oldIndex>\r\n // Note that oldIndex is offset by +1\r\n // and oldIndex = 0 is a special value indicating the new node has\r\n // no corresponding old node.\r\n // used for determining longest stable subsequence\r\n const newIndexToOldIndexMap = new Array(toBePatched);\r\n for (i = 0; i < toBePatched; i++)\r\n newIndexToOldIndexMap[i] = 0;\r\n for (i = s1; i <= e1; i++) {\r\n const prevChild = c1[i];\r\n if (patched >= toBePatched) {\r\n // all new children have been patched so this can only be a removal\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n continue;\r\n }\r\n let newIndex;\r\n if (prevChild.key != null) {\r\n newIndex = keyToNewIndexMap.get(prevChild.key);\r\n }\r\n else {\r\n // key-less node, try to locate a key-less node of the same type\r\n for (j = s2; j <= e2; j++) {\r\n if (newIndexToOldIndexMap[j - s2] === 0 &&\r\n isSameVNodeType(prevChild, c2[j])) {\r\n newIndex = j;\r\n break;\r\n }\r\n }\r\n }\r\n if (newIndex === undefined) {\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n }\r\n else {\r\n newIndexToOldIndexMap[newIndex - s2] = i + 1;\r\n if (newIndex >= maxNewIndexSoFar) {\r\n maxNewIndexSoFar = newIndex;\r\n }\r\n else {\r\n moved = true;\r\n }\r\n patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n patched++;\r\n }\r\n }\r\n // 5.3 move and mount\r\n // generate longest stable subsequence only when nodes have moved\r\n const increasingNewIndexSequence = moved\r\n ? getSequence(newIndexToOldIndexMap)\r\n : EMPTY_ARR;\r\n j = increasingNewIndexSequence.length - 1;\r\n // looping backwards so that we can use last patched node as anchor\r\n for (i = toBePatched - 1; i >= 0; i--) {\r\n const nextIndex = s2 + i;\r\n const nextChild = c2[nextIndex];\r\n const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;\r\n if (newIndexToOldIndexMap[i] === 0) {\r\n // mount new\r\n patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (moved) {\r\n // move if:\r\n // There is no stable subsequence (e.g. a reverse)\r\n // OR current node is not among the stable sequence\r\n if (j < 0 || i !== increasingNewIndexSequence[j]) {\r\n move(nextChild, container, anchor, 2 /* REORDER */);\r\n }\r\n else {\r\n j--;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n const move = (vnode, container, anchor, moveType, parentSuspense = null) => {\r\n const { el, type, transition, children, shapeFlag } = vnode;\r\n if (shapeFlag & 6 /* COMPONENT */) {\r\n move(vnode.component.subTree, container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.suspense.move(container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n type.move(vnode, container, anchor, internals);\r\n return;\r\n }\r\n if (type === Fragment) {\r\n hostInsert(el, container, anchor);\r\n for (let i = 0; i < children.length; i++) {\r\n move(children[i], container, anchor, moveType);\r\n }\r\n hostInsert(vnode.anchor, container, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n moveStaticNode(vnode, container, anchor);\r\n return;\r\n }\r\n // single nodes\r\n const needTransition = moveType !== 2 /* REORDER */ &&\r\n shapeFlag & 1 /* ELEMENT */ &&\r\n transition;\r\n if (needTransition) {\r\n if (moveType === 0 /* ENTER */) {\r\n transition.beforeEnter(el);\r\n hostInsert(el, container, anchor);\r\n queuePostRenderEffect(() => transition.enter(el), parentSuspense);\r\n }\r\n else {\r\n const { leave, delayLeave, afterLeave } = transition;\r\n const remove = () => hostInsert(el, container, anchor);\r\n const performLeave = () => {\r\n leave(el, () => {\r\n remove();\r\n afterLeave && afterLeave();\r\n });\r\n };\r\n if (delayLeave) {\r\n delayLeave(el, remove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n }\r\n else {\r\n hostInsert(el, container, anchor);\r\n }\r\n };\r\n const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {\r\n const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;\r\n // unset ref\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, null);\r\n }\r\n if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n parentComponent.ctx.deactivate(vnode);\r\n return;\r\n }\r\n const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;\r\n let vnodeHook;\r\n if ((vnodeHook = props && props.onVnodeBeforeUnmount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n if (shapeFlag & 6 /* COMPONENT */) {\r\n unmountComponent(vnode.component, parentSuspense, doRemove);\r\n }\r\n else {\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.suspense.unmount(parentSuspense, doRemove);\r\n return;\r\n }\r\n if (shouldInvokeDirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');\r\n }\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);\r\n }\r\n else if (dynamicChildren &&\r\n // #1153: fast path should not be taken for non-stable (v-for) fragments\r\n (type !== Fragment ||\r\n (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {\r\n // fast path for block nodes: only need to unmount dynamic children.\r\n unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);\r\n }\r\n else if ((type === Fragment &&\r\n (patchFlag & 128 /* KEYED_FRAGMENT */ ||\r\n patchFlag & 256 /* UNKEYED_FRAGMENT */)) ||\r\n (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {\r\n unmountChildren(children, parentComponent, parentSuspense);\r\n }\r\n if (doRemove) {\r\n remove(vnode);\r\n }\r\n }\r\n if ((vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n shouldInvokeDirs &&\r\n invokeDirectiveHook(vnode, null, parentComponent, 'unmounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const remove = vnode => {\r\n const { type, el, anchor, transition } = vnode;\r\n if (type === Fragment) {\r\n removeFragment(el, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n removeStaticNode(vnode);\r\n return;\r\n }\r\n const performRemove = () => {\r\n hostRemove(el);\r\n if (transition && !transition.persisted && transition.afterLeave) {\r\n transition.afterLeave();\r\n }\r\n };\r\n if (vnode.shapeFlag & 1 /* ELEMENT */ &&\r\n transition &&\r\n !transition.persisted) {\r\n const { leave, delayLeave } = transition;\r\n const performLeave = () => leave(el, performRemove);\r\n if (delayLeave) {\r\n delayLeave(vnode.el, performRemove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n else {\r\n performRemove();\r\n }\r\n };\r\n const removeFragment = (cur, end) => {\r\n // For fragments, directly remove all contained DOM nodes.\r\n // (fragment child nodes cannot have transition)\r\n let next;\r\n while (cur !== end) {\r\n next = hostNextSibling(cur);\r\n hostRemove(cur);\r\n cur = next;\r\n }\r\n hostRemove(end);\r\n };\r\n const unmountComponent = (instance, parentSuspense, doRemove) => {\r\n if ((process.env.NODE_ENV !== 'production') && instance.type.__hmrId) {\r\n unregisterHMR(instance);\r\n }\r\n const { bum, effects, update, subTree, um } = instance;\r\n // beforeUnmount hook\r\n if (bum) {\r\n invokeArrayFns(bum);\r\n }\r\n if (effects) {\r\n for (let i = 0; i < effects.length; i++) {\r\n stop(effects[i]);\r\n }\r\n }\r\n // update may be null if a component is unmounted before its async\r\n // setup has resolved.\r\n if (update) {\r\n stop(update);\r\n unmount(subTree, instance, parentSuspense, doRemove);\r\n }\r\n // unmounted hook\r\n if (um) {\r\n queuePostRenderEffect(um, parentSuspense);\r\n }\r\n queuePostRenderEffect(() => {\r\n instance.isUnmounted = true;\r\n }, parentSuspense);\r\n // A component with async dep inside a pending suspense is unmounted before\r\n // its async dep resolves. This should remove the dep from the suspense, and\r\n // cause the suspense to resolve immediately if that was the last dep.\r\n if (parentSuspense &&\r\n parentSuspense.pendingBranch &&\r\n !parentSuspense.isUnmounted &&\r\n instance.asyncDep &&\r\n !instance.asyncResolved &&\r\n instance.suspenseId === parentSuspense.pendingId) {\r\n parentSuspense.deps--;\r\n if (parentSuspense.deps === 0) {\r\n parentSuspense.resolve();\r\n }\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsComponentRemoved(instance);\r\n }\r\n };\r\n const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {\r\n for (let i = start; i < children.length; i++) {\r\n unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\r\n }\r\n };\r\n const getNextHostNode = vnode => {\r\n if (vnode.shapeFlag & 6 /* COMPONENT */) {\r\n return getNextHostNode(vnode.component.subTree);\r\n }\r\n if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n return vnode.suspense.next();\r\n }\r\n return hostNextSibling((vnode.anchor || vnode.el));\r\n };\r\n const render = (vnode, container, isSVG) => {\r\n if (vnode == null) {\r\n if (container._vnode) {\r\n unmount(container._vnode, null, null, true);\r\n }\r\n }\r\n else {\r\n patch(container._vnode || null, vnode, container, null, null, null, isSVG);\r\n }\r\n flushPostFlushCbs();\r\n container._vnode = vnode;\r\n };\r\n const internals = {\r\n p: patch,\r\n um: unmount,\r\n m: move,\r\n r: remove,\r\n mt: mountComponent,\r\n mc: mountChildren,\r\n pc: patchChildren,\r\n pbc: patchBlockChildren,\r\n n: getNextHostNode,\r\n o: options\r\n };\r\n let hydrate;\r\n let hydrateNode;\r\n if (createHydrationFns) {\r\n [hydrate, hydrateNode] = createHydrationFns(internals);\r\n }\r\n return {\r\n render,\r\n hydrate,\r\n createApp: createAppAPI(render, hydrate)\r\n };\r\n}\r\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\r\n callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [\r\n vnode,\r\n prevVNode\r\n ]);\r\n}\r\n/**\r\n * #1156\r\n * When a component is HMR-enabled, we need to make sure that all static nodes\r\n * inside a block also inherit the DOM element from the previous tree so that\r\n * HMR updates (which are full updates) can retrieve the element for patching.\r\n *\r\n * #2080\r\n * Inside keyed `template` fragment static children, if a fragment is moved,\r\n * the children will always moved so that need inherit el form previous nodes\r\n * to ensure correct moved position.\r\n */\r\nfunction traverseStaticChildren(n1, n2, shallow = false) {\r\n const ch1 = n1.children;\r\n const ch2 = n2.children;\r\n if (isArray(ch1) && isArray(ch2)) {\r\n for (let i = 0; i < ch1.length; i++) {\r\n // this is only called in the optimized path so array children are\r\n // guaranteed to be vnodes\r\n const c1 = ch1[i];\r\n let c2 = ch2[i];\r\n if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\r\n if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\r\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\r\n c2.el = c1.el;\r\n }\r\n if (!shallow)\r\n traverseStaticChildren(c1, c2);\r\n }\r\n // also inherit for comment nodes, but not placeholders (e.g. v-if which\r\n // would have received .el during block patch)\r\n if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {\r\n c2.el = c1.el;\r\n }\r\n }\r\n }\r\n}\r\n// https://en.wikipedia.org/wiki/Longest_increasing_subsequence\r\nfunction getSequence(arr) {\r\n const p = arr.slice();\r\n const result = [0];\r\n let i, j, u, v, c;\r\n const len = arr.length;\r\n for (i = 0; i < len; i++) {\r\n const arrI = arr[i];\r\n if (arrI !== 0) {\r\n j = result[result.length - 1];\r\n if (arr[j] < arrI) {\r\n p[i] = j;\r\n result.push(i);\r\n continue;\r\n }\r\n u = 0;\r\n v = result.length - 1;\r\n while (u < v) {\r\n c = ((u + v) / 2) | 0;\r\n if (arr[result[c]] < arrI) {\r\n u = c + 1;\r\n }\r\n else {\r\n v = c;\r\n }\r\n }\r\n if (arrI < arr[result[u]]) {\r\n if (u > 0) {\r\n p[i] = result[u - 1];\r\n }\r\n result[u] = i;\r\n }\r\n }\r\n }\r\n u = result.length;\r\n v = result[u - 1];\r\n while (u-- > 0) {\r\n result[u] = v;\r\n v = p[v];\r\n }\r\n return result;\r\n}\n\nconst isTeleport = (type) => type.__isTeleport;\r\nconst isTeleportDisabled = (props) => props && (props.disabled || props.disabled === '');\r\nconst isTargetSVG = (target) => typeof SVGElement !== 'undefined' && target instanceof SVGElement;\r\nconst resolveTarget = (props, select) => {\r\n const targetSelector = props && props.to;\r\n if (isString(targetSelector)) {\r\n if (!select) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Current renderer does not support string target for Teleports. ` +\r\n `(missing querySelector renderer option)`);\r\n return null;\r\n }\r\n else {\r\n const target = select(targetSelector);\r\n if (!target) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Failed to locate Teleport target with selector \"${targetSelector}\". ` +\r\n `Note the target element must exist before the component is mounted - ` +\r\n `i.e. the target cannot be rendered by the component itself, and ` +\r\n `ideally should be outside of the entire Vue component tree.`);\r\n }\r\n return target;\r\n }\r\n }\r\n else {\r\n if ((process.env.NODE_ENV !== 'production') && !targetSelector && !isTeleportDisabled(props)) {\r\n warn(`Invalid Teleport target: ${targetSelector}`);\r\n }\r\n return targetSelector;\r\n }\r\n};\r\nconst TeleportImpl = {\r\n __isTeleport: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {\r\n const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;\r\n const disabled = isTeleportDisabled(n2.props);\r\n const { shapeFlag, children } = n2;\r\n // #3302\r\n // HMR updated, force full diff\r\n if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {\r\n optimized = false;\r\n n2.dynamicChildren = null;\r\n }\r\n if (n1 == null) {\r\n // insert anchors in the main view\r\n const placeholder = (n2.el = (process.env.NODE_ENV !== 'production')\r\n ? createComment('teleport start')\r\n : createText(''));\r\n const mainAnchor = (n2.anchor = (process.env.NODE_ENV !== 'production')\r\n ? createComment('teleport end')\r\n : createText(''));\r\n insert(placeholder, container, anchor);\r\n insert(mainAnchor, container, anchor);\r\n const target = (n2.target = resolveTarget(n2.props, querySelector));\r\n const targetAnchor = (n2.targetAnchor = createText(''));\r\n if (target) {\r\n insert(targetAnchor, target);\r\n // #2652 we could be teleporting from a non-SVG tree into an SVG tree\r\n isSVG = isSVG || isTargetSVG(target);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production') && !disabled) {\r\n warn('Invalid Teleport target on mount:', target, `(${typeof target})`);\r\n }\r\n const mount = (container, anchor) => {\r\n // Teleport *always* has Array children. This is enforced in both the\r\n // compiler and vnode children normalization.\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n if (disabled) {\r\n mount(container, mainAnchor);\r\n }\r\n else if (target) {\r\n mount(target, targetAnchor);\r\n }\r\n }\r\n else {\r\n // update content\r\n n2.el = n1.el;\r\n const mainAnchor = (n2.anchor = n1.anchor);\r\n const target = (n2.target = n1.target);\r\n const targetAnchor = (n2.targetAnchor = n1.targetAnchor);\r\n const wasDisabled = isTeleportDisabled(n1.props);\r\n const currentContainer = wasDisabled ? container : target;\r\n const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\r\n isSVG = isSVG || isTargetSVG(target);\r\n if (n2.dynamicChildren) {\r\n // fast path when the teleport happens to be a block root\r\n patchBlockChildren(n1.dynamicChildren, n2.dynamicChildren, currentContainer, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n // even in block tree mode we need to make sure all root-level nodes\r\n // in the teleport inherit previous DOM references so that they can\r\n // be moved in future patches.\r\n traverseStaticChildren(n1, n2, true);\r\n }\r\n else if (!optimized) {\r\n patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, false);\r\n }\r\n if (disabled) {\r\n if (!wasDisabled) {\r\n // enabled -> disabled\r\n // move into main container\r\n moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);\r\n }\r\n }\r\n else {\r\n // target changed\r\n if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\r\n const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));\r\n if (nextTarget) {\r\n moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid Teleport target on update:', target, `(${typeof target})`);\r\n }\r\n }\r\n else if (wasDisabled) {\r\n // disabled -> enabled\r\n // move into teleport target\r\n moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);\r\n }\r\n }\r\n }\r\n },\r\n remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {\r\n const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;\r\n if (target) {\r\n hostRemove(targetAnchor);\r\n }\r\n // an unmounted teleport should always remove its children if not disabled\r\n if (doRemove || !isTeleportDisabled(props)) {\r\n hostRemove(anchor);\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n for (let i = 0; i < children.length; i++) {\r\n unmount(children[i], parentComponent, parentSuspense, true, optimized);\r\n }\r\n }\r\n }\r\n },\r\n move: moveTeleport,\r\n hydrate: hydrateTeleport\r\n};\r\nfunction moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {\r\n // move target anchor if this is a target change.\r\n if (moveType === 0 /* TARGET_CHANGE */) {\r\n insert(vnode.targetAnchor, container, parentAnchor);\r\n }\r\n const { el, anchor, shapeFlag, children, props } = vnode;\r\n const isReorder = moveType === 2 /* REORDER */;\r\n // move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(el, container, parentAnchor);\r\n }\r\n // if this is a re-order and teleport is enabled (content is in target)\r\n // do not move children. So the opposite is: only move children if this\r\n // is not a reorder, or the teleport is disabled\r\n if (!isReorder || isTeleportDisabled(props)) {\r\n // Teleport has either Array children or no children.\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n for (let i = 0; i < children.length; i++) {\r\n move(children[i], container, parentAnchor, 2 /* REORDER */);\r\n }\r\n }\r\n }\r\n // move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(anchor, container, parentAnchor);\r\n }\r\n}\r\nfunction hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector } }, hydrateChildren) {\r\n const target = (vnode.target = resolveTarget(vnode.props, querySelector));\r\n if (target) {\r\n // if multiple teleports rendered to the same target element, we need to\r\n // pick up from where the last teleport finished instead of the first node\r\n const targetNode = target._lpa || target.firstChild;\r\n if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n if (isTeleportDisabled(vnode.props)) {\r\n vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);\r\n vnode.targetAnchor = targetNode;\r\n }\r\n else {\r\n vnode.anchor = nextSibling(node);\r\n vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n target._lpa =\r\n vnode.targetAnchor && nextSibling(vnode.targetAnchor);\r\n }\r\n }\r\n return vnode.anchor && nextSibling(vnode.anchor);\r\n}\r\n// Force-casted public typing for h and TSX props inference\r\nconst Teleport = TeleportImpl;\n\nconst COMPONENTS = 'components';\r\nconst DIRECTIVES = 'directives';\r\n/**\r\n * @private\r\n */\r\nfunction resolveComponent(name, maybeSelfReference) {\r\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\r\n}\r\nconst NULL_DYNAMIC_COMPONENT = Symbol();\r\n/**\r\n * @private\r\n */\r\nfunction resolveDynamicComponent(component) {\r\n if (isString(component)) {\r\n return resolveAsset(COMPONENTS, component, false) || component;\r\n }\r\n else {\r\n // invalid types will fallthrough to createVNode and raise warning\r\n return (component || NULL_DYNAMIC_COMPONENT);\r\n }\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction resolveDirective(name) {\r\n return resolveAsset(DIRECTIVES, name);\r\n}\r\n// implementation\r\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\r\n const instance = currentRenderingInstance || currentInstance;\r\n if (instance) {\r\n const Component = instance.type;\r\n // explicit self name has highest priority\r\n if (type === COMPONENTS) {\r\n const selfName = getComponentName(Component);\r\n if (selfName &&\r\n (selfName === name ||\r\n selfName === camelize(name) ||\r\n selfName === capitalize(camelize(name)))) {\r\n return Component;\r\n }\r\n }\r\n const res = \r\n // local registration\r\n // check instance[type] first for components with mixin or extends.\r\n resolve(instance[type] || Component[type], name) ||\r\n // global registration\r\n resolve(instance.appContext[type], name);\r\n if (!res && maybeSelfReference) {\r\n // fallback to implicit self-reference\r\n return Component;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && warnMissing && !res) {\r\n warn(`Failed to resolve ${type.slice(0, -1)}: ${name}`);\r\n }\r\n return res;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`resolve${capitalize(type.slice(0, -1))} ` +\r\n `can only be used in render() or setup().`);\r\n }\r\n}\r\nfunction resolve(registry, name) {\r\n return (registry &&\r\n (registry[name] ||\r\n registry[camelize(name)] ||\r\n registry[capitalize(camelize(name))]));\r\n}\n\nconst Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined);\r\nconst Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined);\r\nconst Comment = Symbol((process.env.NODE_ENV !== 'production') ? 'Comment' : undefined);\r\nconst Static = Symbol((process.env.NODE_ENV !== 'production') ? 'Static' : undefined);\r\n// Since v-if and v-for are the two possible ways node structure can dynamically\r\n// change, once we consider v-if branches and each v-for fragment a block, we\r\n// can divide a template into nested blocks, and within each block the node\r\n// structure would be stable. This allows us to skip most children diffing\r\n// and only worry about the dynamic nodes (indicated by patch flags).\r\nconst blockStack = [];\r\nlet currentBlock = null;\r\n/**\r\n * Open a block.\r\n * This must be called before `createBlock`. It cannot be part of `createBlock`\r\n * because the children of the block are evaluated before `createBlock` itself\r\n * is called. The generated code typically looks like this:\r\n *\r\n * ```js\r\n * function render() {\r\n * return (openBlock(),createBlock('div', null, [...]))\r\n * }\r\n * ```\r\n * disableTracking is true when creating a v-for fragment block, since a v-for\r\n * fragment always diffs its children.\r\n *\r\n * @private\r\n */\r\nfunction openBlock(disableTracking = false) {\r\n blockStack.push((currentBlock = disableTracking ? null : []));\r\n}\r\nfunction closeBlock() {\r\n blockStack.pop();\r\n currentBlock = blockStack[blockStack.length - 1] || null;\r\n}\r\n// Whether we should be tracking dynamic child nodes inside a block.\r\n// Only tracks when this value is > 0\r\n// We are not using a simple boolean because this value may need to be\r\n// incremented/decremented by nested usage of v-once (see below)\r\nlet shouldTrack = 1;\r\n/**\r\n * Block tracking sometimes needs to be disabled, for example during the\r\n * creation of a tree that needs to be cached by v-once. The compiler generates\r\n * code like this:\r\n *\r\n * ``` js\r\n * _cache[1] || (\r\n * setBlockTracking(-1),\r\n * _cache[1] = createVNode(...),\r\n * setBlockTracking(1),\r\n * _cache[1]\r\n * )\r\n * ```\r\n *\r\n * @private\r\n */\r\nfunction setBlockTracking(value) {\r\n shouldTrack += value;\r\n}\r\n/**\r\n * Create a block root vnode. Takes the same exact arguments as `createVNode`.\r\n * A block root keeps track of dynamic nodes within the block in the\r\n * `dynamicChildren` array.\r\n *\r\n * @private\r\n */\r\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\r\n const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\r\n // save current block children on the block vnode\r\n vnode.dynamicChildren = currentBlock || EMPTY_ARR;\r\n // close block\r\n closeBlock();\r\n // a block is always going to be patched, so track it as a child of its\r\n // parent block\r\n if (shouldTrack > 0 && currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\nfunction isVNode(value) {\r\n return value ? value.__v_isVNode === true : false;\r\n}\r\nfunction isSameVNodeType(n1, n2) {\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n n2.shapeFlag & 6 /* COMPONENT */ &&\r\n hmrDirtyComponents.has(n2.type)) {\r\n // HMR only: if the component has been hot-updated, force a reload.\r\n return false;\r\n }\r\n return n1.type === n2.type && n1.key === n2.key;\r\n}\r\nlet vnodeArgsTransformer;\r\n/**\r\n * Internal API for registering an arguments transform for createVNode\r\n * used for creating stubs in the test-utils\r\n * It is *internal* but needs to be exposed for test-utils to pick up proper\r\n * typings\r\n */\r\nfunction transformVNodeArgs(transformer) {\r\n vnodeArgsTransformer = transformer;\r\n}\r\nconst createVNodeWithArgsTransform = (...args) => {\r\n return _createVNode(...(vnodeArgsTransformer\r\n ? vnodeArgsTransformer(args, currentRenderingInstance)\r\n : args));\r\n};\r\nconst InternalObjectKey = `__vInternal`;\r\nconst normalizeKey = ({ key }) => key != null ? key : null;\r\nconst normalizeRef = ({ ref }) => {\r\n return (ref != null\r\n ? isString(ref) || isRef(ref) || isFunction(ref)\r\n ? { i: currentRenderingInstance, r: ref }\r\n : ref\r\n : null);\r\n};\r\nconst createVNode = ((process.env.NODE_ENV !== 'production')\r\n ? createVNodeWithArgsTransform\r\n : _createVNode);\r\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\r\n if (!type || type === NULL_DYNAMIC_COMPONENT) {\r\n if ((process.env.NODE_ENV !== 'production') && !type) {\r\n warn(`Invalid vnode type when creating vnode: ${type}.`);\r\n }\r\n type = Comment;\r\n }\r\n if (isVNode(type)) {\r\n // createVNode receiving an existing vnode. This happens in cases like\r\n // <component :is=\"vnode\"/>\r\n // #2078 make sure to merge refs during the clone instead of overwriting it\r\n const cloned = cloneVNode(type, props, true /* mergeRef: true */);\r\n if (children) {\r\n normalizeChildren(cloned, children);\r\n }\r\n return cloned;\r\n }\r\n // class component normalization.\r\n if (isClassComponent(type)) {\r\n type = type.__vccOpts;\r\n }\r\n // class & style normalization.\r\n if (props) {\r\n // for reactive or proxy objects, we need to clone it to enable mutation.\r\n if (isProxy(props) || InternalObjectKey in props) {\r\n props = extend({}, props);\r\n }\r\n let { class: klass, style } = props;\r\n if (klass && !isString(klass)) {\r\n props.class = normalizeClass(klass);\r\n }\r\n if (isObject(style)) {\r\n // reactive state objects need to be cloned since they are likely to be\r\n // mutated\r\n if (isProxy(style) && !isArray(style)) {\r\n style = extend({}, style);\r\n }\r\n props.style = normalizeStyle(style);\r\n }\r\n }\r\n // encode the vnode type information into a bitmap\r\n const shapeFlag = isString(type)\r\n ? 1 /* ELEMENT */\r\n : isSuspense(type)\r\n ? 128 /* SUSPENSE */\r\n : isTeleport(type)\r\n ? 64 /* TELEPORT */\r\n : isObject(type)\r\n ? 4 /* STATEFUL_COMPONENT */\r\n : isFunction(type)\r\n ? 2 /* FUNCTIONAL_COMPONENT */\r\n : 0;\r\n if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {\r\n type = toRaw(type);\r\n warn(`Vue received a Component which was made a reactive object. This can ` +\r\n `lead to unnecessary performance overhead, and should be avoided by ` +\r\n `marking the component with \\`markRaw\\` or using \\`shallowRef\\` ` +\r\n `instead of \\`ref\\`.`, `\\nComponent that was made reactive: `, type);\r\n }\r\n const vnode = {\r\n __v_isVNode: true,\r\n [\"__v_skip\" /* SKIP */]: true,\r\n type,\r\n props,\r\n key: props && normalizeKey(props),\r\n ref: props && normalizeRef(props),\r\n scopeId: currentScopeId,\r\n slotScopeIds: null,\r\n children: null,\r\n component: null,\r\n suspense: null,\r\n ssContent: null,\r\n ssFallback: null,\r\n dirs: null,\r\n transition: null,\r\n el: null,\r\n anchor: null,\r\n target: null,\r\n targetAnchor: null,\r\n staticCount: 0,\r\n shapeFlag,\r\n patchFlag,\r\n dynamicProps,\r\n dynamicChildren: null,\r\n appContext: null\r\n };\r\n // validate key\r\n if ((process.env.NODE_ENV !== 'production') && vnode.key !== vnode.key) {\r\n warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);\r\n }\r\n normalizeChildren(vnode, children);\r\n // normalize suspense children\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n const { content, fallback } = normalizeSuspenseChildren(vnode);\r\n vnode.ssContent = content;\r\n vnode.ssFallback = fallback;\r\n }\r\n if (shouldTrack > 0 &&\r\n // avoid a block node from tracking itself\r\n !isBlockNode &&\r\n // has current parent block\r\n currentBlock &&\r\n // presence of a patch flag indicates this node needs patching on updates.\r\n // component nodes also should always be patched, because even if the\r\n // component doesn't need to update, it needs to persist the instance on to\r\n // the next vnode so that it can be properly unmounted later.\r\n (patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&\r\n // the EVENTS flag is only for hydration and if it is the only flag, the\r\n // vnode should not be considered dynamic due to handler caching.\r\n patchFlag !== 32 /* HYDRATE_EVENTS */) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\nfunction cloneVNode(vnode, extraProps, mergeRef = false) {\r\n // This is intentionally NOT using spread or extend to avoid the runtime\r\n // key enumeration cost.\r\n const { props, ref, patchFlag, children } = vnode;\r\n const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\r\n return {\r\n __v_isVNode: true,\r\n [\"__v_skip\" /* SKIP */]: true,\r\n type: vnode.type,\r\n props: mergedProps,\r\n key: mergedProps && normalizeKey(mergedProps),\r\n ref: extraProps && extraProps.ref\r\n ? // #2078 in the case of <component :is=\"vnode\" ref=\"extra\"/>\r\n // if the vnode itself already has a ref, cloneVNode will need to merge\r\n // the refs so the single vnode can be set on multiple refs\r\n mergeRef && ref\r\n ? isArray(ref)\r\n ? ref.concat(normalizeRef(extraProps))\r\n : [ref, normalizeRef(extraProps)]\r\n : normalizeRef(extraProps)\r\n : ref,\r\n scopeId: vnode.scopeId,\r\n slotScopeIds: vnode.slotScopeIds,\r\n children: (process.env.NODE_ENV !== 'production') && patchFlag === -1 /* HOISTED */ && isArray(children)\r\n ? children.map(deepCloneVNode)\r\n : children,\r\n target: vnode.target,\r\n targetAnchor: vnode.targetAnchor,\r\n staticCount: vnode.staticCount,\r\n shapeFlag: vnode.shapeFlag,\r\n // if the vnode is cloned with extra props, we can no longer assume its\r\n // existing patch flag to be reliable and need to add the FULL_PROPS flag.\r\n // note: perserve flag for fragments since they use the flag for children\r\n // fast paths only.\r\n patchFlag: extraProps && vnode.type !== Fragment\r\n ? patchFlag === -1 // hoisted node\r\n ? 16 /* FULL_PROPS */\r\n : patchFlag | 16 /* FULL_PROPS */\r\n : patchFlag,\r\n dynamicProps: vnode.dynamicProps,\r\n dynamicChildren: vnode.dynamicChildren,\r\n appContext: vnode.appContext,\r\n dirs: vnode.dirs,\r\n transition: vnode.transition,\r\n // These should technically only be non-null on mounted VNodes. However,\r\n // they *should* be copied for kept-alive vnodes. So we just always copy\r\n // them since them being non-null during a mount doesn't affect the logic as\r\n // they will simply be overwritten.\r\n component: vnode.component,\r\n suspense: vnode.suspense,\r\n ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\r\n ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\r\n el: vnode.el,\r\n anchor: vnode.anchor\r\n };\r\n}\r\n/**\r\n * Dev only, for HMR of hoisted vnodes reused in v-for\r\n * https://github.com/vitejs/vite/issues/2022\r\n */\r\nfunction deepCloneVNode(vnode) {\r\n const cloned = cloneVNode(vnode);\r\n if (isArray(vnode.children)) {\r\n cloned.children = vnode.children.map(deepCloneVNode);\r\n }\r\n return cloned;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createTextVNode(text = ' ', flag = 0) {\r\n return createVNode(Text, null, text, flag);\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createStaticVNode(content, numberOfNodes) {\r\n // A static vnode can contain multiple stringified elements, and the number\r\n // of elements is necessary for hydration.\r\n const vnode = createVNode(Static, null, content);\r\n vnode.staticCount = numberOfNodes;\r\n return vnode;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createCommentVNode(text = '', \r\n// when used as the v-else branch, the comment node must be created as a\r\n// block to ensure correct updates.\r\nasBlock = false) {\r\n return asBlock\r\n ? (openBlock(), createBlock(Comment, null, text))\r\n : createVNode(Comment, null, text);\r\n}\r\nfunction normalizeVNode(child) {\r\n if (child == null || typeof child === 'boolean') {\r\n // empty placeholder\r\n return createVNode(Comment);\r\n }\r\n else if (isArray(child)) {\r\n // fragment\r\n return createVNode(Fragment, null, child);\r\n }\r\n else if (typeof child === 'object') {\r\n // already vnode, this should be the most common since compiled templates\r\n // always produce all-vnode children arrays\r\n return child.el === null ? child : cloneVNode(child);\r\n }\r\n else {\r\n // strings and numbers\r\n return createVNode(Text, null, String(child));\r\n }\r\n}\r\n// optimized normalization for template-compiled render fns\r\nfunction cloneIfMounted(child) {\r\n return child.el === null ? child : cloneVNode(child);\r\n}\r\nfunction normalizeChildren(vnode, children) {\r\n let type = 0;\r\n const { shapeFlag } = vnode;\r\n if (children == null) {\r\n children = null;\r\n }\r\n else if (isArray(children)) {\r\n type = 16 /* ARRAY_CHILDREN */;\r\n }\r\n else if (typeof children === 'object') {\r\n if (shapeFlag & 1 /* ELEMENT */ || shapeFlag & 64 /* TELEPORT */) {\r\n // Normalize slot to plain children for plain element and Teleport\r\n const slot = children.default;\r\n if (slot) {\r\n // _c marker is added by withCtx() indicating this is a compiled slot\r\n slot._c && setCompiledSlotRendering(1);\r\n normalizeChildren(vnode, slot());\r\n slot._c && setCompiledSlotRendering(-1);\r\n }\r\n return;\r\n }\r\n else {\r\n type = 32 /* SLOTS_CHILDREN */;\r\n const slotFlag = children._;\r\n if (!slotFlag && !(InternalObjectKey in children)) {\r\n children._ctx = currentRenderingInstance;\r\n }\r\n else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {\r\n // a child component receives forwarded slots from the parent.\r\n // its slot type is determined by its parent's slot type.\r\n if (currentRenderingInstance.vnode.patchFlag & 1024 /* DYNAMIC_SLOTS */) {\r\n children._ = 2 /* DYNAMIC */;\r\n vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;\r\n }\r\n else {\r\n children._ = 1 /* STABLE */;\r\n }\r\n }\r\n }\r\n }\r\n else if (isFunction(children)) {\r\n children = { default: children, _ctx: currentRenderingInstance };\r\n type = 32 /* SLOTS_CHILDREN */;\r\n }\r\n else {\r\n children = String(children);\r\n // force teleport children to array so it can be moved around\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n type = 16 /* ARRAY_CHILDREN */;\r\n children = [createTextVNode(children)];\r\n }\r\n else {\r\n type = 8 /* TEXT_CHILDREN */;\r\n }\r\n }\r\n vnode.children = children;\r\n vnode.shapeFlag |= type;\r\n}\r\nfunction mergeProps(...args) {\r\n const ret = extend({}, args[0]);\r\n for (let i = 1; i < args.length; i++) {\r\n const toMerge = args[i];\r\n for (const key in toMerge) {\r\n if (key === 'class') {\r\n if (ret.class !== toMerge.class) {\r\n ret.class = normalizeClass([ret.class, toMerge.class]);\r\n }\r\n }\r\n else if (key === 'style') {\r\n ret.style = normalizeStyle([ret.style, toMerge.style]);\r\n }\r\n else if (isOn(key)) {\r\n const existing = ret[key];\r\n const incoming = toMerge[key];\r\n if (existing !== incoming) {\r\n ret[key] = existing\r\n ? [].concat(existing, toMerge[key])\r\n : incoming;\r\n }\r\n }\r\n else if (key !== '') {\r\n ret[key] = toMerge[key];\r\n }\r\n }\r\n }\r\n return ret;\r\n}\n\nfunction provide(key, value) {\r\n if (!currentInstance) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`provide() can only be used inside setup().`);\r\n }\r\n }\r\n else {\r\n let provides = currentInstance.provides;\r\n // by default an instance inherits its parent's provides object\r\n // but when it needs to provide values of its own, it creates its\r\n // own provides object using parent provides object as prototype.\r\n // this way in `inject` we can simply look up injections from direct\r\n // parent and let the prototype chain do the work.\r\n const parentProvides = currentInstance.parent && currentInstance.parent.provides;\r\n if (parentProvides === provides) {\r\n provides = currentInstance.provides = Object.create(parentProvides);\r\n }\r\n // TS doesn't allow symbol as index type\r\n provides[key] = value;\r\n }\r\n}\r\nfunction inject(key, defaultValue, treatDefaultAsFactory = false) {\r\n // fallback to `currentRenderingInstance` so that this can be called in\r\n // a functional component\r\n const instance = currentInstance || currentRenderingInstance;\r\n if (instance) {\r\n // #2400\r\n // to support `app.use` plugins,\r\n // fallback to appContext's `provides` if the intance is at root\r\n const provides = instance.parent == null\r\n ? instance.vnode.appContext && instance.vnode.appContext.provides\r\n : instance.parent.provides;\r\n if (provides && key in provides) {\r\n // TS doesn't allow symbol as index type\r\n return provides[key];\r\n }\r\n else if (arguments.length > 1) {\r\n return treatDefaultAsFactory && isFunction(defaultValue)\r\n ? defaultValue()\r\n : defaultValue;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`injection \"${String(key)}\" not found.`);\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`inject() can only be used inside setup() or functional components.`);\r\n }\r\n}\n\nfunction createDuplicateChecker() {\r\n const cache = Object.create(null);\r\n return (type, key) => {\r\n if (cache[key]) {\r\n warn(`${type} property \"${key}\" is already defined in ${cache[key]}.`);\r\n }\r\n else {\r\n cache[key] = type;\r\n }\r\n };\r\n}\r\nlet shouldCacheAccess = true;\r\nfunction applyOptions(instance, options, deferredData = [], deferredWatch = [], deferredProvide = [], asMixin = false) {\r\n const { \r\n // composition\r\n mixins, extends: extendsOptions, \r\n // state\r\n data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, \r\n // assets\r\n components, directives, \r\n // lifecycle\r\n beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, \r\n // public API\r\n expose } = options;\r\n const publicThis = instance.proxy;\r\n const ctx = instance.ctx;\r\n const globalMixins = instance.appContext.mixins;\r\n if (asMixin && render && instance.render === NOOP) {\r\n instance.render = render;\r\n }\r\n // applyOptions is called non-as-mixin once per instance\r\n if (!asMixin) {\r\n shouldCacheAccess = false;\r\n callSyncHook('beforeCreate', \"bc\" /* BEFORE_CREATE */, options, instance, globalMixins);\r\n shouldCacheAccess = true;\r\n // global mixins are applied first\r\n applyMixins(instance, globalMixins, deferredData, deferredWatch, deferredProvide);\r\n }\r\n // extending a base component...\r\n if (extendsOptions) {\r\n applyOptions(instance, extendsOptions, deferredData, deferredWatch, deferredProvide, true);\r\n }\r\n // local mixins\r\n if (mixins) {\r\n applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide);\r\n }\r\n const checkDuplicateProperties = (process.env.NODE_ENV !== 'production') ? createDuplicateChecker() : null;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const [propsOptions] = instance.propsOptions;\r\n if (propsOptions) {\r\n for (const key in propsOptions) {\r\n checkDuplicateProperties(\"Props\" /* PROPS */, key);\r\n }\r\n }\r\n }\r\n // options initialization order (to be consistent with Vue 2):\r\n // - props (already done outside of this function)\r\n // - inject\r\n // - methods\r\n // - data (deferred since it relies on `this` access)\r\n // - computed\r\n // - watch (deferred since it relies on `this` access)\r\n if (injectOptions) {\r\n if (isArray(injectOptions)) {\r\n for (let i = 0; i < injectOptions.length; i++) {\r\n const key = injectOptions[i];\r\n ctx[key] = inject(key);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkDuplicateProperties(\"Inject\" /* INJECT */, key);\r\n }\r\n }\r\n }\r\n else {\r\n for (const key in injectOptions) {\r\n const opt = injectOptions[key];\r\n if (isObject(opt)) {\r\n ctx[key] = inject(opt.from || key, opt.default, true /* treat default function as factory */);\r\n }\r\n else {\r\n ctx[key] = inject(opt);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkDuplicateProperties(\"Inject\" /* INJECT */, key);\r\n }\r\n }\r\n }\r\n }\r\n if (methods) {\r\n for (const key in methods) {\r\n const methodHandler = methods[key];\r\n if (isFunction(methodHandler)) {\r\n // In dev mode, we use the `createRenderContext` function to define methods to the proxy target,\r\n // and those are read-only but reconfigurable, so it needs to be redefined here\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n Object.defineProperty(ctx, key, {\r\n value: methodHandler.bind(publicThis),\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n });\r\n }\r\n else {\r\n ctx[key] = methodHandler.bind(publicThis);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkDuplicateProperties(\"Methods\" /* METHODS */, key);\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Method \"${key}\" has type \"${typeof methodHandler}\" in the component definition. ` +\r\n `Did you reference the function correctly?`);\r\n }\r\n }\r\n }\r\n if (!asMixin) {\r\n if (deferredData.length) {\r\n deferredData.forEach(dataFn => resolveData(instance, dataFn, publicThis));\r\n }\r\n if (dataOptions) {\r\n // @ts-ignore dataOptions is not fully type safe\r\n resolveData(instance, dataOptions, publicThis);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const rawData = toRaw(instance.data);\r\n for (const key in rawData) {\r\n checkDuplicateProperties(\"Data\" /* DATA */, key);\r\n // expose data on ctx during dev\r\n if (key[0] !== '$' && key[0] !== '_') {\r\n Object.defineProperty(ctx, key, {\r\n configurable: true,\r\n enumerable: true,\r\n get: () => rawData[key],\r\n set: NOOP\r\n });\r\n }\r\n }\r\n }\r\n }\r\n else if (dataOptions) {\r\n deferredData.push(dataOptions);\r\n }\r\n if (computedOptions) {\r\n for (const key in computedOptions) {\r\n const opt = computedOptions[key];\r\n const get = isFunction(opt)\r\n ? opt.bind(publicThis, publicThis)\r\n : isFunction(opt.get)\r\n ? opt.get.bind(publicThis, publicThis)\r\n : NOOP;\r\n if ((process.env.NODE_ENV !== 'production') && get === NOOP) {\r\n warn(`Computed property \"${key}\" has no getter.`);\r\n }\r\n const set = !isFunction(opt) && isFunction(opt.set)\r\n ? opt.set.bind(publicThis)\r\n : (process.env.NODE_ENV !== 'production')\r\n ? () => {\r\n warn(`Write operation failed: computed property \"${key}\" is readonly.`);\r\n }\r\n : NOOP;\r\n const c = computed({\r\n get,\r\n set\r\n });\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => c.value,\r\n set: v => (c.value = v)\r\n });\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkDuplicateProperties(\"Computed\" /* COMPUTED */, key);\r\n }\r\n }\r\n }\r\n if (watchOptions) {\r\n deferredWatch.push(watchOptions);\r\n }\r\n if (!asMixin && deferredWatch.length) {\r\n deferredWatch.forEach(watchOptions => {\r\n for (const key in watchOptions) {\r\n createWatcher(watchOptions[key], ctx, publicThis, key);\r\n }\r\n });\r\n }\r\n if (provideOptions) {\r\n deferredProvide.push(provideOptions);\r\n }\r\n if (!asMixin && deferredProvide.length) {\r\n deferredProvide.forEach(provideOptions => {\r\n const provides = isFunction(provideOptions)\r\n ? provideOptions.call(publicThis)\r\n : provideOptions;\r\n Reflect.ownKeys(provides).forEach(key => {\r\n provide(key, provides[key]);\r\n });\r\n });\r\n }\r\n // asset options.\r\n // To reduce memory usage, only components with mixins or extends will have\r\n // resolved asset registry attached to instance.\r\n if (asMixin) {\r\n if (components) {\r\n extend(instance.components ||\r\n (instance.components = extend({}, instance.type.components)), components);\r\n }\r\n if (directives) {\r\n extend(instance.directives ||\r\n (instance.directives = extend({}, instance.type.directives)), directives);\r\n }\r\n }\r\n // lifecycle options\r\n if (!asMixin) {\r\n callSyncHook('created', \"c\" /* CREATED */, options, instance, globalMixins);\r\n }\r\n if (beforeMount) {\r\n onBeforeMount(beforeMount.bind(publicThis));\r\n }\r\n if (mounted) {\r\n onMounted(mounted.bind(publicThis));\r\n }\r\n if (beforeUpdate) {\r\n onBeforeUpdate(beforeUpdate.bind(publicThis));\r\n }\r\n if (updated) {\r\n onUpdated(updated.bind(publicThis));\r\n }\r\n if (activated) {\r\n onActivated(activated.bind(publicThis));\r\n }\r\n if (deactivated) {\r\n onDeactivated(deactivated.bind(publicThis));\r\n }\r\n if (errorCaptured) {\r\n onErrorCaptured(errorCaptured.bind(publicThis));\r\n }\r\n if (renderTracked) {\r\n onRenderTracked(renderTracked.bind(publicThis));\r\n }\r\n if (renderTriggered) {\r\n onRenderTriggered(renderTriggered.bind(publicThis));\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && beforeDestroy) {\r\n warn(`\\`beforeDestroy\\` has been renamed to \\`beforeUnmount\\`.`);\r\n }\r\n if (beforeUnmount) {\r\n onBeforeUnmount(beforeUnmount.bind(publicThis));\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && destroyed) {\r\n warn(`\\`destroyed\\` has been renamed to \\`unmounted\\`.`);\r\n }\r\n if (unmounted) {\r\n onUnmounted(unmounted.bind(publicThis));\r\n }\r\n if (isArray(expose)) {\r\n if (!asMixin) {\r\n if (expose.length) {\r\n const exposed = instance.exposed || (instance.exposed = proxyRefs({}));\r\n expose.forEach(key => {\r\n exposed[key] = toRef(publicThis, key);\r\n });\r\n }\r\n else if (!instance.exposed) {\r\n instance.exposed = EMPTY_OBJ;\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`The \\`expose\\` option is ignored when used in mixins.`);\r\n }\r\n }\r\n}\r\nfunction callSyncHook(name, type, options, instance, globalMixins) {\r\n for (let i = 0; i < globalMixins.length; i++) {\r\n callHookWithMixinAndExtends(name, type, globalMixins[i], instance);\r\n }\r\n callHookWithMixinAndExtends(name, type, options, instance);\r\n}\r\nfunction callHookWithMixinAndExtends(name, type, options, instance) {\r\n const { extends: base, mixins } = options;\r\n const selfHook = options[name];\r\n if (base) {\r\n callHookWithMixinAndExtends(name, type, base, instance);\r\n }\r\n if (mixins) {\r\n for (let i = 0; i < mixins.length; i++) {\r\n callHookWithMixinAndExtends(name, type, mixins[i], instance);\r\n }\r\n }\r\n if (selfHook) {\r\n callWithAsyncErrorHandling(selfHook.bind(instance.proxy), instance, type);\r\n }\r\n}\r\nfunction applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide) {\r\n for (let i = 0; i < mixins.length; i++) {\r\n applyOptions(instance, mixins[i], deferredData, deferredWatch, deferredProvide, true);\r\n }\r\n}\r\nfunction resolveData(instance, dataFn, publicThis) {\r\n if ((process.env.NODE_ENV !== 'production') && !isFunction(dataFn)) {\r\n warn(`The data option must be a function. ` +\r\n `Plain object usage is no longer supported.`);\r\n }\r\n shouldCacheAccess = false;\r\n const data = dataFn.call(publicThis, publicThis);\r\n shouldCacheAccess = true;\r\n if ((process.env.NODE_ENV !== 'production') && isPromise(data)) {\r\n warn(`data() returned a Promise - note data() cannot be async; If you ` +\r\n `intend to perform data fetching before component renders, use ` +\r\n `async setup() + <Suspense>.`);\r\n }\r\n if (!isObject(data)) {\r\n (process.env.NODE_ENV !== 'production') && warn(`data() should return an object.`);\r\n }\r\n else if (instance.data === EMPTY_OBJ) {\r\n instance.data = reactive(data);\r\n }\r\n else {\r\n // existing data: this is a mixin or extends.\r\n extend(instance.data, data);\r\n }\r\n}\r\nfunction createWatcher(raw, ctx, publicThis, key) {\r\n const getter = key.includes('.')\r\n ? createPathGetter(publicThis, key)\r\n : () => publicThis[key];\r\n if (isString(raw)) {\r\n const handler = ctx[raw];\r\n if (isFunction(handler)) {\r\n watch(getter, handler);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Invalid watch handler specified by key \"${raw}\"`, handler);\r\n }\r\n }\r\n else if (isFunction(raw)) {\r\n watch(getter, raw.bind(publicThis));\r\n }\r\n else if (isObject(raw)) {\r\n if (isArray(raw)) {\r\n raw.forEach(r => createWatcher(r, ctx, publicThis, key));\r\n }\r\n else {\r\n const handler = isFunction(raw.handler)\r\n ? raw.handler.bind(publicThis)\r\n : ctx[raw.handler];\r\n if (isFunction(handler)) {\r\n watch(getter, handler, raw);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Invalid watch handler specified by key \"${raw.handler}\"`, handler);\r\n }\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Invalid watch option: \"${key}\"`, raw);\r\n }\r\n}\r\nfunction createPathGetter(ctx, path) {\r\n const segments = path.split('.');\r\n return () => {\r\n let cur = ctx;\r\n for (let i = 0; i < segments.length && cur; i++) {\r\n cur = cur[segments[i]];\r\n }\r\n return cur;\r\n };\r\n}\r\nfunction resolveMergedOptions(instance) {\r\n const raw = instance.type;\r\n const { __merged, mixins, extends: extendsOptions } = raw;\r\n if (__merged)\r\n return __merged;\r\n const globalMixins = instance.appContext.mixins;\r\n if (!globalMixins.length && !mixins && !extendsOptions)\r\n return raw;\r\n const options = {};\r\n globalMixins.forEach(m => mergeOptions(options, m, instance));\r\n mergeOptions(options, raw, instance);\r\n return (raw.__merged = options);\r\n}\r\nfunction mergeOptions(to, from, instance) {\r\n const strats = instance.appContext.config.optionMergeStrategies;\r\n const { mixins, extends: extendsOptions } = from;\r\n extendsOptions && mergeOptions(to, extendsOptions, instance);\r\n mixins &&\r\n mixins.forEach((m) => mergeOptions(to, m, instance));\r\n for (const key in from) {\r\n if (strats && hasOwn(strats, key)) {\r\n to[key] = strats[key](to[key], from[key], instance.proxy, key);\r\n }\r\n else {\r\n to[key] = from[key];\r\n }\r\n }\r\n}\n\n/**\r\n * #2437 In Vue 3, functional components do not have a public instance proxy but\r\n * they exist in the internal parent chain. For code that relies on traversing\r\n * public $parent chains, skip functional ones and go to the parent instead.\r\n */\r\nconst getPublicInstance = (i) => {\r\n if (!i)\r\n return null;\r\n if (isStatefulComponent(i))\r\n return i.exposed ? i.exposed : i.proxy;\r\n return getPublicInstance(i.parent);\r\n};\r\nconst publicPropertiesMap = extend(Object.create(null), {\r\n $: i => i,\r\n $el: i => i.vnode.el,\r\n $data: i => i.data,\r\n $props: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.props) : i.props),\r\n $attrs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.attrs) : i.attrs),\r\n $slots: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.slots) : i.slots),\r\n $refs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.refs) : i.refs),\r\n $parent: i => getPublicInstance(i.parent),\r\n $root: i => getPublicInstance(i.root),\r\n $emit: i => i.emit,\r\n $options: i => (__VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),\r\n $forceUpdate: i => () => queueJob(i.update),\r\n $nextTick: i => nextTick.bind(i.proxy),\r\n $watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)\r\n});\r\nconst PublicInstanceProxyHandlers = {\r\n get({ _: instance }, key) {\r\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\r\n // let @vue/reactivity know it should never observe Vue public instances.\r\n if (key === \"__v_skip\" /* SKIP */) {\r\n return true;\r\n }\r\n // for internal formatters to know that this is a Vue instance\r\n if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {\r\n return true;\r\n }\r\n // data / props / ctx\r\n // This getter gets called for every property access on the render context\r\n // during render and is a major hotspot. The most expensive part of this\r\n // is the multiple hasOwn() calls. It's much faster to do a simple property\r\n // access on a plain object, so we use an accessCache object (with null\r\n // prototype) to memoize what access type a key corresponds to.\r\n let normalizedProps;\r\n if (key[0] !== '$') {\r\n const n = accessCache[key];\r\n if (n !== undefined) {\r\n switch (n) {\r\n case 0 /* SETUP */:\r\n return setupState[key];\r\n case 1 /* DATA */:\r\n return data[key];\r\n case 3 /* CONTEXT */:\r\n return ctx[key];\r\n case 2 /* PROPS */:\r\n return props[key];\r\n // default: just fallthrough\r\n }\r\n }\r\n else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\r\n accessCache[key] = 0 /* SETUP */;\r\n return setupState[key];\r\n }\r\n else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\r\n accessCache[key] = 1 /* DATA */;\r\n return data[key];\r\n }\r\n else if (\r\n // only cache other properties when instance has declared (thus stable)\r\n // props\r\n (normalizedProps = instance.propsOptions[0]) &&\r\n hasOwn(normalizedProps, key)) {\r\n accessCache[key] = 2 /* PROPS */;\r\n return props[key];\r\n }\r\n else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\r\n accessCache[key] = 3 /* CONTEXT */;\r\n return ctx[key];\r\n }\r\n else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {\r\n accessCache[key] = 4 /* OTHER */;\r\n }\r\n }\r\n const publicGetter = publicPropertiesMap[key];\r\n let cssModule, globalProperties;\r\n // public $xxx properties\r\n if (publicGetter) {\r\n if (key === '$attrs') {\r\n track(instance, \"get\" /* GET */, key);\r\n (process.env.NODE_ENV !== 'production') && markAttrsAccessed();\r\n }\r\n return publicGetter(instance);\r\n }\r\n else if (\r\n // css module (injected by vue-loader)\r\n (cssModule = type.__cssModules) &&\r\n (cssModule = cssModule[key])) {\r\n return cssModule;\r\n }\r\n else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\r\n // user may set custom properties to `this` that start with `$`\r\n accessCache[key] = 3 /* CONTEXT */;\r\n return ctx[key];\r\n }\r\n else if (\r\n // global properties\r\n ((globalProperties = appContext.config.globalProperties),\r\n hasOwn(globalProperties, key))) {\r\n return globalProperties[key];\r\n }\r\n else if ((process.env.NODE_ENV !== 'production') &&\r\n currentRenderingInstance &&\r\n (!isString(key) ||\r\n // #1091 avoid internal isRef/isVNode checks on component instance leading\r\n // to infinite warning loop\r\n key.indexOf('__v') !== 0)) {\r\n if (data !== EMPTY_OBJ &&\r\n (key[0] === '$' || key[0] === '_') &&\r\n hasOwn(data, key)) {\r\n warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +\r\n `character (\"$\" or \"_\") and is not proxied on the render context.`);\r\n }\r\n else if (instance === currentRenderingInstance) {\r\n warn(`Property ${JSON.stringify(key)} was accessed during render ` +\r\n `but is not defined on instance.`);\r\n }\r\n }\r\n },\r\n set({ _: instance }, key, value) {\r\n const { data, setupState, ctx } = instance;\r\n if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\r\n setupState[key] = value;\r\n }\r\n else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\r\n data[key] = value;\r\n }\r\n else if (hasOwn(instance.props, key)) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Attempting to mutate prop \"${key}\". Props are readonly.`, instance);\r\n return false;\r\n }\r\n if (key[0] === '$' && key.slice(1) in instance) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Attempting to mutate public property \"${key}\". ` +\r\n `Properties starting with $ are reserved and readonly.`, instance);\r\n return false;\r\n }\r\n else {\r\n if ((process.env.NODE_ENV !== 'production') && key in instance.appContext.config.globalProperties) {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n value\r\n });\r\n }\r\n else {\r\n ctx[key] = value;\r\n }\r\n }\r\n return true;\r\n },\r\n has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {\r\n let normalizedProps;\r\n return (accessCache[key] !== undefined ||\r\n (data !== EMPTY_OBJ && hasOwn(data, key)) ||\r\n (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||\r\n ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||\r\n hasOwn(ctx, key) ||\r\n hasOwn(publicPropertiesMap, key) ||\r\n hasOwn(appContext.config.globalProperties, key));\r\n }\r\n};\r\nif ((process.env.NODE_ENV !== 'production') && !false) {\r\n PublicInstanceProxyHandlers.ownKeys = (target) => {\r\n warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +\r\n `The keys will be empty in production mode to avoid performance overhead.`);\r\n return Reflect.ownKeys(target);\r\n };\r\n}\r\nconst RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {\r\n get(target, key) {\r\n // fast path for unscopables when using `with` block\r\n if (key === Symbol.unscopables) {\r\n return;\r\n }\r\n return PublicInstanceProxyHandlers.get(target, key, target);\r\n },\r\n has(_, key) {\r\n const has = key[0] !== '_' && !isGloballyWhitelisted(key);\r\n if ((process.env.NODE_ENV !== 'production') && !has && PublicInstanceProxyHandlers.has(_, key)) {\r\n warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);\r\n }\r\n return has;\r\n }\r\n});\r\n// In dev mode, the proxy target exposes the same properties as seen on `this`\r\n// for easier console inspection. In prod mode it will be an empty object so\r\n// these properties definitions can be skipped.\r\nfunction createRenderContext(instance) {\r\n const target = {};\r\n // expose internal instance for proxy handlers\r\n Object.defineProperty(target, `_`, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () => instance\r\n });\r\n // expose public properties\r\n Object.keys(publicPropertiesMap).forEach(key => {\r\n Object.defineProperty(target, key, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () => publicPropertiesMap[key](instance),\r\n // intercepted by the proxy so no need for implementation,\r\n // but needed to prevent set errors\r\n set: NOOP\r\n });\r\n });\r\n // expose global properties\r\n const { globalProperties } = instance.appContext.config;\r\n Object.keys(globalProperties).forEach(key => {\r\n Object.defineProperty(target, key, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () => globalProperties[key],\r\n set: NOOP\r\n });\r\n });\r\n return target;\r\n}\r\n// dev only\r\nfunction exposePropsOnRenderContext(instance) {\r\n const { ctx, propsOptions: [propsOptions] } = instance;\r\n if (propsOptions) {\r\n Object.keys(propsOptions).forEach(key => {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => instance.props[key],\r\n set: NOOP\r\n });\r\n });\r\n }\r\n}\r\n// dev only\r\nfunction exposeSetupStateOnRenderContext(instance) {\r\n const { ctx, setupState } = instance;\r\n Object.keys(toRaw(setupState)).forEach(key => {\r\n if (key[0] === '$' || key[0] === '_') {\r\n warn(`setup() return property ${JSON.stringify(key)} should not start with \"$\" or \"_\" ` +\r\n `which are reserved prefixes for Vue internals.`);\r\n return;\r\n }\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => setupState[key],\r\n set: NOOP\r\n });\r\n });\r\n}\n\nconst emptyAppContext = createAppContext();\r\nlet uid$1 = 0;\r\nfunction createComponentInstance(vnode, parent, suspense) {\r\n const type = vnode.type;\r\n // inherit parent app context - or - if root, adopt from root vnode\r\n const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\r\n const instance = {\r\n uid: uid$1++,\r\n vnode,\r\n type,\r\n parent,\r\n appContext,\r\n root: null,\r\n next: null,\r\n subTree: null,\r\n update: null,\r\n render: null,\r\n proxy: null,\r\n exposed: null,\r\n withProxy: null,\r\n effects: null,\r\n provides: parent ? parent.provides : Object.create(appContext.provides),\r\n accessCache: null,\r\n renderCache: [],\r\n // local resovled assets\r\n components: null,\r\n directives: null,\r\n // resolved props and emits options\r\n propsOptions: normalizePropsOptions(type, appContext),\r\n emitsOptions: normalizeEmitsOptions(type, appContext),\r\n // emit\r\n emit: null,\r\n emitted: null,\r\n // props default value\r\n propsDefaults: EMPTY_OBJ,\r\n // state\r\n ctx: EMPTY_OBJ,\r\n data: EMPTY_OBJ,\r\n props: EMPTY_OBJ,\r\n attrs: EMPTY_OBJ,\r\n slots: EMPTY_OBJ,\r\n refs: EMPTY_OBJ,\r\n setupState: EMPTY_OBJ,\r\n setupContext: null,\r\n // suspense related\r\n suspense,\r\n suspenseId: suspense ? suspense.pendingId : 0,\r\n asyncDep: null,\r\n asyncResolved: false,\r\n // lifecycle hooks\r\n // not using enums here because it results in computed properties\r\n isMounted: false,\r\n isUnmounted: false,\r\n isDeactivated: false,\r\n bc: null,\r\n c: null,\r\n bm: null,\r\n m: null,\r\n bu: null,\r\n u: null,\r\n um: null,\r\n bum: null,\r\n da: null,\r\n a: null,\r\n rtg: null,\r\n rtc: null,\r\n ec: null\r\n };\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n instance.ctx = createRenderContext(instance);\r\n }\r\n else {\r\n instance.ctx = { _: instance };\r\n }\r\n instance.root = parent ? parent.root : instance;\r\n instance.emit = emit.bind(null, instance);\r\n return instance;\r\n}\r\nlet currentInstance = null;\r\nconst getCurrentInstance = () => currentInstance || currentRenderingInstance;\r\nconst setCurrentInstance = (instance) => {\r\n currentInstance = instance;\r\n};\r\nconst isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');\r\nfunction validateComponentName(name, config) {\r\n const appIsNativeTag = config.isNativeTag || NO;\r\n if (isBuiltInTag(name) || appIsNativeTag(name)) {\r\n warn('Do not use built-in or reserved HTML elements as component id: ' + name);\r\n }\r\n}\r\nfunction isStatefulComponent(instance) {\r\n return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;\r\n}\r\nlet isInSSRComponentSetup = false;\r\nfunction setupComponent(instance, isSSR = false) {\r\n isInSSRComponentSetup = isSSR;\r\n const { props, children } = instance.vnode;\r\n const isStateful = isStatefulComponent(instance);\r\n initProps(instance, props, isStateful, isSSR);\r\n initSlots(instance, children);\r\n const setupResult = isStateful\r\n ? setupStatefulComponent(instance, isSSR)\r\n : undefined;\r\n isInSSRComponentSetup = false;\r\n return setupResult;\r\n}\r\nfunction setupStatefulComponent(instance, isSSR) {\r\n const Component = instance.type;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n if (Component.name) {\r\n validateComponentName(Component.name, instance.appContext.config);\r\n }\r\n if (Component.components) {\r\n const names = Object.keys(Component.components);\r\n for (let i = 0; i < names.length; i++) {\r\n validateComponentName(names[i], instance.appContext.config);\r\n }\r\n }\r\n if (Component.directives) {\r\n const names = Object.keys(Component.directives);\r\n for (let i = 0; i < names.length; i++) {\r\n validateDirectiveName(names[i]);\r\n }\r\n }\r\n }\r\n // 0. create render proxy property access cache\r\n instance.accessCache = Object.create(null);\r\n // 1. create public instance / render proxy\r\n // also mark it raw so it's never observed\r\n instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n exposePropsOnRenderContext(instance);\r\n }\r\n // 2. call setup()\r\n const { setup } = Component;\r\n if (setup) {\r\n const setupContext = (instance.setupContext =\r\n setup.length > 1 ? createSetupContext(instance) : null);\r\n currentInstance = instance;\r\n pauseTracking();\r\n const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);\r\n resetTracking();\r\n currentInstance = null;\r\n if (isPromise(setupResult)) {\r\n if (isSSR) {\r\n // return the promise so server-renderer can wait on it\r\n return setupResult\r\n .then((resolvedResult) => {\r\n handleSetupResult(instance, resolvedResult, isSSR);\r\n })\r\n .catch(e => {\r\n handleError(e, instance, 0 /* SETUP_FUNCTION */);\r\n });\r\n }\r\n else {\r\n // async setup returned Promise.\r\n // bail here and wait for re-entry.\r\n instance.asyncDep = setupResult;\r\n }\r\n }\r\n else {\r\n handleSetupResult(instance, setupResult, isSSR);\r\n }\r\n }\r\n else {\r\n finishComponentSetup(instance, isSSR);\r\n }\r\n}\r\nfunction handleSetupResult(instance, setupResult, isSSR) {\r\n if (isFunction(setupResult)) {\r\n // setup returned an inline render function\r\n {\r\n instance.render = setupResult;\r\n }\r\n }\r\n else if (isObject(setupResult)) {\r\n if ((process.env.NODE_ENV !== 'production') && isVNode(setupResult)) {\r\n warn(`setup() should not return VNodes directly - ` +\r\n `return a render function instead.`);\r\n }\r\n // setup returned bindings.\r\n // assuming a render function compiled from template is present.\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n instance.devtoolsRawSetupState = setupResult;\r\n }\r\n instance.setupState = proxyRefs(setupResult);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n exposeSetupStateOnRenderContext(instance);\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production') && setupResult !== undefined) {\r\n warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);\r\n }\r\n finishComponentSetup(instance, isSSR);\r\n}\r\nlet compile;\r\n// dev only\r\nconst isRuntimeOnly = () => !compile;\r\n/**\r\n * For runtime-dom to register the compiler.\r\n * Note the exported method uses any to avoid d.ts relying on the compiler types.\r\n */\r\nfunction registerRuntimeCompiler(_compile) {\r\n compile = _compile;\r\n}\r\nfunction finishComponentSetup(instance, isSSR) {\r\n const Component = instance.type;\r\n // template / render function normalization\r\n if (!instance.render) {\r\n // could be set from setup()\r\n if (compile && Component.template && !Component.render) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n startMeasure(instance, `compile`);\r\n }\r\n Component.render = compile(Component.template, {\r\n isCustomElement: instance.appContext.config.isCustomElement,\r\n delimiters: Component.delimiters\r\n });\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n endMeasure(instance, `compile`);\r\n }\r\n }\r\n instance.render = (Component.render || NOOP);\r\n // for runtime-compiled render functions using `with` blocks, the render\r\n // proxy used needs a different `has` handler which is more performant and\r\n // also only allows a whitelist of globals to fallthrough.\r\n if (instance.render._rc) {\r\n instance.withProxy = new Proxy(instance.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\r\n }\r\n }\r\n // support for 2.x options\r\n if (__VUE_OPTIONS_API__) {\r\n currentInstance = instance;\r\n pauseTracking();\r\n applyOptions(instance, Component);\r\n resetTracking();\r\n currentInstance = null;\r\n }\r\n // warn missing template/render\r\n // the runtime compilation of template in SSR is done by server-render\r\n if ((process.env.NODE_ENV !== 'production') && !Component.render && instance.render === NOOP && !isSSR) {\r\n /* istanbul ignore if */\r\n if (!compile && Component.template) {\r\n warn(`Component provided template option but ` +\r\n `runtime compilation is not supported in this build of Vue.` +\r\n (` Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".`\r\n ) /* should not happen */);\r\n }\r\n else {\r\n warn(`Component is missing template or render function.`);\r\n }\r\n }\r\n}\r\nconst attrHandlers = {\r\n get: (target, key) => {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n markAttrsAccessed();\r\n }\r\n return target[key];\r\n },\r\n set: () => {\r\n warn(`setupContext.attrs is readonly.`);\r\n return false;\r\n },\r\n deleteProperty: () => {\r\n warn(`setupContext.attrs is readonly.`);\r\n return false;\r\n }\r\n};\r\nfunction createSetupContext(instance) {\r\n const expose = exposed => {\r\n if ((process.env.NODE_ENV !== 'production') && instance.exposed) {\r\n warn(`expose() should be called only once per setup().`);\r\n }\r\n instance.exposed = proxyRefs(exposed);\r\n };\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n // We use getters in dev in case libs like test-utils overwrite instance\r\n // properties (overwrites should not be done in prod)\r\n return Object.freeze({\r\n get attrs() {\r\n return new Proxy(instance.attrs, attrHandlers);\r\n },\r\n get slots() {\r\n return shallowReadonly(instance.slots);\r\n },\r\n get emit() {\r\n return (event, ...args) => instance.emit(event, ...args);\r\n },\r\n expose\r\n });\r\n }\r\n else {\r\n return {\r\n attrs: instance.attrs,\r\n slots: instance.slots,\r\n emit: instance.emit,\r\n expose\r\n };\r\n }\r\n}\r\n// record effects created during a component's setup() so that they can be\r\n// stopped when the component unmounts\r\nfunction recordInstanceBoundEffect(effect, instance = currentInstance) {\r\n if (instance) {\r\n (instance.effects || (instance.effects = [])).push(effect);\r\n }\r\n}\r\nconst classifyRE = /(?:^|[-_])(\\w)/g;\r\nconst classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');\r\nfunction getComponentName(Component) {\r\n return isFunction(Component)\r\n ? Component.displayName || Component.name\r\n : Component.name;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatComponentName(instance, Component, isRoot = false) {\r\n let name = getComponentName(Component);\r\n if (!name && Component.__file) {\r\n const match = Component.__file.match(/([^/\\\\]+)\\.\\w+$/);\r\n if (match) {\r\n name = match[1];\r\n }\r\n }\r\n if (!name && instance && instance.parent) {\r\n // try to infer the name based on reverse resolution\r\n const inferFromRegistry = (registry) => {\r\n for (const key in registry) {\r\n if (registry[key] === Component) {\r\n return key;\r\n }\r\n }\r\n };\r\n name =\r\n inferFromRegistry(instance.components ||\r\n instance.parent.type.components) || inferFromRegistry(instance.appContext.components);\r\n }\r\n return name ? classify(name) : isRoot ? `App` : `Anonymous`;\r\n}\r\nfunction isClassComponent(value) {\r\n return isFunction(value) && '__vccOpts' in value;\r\n}\n\nfunction computed(getterOrOptions) {\r\n const c = computed$1(getterOrOptions);\r\n recordInstanceBoundEffect(c.effect);\r\n return c;\r\n}\n\n// implementation\r\nfunction defineProps() {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`defineProps() is a compiler-hint helper that is only usable inside ` +\r\n `<script setup> of a single file component. Its arguments should be ` +\r\n `compiled away and passing it at runtime has no effect.`);\r\n }\r\n return null;\r\n}\r\n// implementation\r\nfunction defineEmit() {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`defineEmit() is a compiler-hint helper that is only usable inside ` +\r\n `<script setup> of a single file component. Its arguments should be ` +\r\n `compiled away and passing it at runtime has no effect.`);\r\n }\r\n return null;\r\n}\r\nfunction useContext() {\r\n const i = getCurrentInstance();\r\n if ((process.env.NODE_ENV !== 'production') && !i) {\r\n warn(`useContext() called without active instance.`);\r\n }\r\n return i.setupContext || (i.setupContext = createSetupContext(i));\r\n}\n\n// Actual implementation\r\nfunction h(type, propsOrChildren, children) {\r\n const l = arguments.length;\r\n if (l === 2) {\r\n if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {\r\n // single vnode without props\r\n if (isVNode(propsOrChildren)) {\r\n return createVNode(type, null, [propsOrChildren]);\r\n }\r\n // props without children\r\n return createVNode(type, propsOrChildren);\r\n }\r\n else {\r\n // omit props\r\n return createVNode(type, null, propsOrChildren);\r\n }\r\n }\r\n else {\r\n if (l > 3) {\r\n children = Array.prototype.slice.call(arguments, 2);\r\n }\r\n else if (l === 3 && isVNode(children)) {\r\n children = [children];\r\n }\r\n return createVNode(type, propsOrChildren, children);\r\n }\r\n}\n\nconst ssrContextKey = Symbol((process.env.NODE_ENV !== 'production') ? `ssrContext` : ``);\r\nconst useSSRContext = () => {\r\n {\r\n const ctx = inject(ssrContextKey);\r\n if (!ctx) {\r\n warn(`Server rendering context not provided. Make sure to only call ` +\r\n `useSSRContext() conditionally in the server build.`);\r\n }\r\n return ctx;\r\n }\r\n};\n\nfunction initCustomFormatter() {\r\n /* eslint-disable no-restricted-globals */\r\n if (!(process.env.NODE_ENV !== 'production') || typeof window === 'undefined') {\r\n return;\r\n }\r\n const vueStyle = { style: 'color:#3ba776' };\r\n const numberStyle = { style: 'color:#0b1bc9' };\r\n const stringStyle = { style: 'color:#b62e24' };\r\n const keywordStyle = { style: 'color:#9d288c' };\r\n // custom formatter for Chrome\r\n // https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\r\n const formatter = {\r\n header(obj) {\r\n // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup\r\n if (!isObject(obj)) {\r\n return null;\r\n }\r\n if (obj.__isVue) {\r\n return ['div', vueStyle, `VueInstance`];\r\n }\r\n else if (isRef(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, genRefFlag(obj)],\r\n '<',\r\n formatValue(obj.value),\r\n `>`\r\n ];\r\n }\r\n else if (isReactive(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, 'Reactive'],\r\n '<',\r\n formatValue(obj),\r\n `>${isReadonly(obj) ? ` (readonly)` : ``}`\r\n ];\r\n }\r\n else if (isReadonly(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, 'Readonly'],\r\n '<',\r\n formatValue(obj),\r\n '>'\r\n ];\r\n }\r\n return null;\r\n },\r\n hasBody(obj) {\r\n return obj && obj.__isVue;\r\n },\r\n body(obj) {\r\n if (obj && obj.__isVue) {\r\n return [\r\n 'div',\r\n {},\r\n ...formatInstance(obj.$)\r\n ];\r\n }\r\n }\r\n };\r\n function formatInstance(instance) {\r\n const blocks = [];\r\n if (instance.type.props && instance.props) {\r\n blocks.push(createInstanceBlock('props', toRaw(instance.props)));\r\n }\r\n if (instance.setupState !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('setup', instance.setupState));\r\n }\r\n if (instance.data !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('data', toRaw(instance.data)));\r\n }\r\n const computed = extractKeys(instance, 'computed');\r\n if (computed) {\r\n blocks.push(createInstanceBlock('computed', computed));\r\n }\r\n const injected = extractKeys(instance, 'inject');\r\n if (injected) {\r\n blocks.push(createInstanceBlock('injected', injected));\r\n }\r\n blocks.push([\r\n 'div',\r\n {},\r\n [\r\n 'span',\r\n {\r\n style: keywordStyle.style + ';opacity:0.66'\r\n },\r\n '$ (internal): '\r\n ],\r\n ['object', { object: instance }]\r\n ]);\r\n return blocks;\r\n }\r\n function createInstanceBlock(type, target) {\r\n target = extend({}, target);\r\n if (!Object.keys(target).length) {\r\n return ['span', {}];\r\n }\r\n return [\r\n 'div',\r\n { style: 'line-height:1.25em;margin-bottom:0.6em' },\r\n [\r\n 'div',\r\n {\r\n style: 'color:#476582'\r\n },\r\n type\r\n ],\r\n [\r\n 'div',\r\n {\r\n style: 'padding-left:1.25em'\r\n },\r\n ...Object.keys(target).map(key => {\r\n return [\r\n 'div',\r\n {},\r\n ['span', keywordStyle, key + ': '],\r\n formatValue(target[key], false)\r\n ];\r\n })\r\n ]\r\n ];\r\n }\r\n function formatValue(v, asRaw = true) {\r\n if (typeof v === 'number') {\r\n return ['span', numberStyle, v];\r\n }\r\n else if (typeof v === 'string') {\r\n return ['span', stringStyle, JSON.stringify(v)];\r\n }\r\n else if (typeof v === 'boolean') {\r\n return ['span', keywordStyle, v];\r\n }\r\n else if (isObject(v)) {\r\n return ['object', { object: asRaw ? toRaw(v) : v }];\r\n }\r\n else {\r\n return ['span', stringStyle, String(v)];\r\n }\r\n }\r\n function extractKeys(instance, type) {\r\n const Comp = instance.type;\r\n if (isFunction(Comp)) {\r\n return;\r\n }\r\n const extracted = {};\r\n for (const key in instance.ctx) {\r\n if (isKeyOfType(Comp, key, type)) {\r\n extracted[key] = instance.ctx[key];\r\n }\r\n }\r\n return extracted;\r\n }\r\n function isKeyOfType(Comp, key, type) {\r\n const opts = Comp[type];\r\n if ((isArray(opts) && opts.includes(key)) ||\r\n (isObject(opts) && key in opts)) {\r\n return true;\r\n }\r\n if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {\r\n return true;\r\n }\r\n if (Comp.mixins && Comp.mixins.some(m => isKeyOfType(m, key, type))) {\r\n return true;\r\n }\r\n }\r\n function genRefFlag(v) {\r\n if (v._shallow) {\r\n return `ShallowRef`;\r\n }\r\n if (v.effect) {\r\n return `ComputedRef`;\r\n }\r\n return `Ref`;\r\n }\r\n if (window.devtoolsFormatters) {\r\n window.devtoolsFormatters.push(formatter);\r\n }\r\n else {\r\n window.devtoolsFormatters = [formatter];\r\n }\r\n}\n\n/**\r\n * Actual implementation\r\n */\r\nfunction renderList(source, renderItem) {\r\n let ret;\r\n if (isArray(source) || isString(source)) {\r\n ret = new Array(source.length);\r\n for (let i = 0, l = source.length; i < l; i++) {\r\n ret[i] = renderItem(source[i], i);\r\n }\r\n }\r\n else if (typeof source === 'number') {\r\n if ((process.env.NODE_ENV !== 'production') && !Number.isInteger(source)) {\r\n warn(`The v-for range expect an integer value but got ${source}.`);\r\n return [];\r\n }\r\n ret = new Array(source);\r\n for (let i = 0; i < source; i++) {\r\n ret[i] = renderItem(i + 1, i);\r\n }\r\n }\r\n else if (isObject(source)) {\r\n if (source[Symbol.iterator]) {\r\n ret = Array.from(source, renderItem);\r\n }\r\n else {\r\n const keys = Object.keys(source);\r\n ret = new Array(keys.length);\r\n for (let i = 0, l = keys.length; i < l; i++) {\r\n const key = keys[i];\r\n ret[i] = renderItem(source[key], key, i);\r\n }\r\n }\r\n }\r\n else {\r\n ret = [];\r\n }\r\n return ret;\r\n}\n\n/**\r\n * For prefixing keys in v-on=\"obj\" with \"on\"\r\n * @private\r\n */\r\nfunction toHandlers(obj) {\r\n const ret = {};\r\n if ((process.env.NODE_ENV !== 'production') && !isObject(obj)) {\r\n warn(`v-on with no argument expects an object value.`);\r\n return ret;\r\n }\r\n for (const key in obj) {\r\n ret[toHandlerKey(key)] = obj[key];\r\n }\r\n return ret;\r\n}\n\n/**\r\n * Compiler runtime helper for creating dynamic slots object\r\n * @private\r\n */\r\nfunction createSlots(slots, dynamicSlots) {\r\n for (let i = 0; i < dynamicSlots.length; i++) {\r\n const slot = dynamicSlots[i];\r\n // array of dynamic slot generated by <template v-for=\"...\" #[...]>\r\n if (isArray(slot)) {\r\n for (let j = 0; j < slot.length; j++) {\r\n slots[slot[j].name] = slot[j].fn;\r\n }\r\n }\r\n else if (slot) {\r\n // conditional single slot generated by <template v-if=\"...\" #foo>\r\n slots[slot.name] = slot.fn;\r\n }\r\n }\r\n return slots;\r\n}\n\n// Core API ------------------------------------------------------------------\r\nconst version = \"3.0.11\";\r\n/**\r\n * SSR utils for \\@vue/server-renderer. Only exposed in cjs builds.\r\n * @internal\r\n */\r\nconst ssrUtils = (null);\n\nexport { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, computed, createBlock, createCommentVNode, createHydrationRenderer, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmit, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, h, handleError, initCustomFormatter, inject, isRuntimeOnly, isVNode, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useContext, useSSRContext, useTransitionState, version, warn, watch, watchEffect, withCtx, withDirectives, withScopeId };\n","import { camelize, warn, callWithAsyncErrorHandling, getCurrentInstance, onMounted, watchEffect, onUpdated, Fragment, h, BaseTransition, useTransitionState, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, createVNode, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';\nexport * from '@vue/runtime-core';\nimport { isString, isArray, hyphenate, capitalize, isSpecialBooleanAttr, isOn, isModelListener, isFunction, EMPTY_OBJ, extend, isObject, toNumber, invokeArrayFns, looseIndexOf, isSet, looseEqual, isHTMLTag, isSVGTag } from '@vue/shared';\n\nconst svgNS = 'http://www.w3.org/2000/svg';\r\nconst doc = (typeof document !== 'undefined' ? document : null);\r\nlet tempContainer;\r\nlet tempSVGContainer;\r\nconst nodeOps = {\r\n insert: (child, parent, anchor) => {\r\n parent.insertBefore(child, anchor || null);\r\n },\r\n remove: child => {\r\n const parent = child.parentNode;\r\n if (parent) {\r\n parent.removeChild(child);\r\n }\r\n },\r\n createElement: (tag, isSVG, is, props) => {\r\n const el = isSVG\r\n ? doc.createElementNS(svgNS, tag)\r\n : doc.createElement(tag, is ? { is } : undefined);\r\n if (tag === 'select' && props && props.multiple != null) {\r\n el.setAttribute('multiple', props.multiple);\r\n }\r\n return el;\r\n },\r\n createText: text => doc.createTextNode(text),\r\n createComment: text => doc.createComment(text),\r\n setText: (node, text) => {\r\n node.nodeValue = text;\r\n },\r\n setElementText: (el, text) => {\r\n el.textContent = text;\r\n },\r\n parentNode: node => node.parentNode,\r\n nextSibling: node => node.nextSibling,\r\n querySelector: selector => doc.querySelector(selector),\r\n setScopeId(el, id) {\r\n el.setAttribute(id, '');\r\n },\r\n cloneNode(el) {\r\n const cloned = el.cloneNode(true);\r\n // #3072\r\n // - in `patchDOMProp`, we store the actual value in the `el._value` property.\r\n // - normally, elements using `:value` bindings will not be hoisted, but if\r\n // the bound value is a constant, e.g. `:value=\"true\"` - they do get\r\n // hoisted.\r\n // - in production, hoisted nodes are cloned when subsequent inserts, but\r\n // cloneNode() does not copy the custom property we attached.\r\n // - This may need to account for other custom DOM properties we attach to\r\n // elements in addition to `_value` in the future.\r\n if (`_value` in el) {\r\n cloned._value = el._value;\r\n }\r\n return cloned;\r\n },\r\n // __UNSAFE__\r\n // Reason: innerHTML.\r\n // Static content here can only come from compiled templates.\r\n // As long as the user only uses trusted templates, this is safe.\r\n insertStaticContent(content, parent, anchor, isSVG) {\r\n const temp = isSVG\r\n ? tempSVGContainer ||\r\n (tempSVGContainer = doc.createElementNS(svgNS, 'svg'))\r\n : tempContainer || (tempContainer = doc.createElement('div'));\r\n temp.innerHTML = content;\r\n const first = temp.firstChild;\r\n let node = first;\r\n let last = node;\r\n while (node) {\r\n last = node;\r\n nodeOps.insert(node, parent, anchor);\r\n node = temp.firstChild;\r\n }\r\n return [first, last];\r\n }\r\n};\n\n// compiler should normalize class + :class bindings on the same element\r\n// into a single binding ['staticClass', dynamic]\r\nfunction patchClass(el, value, isSVG) {\r\n if (value == null) {\r\n value = '';\r\n }\r\n if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value\r\n ? [value, ...transitionClasses]\r\n : [...transitionClasses]).join(' ');\r\n }\r\n el.className = value;\r\n }\r\n}\n\nfunction patchStyle(el, prev, next) {\r\n const style = el.style;\r\n if (!next) {\r\n el.removeAttribute('style');\r\n }\r\n else if (isString(next)) {\r\n if (prev !== next) {\r\n const current = style.display;\r\n style.cssText = next;\r\n // indicates that the `display` of the element is controlled by `v-show`,\r\n // so we always keep the current `display` value regardless of the `style` value,\r\n // thus handing over control to `v-show`.\r\n if ('_vod' in el) {\r\n style.display = current;\r\n }\r\n }\r\n }\r\n else {\r\n for (const key in next) {\r\n setStyle(style, key, next[key]);\r\n }\r\n if (prev && !isString(prev)) {\r\n for (const key in prev) {\r\n if (next[key] == null) {\r\n setStyle(style, key, '');\r\n }\r\n }\r\n }\r\n }\r\n}\r\nconst importantRE = /\\s*!important$/;\r\nfunction setStyle(style, name, val) {\r\n if (isArray(val)) {\r\n val.forEach(v => setStyle(style, name, v));\r\n }\r\n else {\r\n if (name.startsWith('--')) {\r\n // custom property definition\r\n style.setProperty(name, val);\r\n }\r\n else {\r\n const prefixed = autoPrefix(style, name);\r\n if (importantRE.test(val)) {\r\n // !important\r\n style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important');\r\n }\r\n else {\r\n style[prefixed] = val;\r\n }\r\n }\r\n }\r\n}\r\nconst prefixes = ['Webkit', 'Moz', 'ms'];\r\nconst prefixCache = {};\r\nfunction autoPrefix(style, rawName) {\r\n const cached = prefixCache[rawName];\r\n if (cached) {\r\n return cached;\r\n }\r\n let name = camelize(rawName);\r\n if (name !== 'filter' && name in style) {\r\n return (prefixCache[rawName] = name);\r\n }\r\n name = capitalize(name);\r\n for (let i = 0; i < prefixes.length; i++) {\r\n const prefixed = prefixes[i] + name;\r\n if (prefixed in style) {\r\n return (prefixCache[rawName] = prefixed);\r\n }\r\n }\r\n return rawName;\r\n}\n\nconst xlinkNS = 'http://www.w3.org/1999/xlink';\r\nfunction patchAttr(el, key, value, isSVG) {\r\n if (isSVG && key.startsWith('xlink:')) {\r\n if (value == null) {\r\n el.removeAttributeNS(xlinkNS, key.slice(6, key.length));\r\n }\r\n else {\r\n el.setAttributeNS(xlinkNS, key, value);\r\n }\r\n }\r\n else {\r\n // note we are only checking boolean attributes that don't have a\r\n // corresponding dom prop of the same name here.\r\n const isBoolean = isSpecialBooleanAttr(key);\r\n if (value == null || (isBoolean && value === false)) {\r\n el.removeAttribute(key);\r\n }\r\n else {\r\n el.setAttribute(key, isBoolean ? '' : value);\r\n }\r\n }\r\n}\n\n// __UNSAFE__\r\n// functions. The user is responsible for using them with only trusted content.\r\nfunction patchDOMProp(el, key, value, \r\n// the following args are passed only due to potential innerHTML/textContent\r\n// overriding existing VNodes, in which case the old tree must be properly\r\n// unmounted.\r\nprevChildren, parentComponent, parentSuspense, unmountChildren) {\r\n if (key === 'innerHTML' || key === 'textContent') {\r\n if (prevChildren) {\r\n unmountChildren(prevChildren, parentComponent, parentSuspense);\r\n }\r\n el[key] = value == null ? '' : value;\r\n return;\r\n }\r\n if (key === 'value' && el.tagName !== 'PROGRESS') {\r\n // store value as _value as well since\r\n // non-string values will be stringified.\r\n el._value = value;\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue) {\r\n el.value = newValue;\r\n }\r\n return;\r\n }\r\n if (value === '' || value == null) {\r\n const type = typeof el[key];\r\n if (value === '' && type === 'boolean') {\r\n // e.g. <select multiple> compiles to { multiple: '' }\r\n el[key] = true;\r\n return;\r\n }\r\n else if (value == null && type === 'string') {\r\n // e.g. <div :id=\"null\">\r\n el[key] = '';\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n else if (type === 'number') {\r\n // e.g. <img :width=\"null\">\r\n el[key] = 0;\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n }\r\n // some properties perform value validation and throw\r\n try {\r\n el[key] = value;\r\n }\r\n catch (e) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Failed setting prop \"${key}\" on <${el.tagName.toLowerCase()}>: ` +\r\n `value ${value} is invalid.`, e);\r\n }\r\n }\r\n}\n\n// Async edge case fix requires storing an event listener's attach timestamp.\r\nlet _getNow = Date.now;\r\nlet skipTimestampCheck = false;\r\nif (typeof window !== 'undefined') {\r\n // Determine what event timestamp the browser is using. Annoyingly, the\r\n // timestamp can either be hi-res (relative to page load) or low-res\r\n // (relative to UNIX epoch), so in order to compare time we have to use the\r\n // same timestamp type when saving the flush timestamp.\r\n if (_getNow() > document.createEvent('Event').timeStamp) {\r\n // if the low-res timestamp which is bigger than the event timestamp\r\n // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\r\n // and we need to use the hi-res version for event listeners as well.\r\n _getNow = () => performance.now();\r\n }\r\n // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation\r\n // and does not fire microtasks in between event propagation, so safe to exclude.\r\n const ffMatch = navigator.userAgent.match(/firefox\\/(\\d+)/i);\r\n skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);\r\n}\r\n// To avoid the overhead of repeatedly calling performance.now(), we cache\r\n// and use the same timestamp for all event listeners attached in the same tick.\r\nlet cachedNow = 0;\r\nconst p = Promise.resolve();\r\nconst reset = () => {\r\n cachedNow = 0;\r\n};\r\nconst getNow = () => cachedNow || (p.then(reset), (cachedNow = _getNow()));\r\nfunction addEventListener(el, event, handler, options) {\r\n el.addEventListener(event, handler, options);\r\n}\r\nfunction removeEventListener(el, event, handler, options) {\r\n el.removeEventListener(event, handler, options);\r\n}\r\nfunction patchEvent(el, rawName, prevValue, nextValue, instance = null) {\r\n // vei = vue event invokers\r\n const invokers = el._vei || (el._vei = {});\r\n const existingInvoker = invokers[rawName];\r\n if (nextValue && existingInvoker) {\r\n // patch\r\n existingInvoker.value = nextValue;\r\n }\r\n else {\r\n const [name, options] = parseName(rawName);\r\n if (nextValue) {\r\n // add\r\n const invoker = (invokers[rawName] = createInvoker(nextValue, instance));\r\n addEventListener(el, name, invoker, options);\r\n }\r\n else if (existingInvoker) {\r\n // remove\r\n removeEventListener(el, name, existingInvoker, options);\r\n invokers[rawName] = undefined;\r\n }\r\n }\r\n}\r\nconst optionsModifierRE = /(?:Once|Passive|Capture)$/;\r\nfunction parseName(name) {\r\n let options;\r\n if (optionsModifierRE.test(name)) {\r\n options = {};\r\n let m;\r\n while ((m = name.match(optionsModifierRE))) {\r\n name = name.slice(0, name.length - m[0].length);\r\n options[m[0].toLowerCase()] = true;\r\n }\r\n }\r\n return [hyphenate(name.slice(2)), options];\r\n}\r\nfunction createInvoker(initialValue, instance) {\r\n const invoker = (e) => {\r\n // async edge case #6566: inner click event triggers patch, event handler\r\n // attached to outer element during patch, and triggered again. This\r\n // happens because browsers fire microtask ticks between event propagation.\r\n // the solution is simple: we save the timestamp when a handler is attached,\r\n // and the handler would only fire if the event passed to it was fired\r\n // AFTER it was attached.\r\n const timeStamp = e.timeStamp || _getNow();\r\n if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {\r\n callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);\r\n }\r\n };\r\n invoker.value = initialValue;\r\n invoker.attached = getNow();\r\n return invoker;\r\n}\r\nfunction patchStopImmediatePropagation(e, value) {\r\n if (isArray(value)) {\r\n const originalStop = e.stopImmediatePropagation;\r\n e.stopImmediatePropagation = () => {\r\n originalStop.call(e);\r\n e._stopped = true;\r\n };\r\n return value.map(fn => (e) => !e._stopped && fn(e));\r\n }\r\n else {\r\n return value;\r\n }\r\n}\n\nconst nativeOnRE = /^on[a-z]/;\r\nconst forcePatchProp = (_, key) => key === 'value';\r\nconst patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {\r\n switch (key) {\r\n // special\r\n case 'class':\r\n patchClass(el, nextValue, isSVG);\r\n break;\r\n case 'style':\r\n patchStyle(el, prevValue, nextValue);\r\n break;\r\n default:\r\n if (isOn(key)) {\r\n // ignore v-model listeners\r\n if (!isModelListener(key)) {\r\n patchEvent(el, key, prevValue, nextValue, parentComponent);\r\n }\r\n }\r\n else if (shouldSetAsProp(el, key, nextValue, isSVG)) {\r\n patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n else {\r\n // special case for <input v-model type=\"checkbox\"> with\r\n // :true-value & :false-value\r\n // store value as dom properties since non-string values will be\r\n // stringified.\r\n if (key === 'true-value') {\r\n el._trueValue = nextValue;\r\n }\r\n else if (key === 'false-value') {\r\n el._falseValue = nextValue;\r\n }\r\n patchAttr(el, key, nextValue, isSVG);\r\n }\r\n break;\r\n }\r\n};\r\nfunction shouldSetAsProp(el, key, value, isSVG) {\r\n if (isSVG) {\r\n // most keys must be set as attribute on svg elements to work\r\n // ...except innerHTML\r\n if (key === 'innerHTML') {\r\n return true;\r\n }\r\n // or native onclick with function values\r\n if (key in el && nativeOnRE.test(key) && isFunction(value)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // spellcheck and draggable are numerated attrs, however their\r\n // corresponding DOM properties are actually booleans - this leads to\r\n // setting it with a string \"false\" value leading it to be coerced to\r\n // `true`, so we need to always treat them as attributes.\r\n // Note that `contentEditable` doesn't have this problem: its DOM\r\n // property is also enumerated string values.\r\n if (key === 'spellcheck' || key === 'draggable') {\r\n return false;\r\n }\r\n // #1787, #2840 form property on form elements is readonly and must be set as\r\n // attribute.\r\n if (key === 'form') {\r\n return false;\r\n }\r\n // #1526 <input list> must be set as attribute\r\n if (key === 'list' && el.tagName === 'INPUT') {\r\n return false;\r\n }\r\n // #2766 <textarea type> must be set as attribute\r\n if (key === 'type' && el.tagName === 'TEXTAREA') {\r\n return false;\r\n }\r\n // native onclick with string value, must be set as attribute\r\n if (nativeOnRE.test(key) && isString(value)) {\r\n return false;\r\n }\r\n return key in el;\r\n}\n\nfunction useCssModule(name = '$style') {\r\n /* istanbul ignore else */\r\n {\r\n const instance = getCurrentInstance();\r\n if (!instance) {\r\n (process.env.NODE_ENV !== 'production') && warn(`useCssModule must be called inside setup()`);\r\n return EMPTY_OBJ;\r\n }\r\n const modules = instance.type.__cssModules;\r\n if (!modules) {\r\n (process.env.NODE_ENV !== 'production') && warn(`Current instance does not have CSS modules injected.`);\r\n return EMPTY_OBJ;\r\n }\r\n const mod = modules[name];\r\n if (!mod) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Current instance does not have CSS module named \"${name}\".`);\r\n return EMPTY_OBJ;\r\n }\r\n return mod;\r\n }\r\n}\n\n/**\r\n * Runtime helper for SFC's CSS variable injection feature.\r\n * @private\r\n */\r\nfunction useCssVars(getter) {\r\n const instance = getCurrentInstance();\r\n /* istanbul ignore next */\r\n if (!instance) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`useCssVars is called without current active component instance.`);\r\n return;\r\n }\r\n const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));\r\n onMounted(() => watchEffect(setVars, { flush: 'post' }));\r\n onUpdated(setVars);\r\n}\r\nfunction setVarsOnVNode(vnode, vars) {\r\n if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n const suspense = vnode.suspense;\r\n vnode = suspense.activeBranch;\r\n if (suspense.pendingBranch && !suspense.isHydrating) {\r\n suspense.effects.push(() => {\r\n setVarsOnVNode(suspense.activeBranch, vars);\r\n });\r\n }\r\n }\r\n // drill down HOCs until it's a non-component vnode\r\n while (vnode.component) {\r\n vnode = vnode.component.subTree;\r\n }\r\n if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {\r\n const style = vnode.el.style;\r\n for (const key in vars) {\r\n style.setProperty(`--${key}`, vars[key]);\r\n }\r\n }\r\n else if (vnode.type === Fragment) {\r\n vnode.children.forEach(c => setVarsOnVNode(c, vars));\r\n }\r\n}\n\nconst TRANSITION = 'transition';\r\nconst ANIMATION = 'animation';\r\n// DOM Transition is a higher-order-component based on the platform-agnostic\r\n// base Transition component, with DOM-specific logic.\r\nconst Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);\r\nTransition.displayName = 'Transition';\r\nconst DOMTransitionPropsValidators = {\r\n name: String,\r\n type: String,\r\n css: {\r\n type: Boolean,\r\n default: true\r\n },\r\n duration: [String, Number, Object],\r\n enterFromClass: String,\r\n enterActiveClass: String,\r\n enterToClass: String,\r\n appearFromClass: String,\r\n appearActiveClass: String,\r\n appearToClass: String,\r\n leaveFromClass: String,\r\n leaveActiveClass: String,\r\n leaveToClass: String\r\n};\r\nconst TransitionPropsValidators = (Transition.props = /*#__PURE__*/ extend({}, BaseTransition.props, DOMTransitionPropsValidators));\r\nfunction resolveTransitionProps(rawProps) {\r\n let { name = 'v', type, css = true, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;\r\n const baseProps = {};\r\n for (const key in rawProps) {\r\n if (!(key in DOMTransitionPropsValidators)) {\r\n baseProps[key] = rawProps[key];\r\n }\r\n }\r\n if (!css) {\r\n return baseProps;\r\n }\r\n const durations = normalizeDuration(duration);\r\n const enterDuration = durations && durations[0];\r\n const leaveDuration = durations && durations[1];\r\n const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;\r\n const finishEnter = (el, isAppear, done) => {\r\n removeTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);\r\n done && done();\r\n };\r\n const finishLeave = (el, done) => {\r\n removeTransitionClass(el, leaveToClass);\r\n removeTransitionClass(el, leaveActiveClass);\r\n done && done();\r\n };\r\n const makeEnterHook = (isAppear) => {\r\n return (el, done) => {\r\n const hook = isAppear ? onAppear : onEnter;\r\n const resolve = () => finishEnter(el, isAppear, done);\r\n hook && hook(el, resolve);\r\n nextFrame(() => {\r\n removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);\r\n addTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n if (!(hook && hook.length > 1)) {\r\n whenTransitionEnds(el, type, enterDuration, resolve);\r\n }\r\n });\r\n };\r\n };\r\n return extend(baseProps, {\r\n onBeforeEnter(el) {\r\n onBeforeEnter && onBeforeEnter(el);\r\n addTransitionClass(el, enterFromClass);\r\n addTransitionClass(el, enterActiveClass);\r\n },\r\n onBeforeAppear(el) {\r\n onBeforeAppear && onBeforeAppear(el);\r\n addTransitionClass(el, appearFromClass);\r\n addTransitionClass(el, appearActiveClass);\r\n },\r\n onEnter: makeEnterHook(false),\r\n onAppear: makeEnterHook(true),\r\n onLeave(el, done) {\r\n const resolve = () => finishLeave(el, done);\r\n addTransitionClass(el, leaveFromClass);\r\n // force reflow so *-leave-from classes immediately take effect (#2593)\r\n forceReflow();\r\n addTransitionClass(el, leaveActiveClass);\r\n nextFrame(() => {\r\n removeTransitionClass(el, leaveFromClass);\r\n addTransitionClass(el, leaveToClass);\r\n if (!(onLeave && onLeave.length > 1)) {\r\n whenTransitionEnds(el, type, leaveDuration, resolve);\r\n }\r\n });\r\n onLeave && onLeave(el, resolve);\r\n },\r\n onEnterCancelled(el) {\r\n finishEnter(el, false);\r\n onEnterCancelled && onEnterCancelled(el);\r\n },\r\n onAppearCancelled(el) {\r\n finishEnter(el, true);\r\n onAppearCancelled && onAppearCancelled(el);\r\n },\r\n onLeaveCancelled(el) {\r\n finishLeave(el);\r\n onLeaveCancelled && onLeaveCancelled(el);\r\n }\r\n });\r\n}\r\nfunction normalizeDuration(duration) {\r\n if (duration == null) {\r\n return null;\r\n }\r\n else if (isObject(duration)) {\r\n return [NumberOf(duration.enter), NumberOf(duration.leave)];\r\n }\r\n else {\r\n const n = NumberOf(duration);\r\n return [n, n];\r\n }\r\n}\r\nfunction NumberOf(val) {\r\n const res = toNumber(val);\r\n if ((process.env.NODE_ENV !== 'production'))\r\n validateDuration(res);\r\n return res;\r\n}\r\nfunction validateDuration(val) {\r\n if (typeof val !== 'number') {\r\n warn(`<transition> explicit duration is not a valid number - ` +\r\n `got ${JSON.stringify(val)}.`);\r\n }\r\n else if (isNaN(val)) {\r\n warn(`<transition> explicit duration is NaN - ` +\r\n 'the duration expression might be incorrect.');\r\n }\r\n}\r\nfunction addTransitionClass(el, cls) {\r\n cls.split(/\\s+/).forEach(c => c && el.classList.add(c));\r\n (el._vtc ||\r\n (el._vtc = new Set())).add(cls);\r\n}\r\nfunction removeTransitionClass(el, cls) {\r\n cls.split(/\\s+/).forEach(c => c && el.classList.remove(c));\r\n const { _vtc } = el;\r\n if (_vtc) {\r\n _vtc.delete(cls);\r\n if (!_vtc.size) {\r\n el._vtc = undefined;\r\n }\r\n }\r\n}\r\nfunction nextFrame(cb) {\r\n requestAnimationFrame(() => {\r\n requestAnimationFrame(cb);\r\n });\r\n}\r\nlet endId = 0;\r\nfunction whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {\r\n const id = (el._endId = ++endId);\r\n const resolveIfNotStale = () => {\r\n if (id === el._endId) {\r\n resolve();\r\n }\r\n };\r\n if (explicitTimeout) {\r\n return setTimeout(resolveIfNotStale, explicitTimeout);\r\n }\r\n const { type, timeout, propCount } = getTransitionInfo(el, expectedType);\r\n if (!type) {\r\n return resolve();\r\n }\r\n const endEvent = type + 'end';\r\n let ended = 0;\r\n const end = () => {\r\n el.removeEventListener(endEvent, onEnd);\r\n resolveIfNotStale();\r\n };\r\n const onEnd = (e) => {\r\n if (e.target === el && ++ended >= propCount) {\r\n end();\r\n }\r\n };\r\n setTimeout(() => {\r\n if (ended < propCount) {\r\n end();\r\n }\r\n }, timeout + 1);\r\n el.addEventListener(endEvent, onEnd);\r\n}\r\nfunction getTransitionInfo(el, expectedType) {\r\n const styles = window.getComputedStyle(el);\r\n // JSDOM may return undefined for transition properties\r\n const getStyleProperties = (key) => (styles[key] || '').split(', ');\r\n const transitionDelays = getStyleProperties(TRANSITION + 'Delay');\r\n const transitionDurations = getStyleProperties(TRANSITION + 'Duration');\r\n const transitionTimeout = getTimeout(transitionDelays, transitionDurations);\r\n const animationDelays = getStyleProperties(ANIMATION + 'Delay');\r\n const animationDurations = getStyleProperties(ANIMATION + 'Duration');\r\n const animationTimeout = getTimeout(animationDelays, animationDurations);\r\n let type = null;\r\n let timeout = 0;\r\n let propCount = 0;\r\n /* istanbul ignore if */\r\n if (expectedType === TRANSITION) {\r\n if (transitionTimeout > 0) {\r\n type = TRANSITION;\r\n timeout = transitionTimeout;\r\n propCount = transitionDurations.length;\r\n }\r\n }\r\n else if (expectedType === ANIMATION) {\r\n if (animationTimeout > 0) {\r\n type = ANIMATION;\r\n timeout = animationTimeout;\r\n propCount = animationDurations.length;\r\n }\r\n }\r\n else {\r\n timeout = Math.max(transitionTimeout, animationTimeout);\r\n type =\r\n timeout > 0\r\n ? transitionTimeout > animationTimeout\r\n ? TRANSITION\r\n : ANIMATION\r\n : null;\r\n propCount = type\r\n ? type === TRANSITION\r\n ? transitionDurations.length\r\n : animationDurations.length\r\n : 0;\r\n }\r\n const hasTransform = type === TRANSITION &&\r\n /\\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);\r\n return {\r\n type,\r\n timeout,\r\n propCount,\r\n hasTransform\r\n };\r\n}\r\nfunction getTimeout(delays, durations) {\r\n while (delays.length < durations.length) {\r\n delays = delays.concat(delays);\r\n }\r\n return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));\r\n}\r\n// Old versions of Chromium (below 61.0.3163.100) formats floating pointer\r\n// numbers in a locale-dependent way, using a comma instead of a dot.\r\n// If comma is not replaced with a dot, the input will be rounded down\r\n// (i.e. acting as a floor function) causing unexpected behaviors\r\nfunction toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}\r\n// synchronously force layout to put elements into a certain state\r\nfunction forceReflow() {\r\n return document.body.offsetHeight;\r\n}\n\nconst positionMap = new WeakMap();\r\nconst newPositionMap = new WeakMap();\r\nconst TransitionGroupImpl = {\r\n name: 'TransitionGroup',\r\n props: /*#__PURE__*/ extend({}, TransitionPropsValidators, {\r\n tag: String,\r\n moveClass: String\r\n }),\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevChildren;\r\n let children;\r\n onUpdated(() => {\r\n // children is guaranteed to exist after initial render\r\n if (!prevChildren.length) {\r\n return;\r\n }\r\n const moveClass = props.moveClass || `${props.name || 'v'}-move`;\r\n if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {\r\n return;\r\n }\r\n // we divide the work into three loops to avoid mixing DOM reads and writes\r\n // in each iteration - which helps prevent layout thrashing.\r\n prevChildren.forEach(callPendingCbs);\r\n prevChildren.forEach(recordPosition);\r\n const movedChildren = prevChildren.filter(applyTranslation);\r\n // force reflow to put everything in position\r\n forceReflow();\r\n movedChildren.forEach(c => {\r\n const el = c.el;\r\n const style = el.style;\r\n addTransitionClass(el, moveClass);\r\n style.transform = style.webkitTransform = style.transitionDuration = '';\r\n const cb = (el._moveCb = (e) => {\r\n if (e && e.target !== el) {\r\n return;\r\n }\r\n if (!e || /transform$/.test(e.propertyName)) {\r\n el.removeEventListener('transitionend', cb);\r\n el._moveCb = null;\r\n removeTransitionClass(el, moveClass);\r\n }\r\n });\r\n el.addEventListener('transitionend', cb);\r\n });\r\n });\r\n return () => {\r\n const rawProps = toRaw(props);\r\n const cssTransitionProps = resolveTransitionProps(rawProps);\r\n const tag = rawProps.tag || Fragment;\r\n prevChildren = children;\r\n children = slots.default ? getTransitionRawChildren(slots.default()) : [];\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (child.key != null) {\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`<TransitionGroup> children must be keyed.`);\r\n }\r\n }\r\n if (prevChildren) {\r\n for (let i = 0; i < prevChildren.length; i++) {\r\n const child = prevChildren[i];\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n positionMap.set(child, child.el.getBoundingClientRect());\r\n }\r\n }\r\n return createVNode(tag, null, children);\r\n };\r\n }\r\n};\r\nconst TransitionGroup = TransitionGroupImpl;\r\nfunction callPendingCbs(c) {\r\n const el = c.el;\r\n if (el._moveCb) {\r\n el._moveCb();\r\n }\r\n if (el._enterCb) {\r\n el._enterCb();\r\n }\r\n}\r\nfunction recordPosition(c) {\r\n newPositionMap.set(c, c.el.getBoundingClientRect());\r\n}\r\nfunction applyTranslation(c) {\r\n const oldPos = positionMap.get(c);\r\n const newPos = newPositionMap.get(c);\r\n const dx = oldPos.left - newPos.left;\r\n const dy = oldPos.top - newPos.top;\r\n if (dx || dy) {\r\n const s = c.el.style;\r\n s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;\r\n s.transitionDuration = '0s';\r\n return c;\r\n }\r\n}\r\nfunction hasCSSTransform(el, root, moveClass) {\r\n // Detect whether an element with the move class applied has\r\n // CSS transitions. Since the element may be inside an entering\r\n // transition at this very moment, we make a clone of it and remove\r\n // all other transition classes applied to ensure only the move class\r\n // is applied.\r\n const clone = el.cloneNode();\r\n if (el._vtc) {\r\n el._vtc.forEach(cls => {\r\n cls.split(/\\s+/).forEach(c => c && clone.classList.remove(c));\r\n });\r\n }\r\n moveClass.split(/\\s+/).forEach(c => c && clone.classList.add(c));\r\n clone.style.display = 'none';\r\n const container = (root.nodeType === 1\r\n ? root\r\n : root.parentNode);\r\n container.appendChild(clone);\r\n const { hasTransform } = getTransitionInfo(clone);\r\n container.removeChild(clone);\r\n return hasTransform;\r\n}\n\nconst getModelAssigner = (vnode) => {\r\n const fn = vnode.props['onUpdate:modelValue'];\r\n return isArray(fn) ? value => invokeArrayFns(fn, value) : fn;\r\n};\r\nfunction onCompositionStart(e) {\r\n e.target.composing = true;\r\n}\r\nfunction onCompositionEnd(e) {\r\n const target = e.target;\r\n if (target.composing) {\r\n target.composing = false;\r\n trigger(target, 'input');\r\n }\r\n}\r\nfunction trigger(el, type) {\r\n const e = document.createEvent('HTMLEvents');\r\n e.initEvent(type, true, true);\r\n el.dispatchEvent(e);\r\n}\r\n// We are exporting the v-model runtime directly as vnode hooks so that it can\r\n// be tree-shaken in case v-model is never used.\r\nconst vModelText = {\r\n created(el, { modifiers: { lazy, trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n const castToNumber = number || el.type === 'number';\r\n addEventListener(el, lazy ? 'change' : 'input', e => {\r\n if (e.target.composing)\r\n return;\r\n let domValue = el.value;\r\n if (trim) {\r\n domValue = domValue.trim();\r\n }\r\n else if (castToNumber) {\r\n domValue = toNumber(domValue);\r\n }\r\n el._assign(domValue);\r\n });\r\n if (trim) {\r\n addEventListener(el, 'change', () => {\r\n el.value = el.value.trim();\r\n });\r\n }\r\n if (!lazy) {\r\n addEventListener(el, 'compositionstart', onCompositionStart);\r\n addEventListener(el, 'compositionend', onCompositionEnd);\r\n // Safari < 10.2 & UIWebView doesn't fire compositionend when\r\n // switching focus before confirming composition choice\r\n // this also fixes the issue where some browsers e.g. iOS Chrome\r\n // fires \"change\" instead of \"input\" on autocomplete.\r\n addEventListener(el, 'change', onCompositionEnd);\r\n }\r\n },\r\n // set value on mounted so it's after min/max for type=\"range\"\r\n mounted(el, { value }) {\r\n el.value = value == null ? '' : value;\r\n },\r\n beforeUpdate(el, { value, modifiers: { trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n // avoid clearing unresolved text. #2302\r\n if (el.composing)\r\n return;\r\n if (document.activeElement === el) {\r\n if (trim && el.value.trim() === value) {\r\n return;\r\n }\r\n if ((number || el.type === 'number') && toNumber(el.value) === value) {\r\n return;\r\n }\r\n }\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue) {\r\n el.value = newValue;\r\n }\r\n }\r\n};\r\nconst vModelCheckbox = {\r\n created(el, _, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () => {\r\n const modelValue = el._modelValue;\r\n const elementValue = getValue(el);\r\n const checked = el.checked;\r\n const assign = el._assign;\r\n if (isArray(modelValue)) {\r\n const index = looseIndexOf(modelValue, elementValue);\r\n const found = index !== -1;\r\n if (checked && !found) {\r\n assign(modelValue.concat(elementValue));\r\n }\r\n else if (!checked && found) {\r\n const filtered = [...modelValue];\r\n filtered.splice(index, 1);\r\n assign(filtered);\r\n }\r\n }\r\n else if (isSet(modelValue)) {\r\n const cloned = new Set(modelValue);\r\n if (checked) {\r\n cloned.add(elementValue);\r\n }\r\n else {\r\n cloned.delete(elementValue);\r\n }\r\n assign(cloned);\r\n }\r\n else {\r\n assign(getCheckboxValue(el, checked));\r\n }\r\n });\r\n },\r\n // set initial checked on mount to wait for true-value/false-value\r\n mounted: setChecked,\r\n beforeUpdate(el, binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n setChecked(el, binding, vnode);\r\n }\r\n};\r\nfunction setChecked(el, { value, oldValue }, vnode) {\r\n el._modelValue = value;\r\n if (isArray(value)) {\r\n el.checked = looseIndexOf(value, vnode.props.value) > -1;\r\n }\r\n else if (isSet(value)) {\r\n el.checked = value.has(vnode.props.value);\r\n }\r\n else if (value !== oldValue) {\r\n el.checked = looseEqual(value, getCheckboxValue(el, true));\r\n }\r\n}\r\nconst vModelRadio = {\r\n created(el, { value }, vnode) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () => {\r\n el._assign(getValue(el));\r\n });\r\n },\r\n beforeUpdate(el, { value, oldValue }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n if (value !== oldValue) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n }\r\n }\r\n};\r\nconst vModelSelect = {\r\n created(el, { value, modifiers: { number } }, vnode) {\r\n const isSetModel = isSet(value);\r\n addEventListener(el, 'change', () => {\r\n const selectedVal = Array.prototype.filter\r\n .call(el.options, (o) => o.selected)\r\n .map((o) => number ? toNumber(getValue(o)) : getValue(o));\r\n el._assign(el.multiple\r\n ? isSetModel\r\n ? new Set(selectedVal)\r\n : selectedVal\r\n : selectedVal[0]);\r\n });\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n // set value in mounted & updated because <select> relies on its children\r\n // <option>s.\r\n mounted(el, { value }) {\r\n setSelected(el, value);\r\n },\r\n beforeUpdate(el, _binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n updated(el, { value }) {\r\n setSelected(el, value);\r\n }\r\n};\r\nfunction setSelected(el, value) {\r\n const isMultiple = el.multiple;\r\n if (isMultiple && !isArray(value) && !isSet(value)) {\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +\r\n `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);\r\n return;\r\n }\r\n for (let i = 0, l = el.options.length; i < l; i++) {\r\n const option = el.options[i];\r\n const optionValue = getValue(option);\r\n if (isMultiple) {\r\n if (isArray(value)) {\r\n option.selected = looseIndexOf(value, optionValue) > -1;\r\n }\r\n else {\r\n option.selected = value.has(optionValue);\r\n }\r\n }\r\n else {\r\n if (looseEqual(getValue(option), value)) {\r\n el.selectedIndex = i;\r\n return;\r\n }\r\n }\r\n }\r\n if (!isMultiple) {\r\n el.selectedIndex = -1;\r\n }\r\n}\r\n// retrieve raw value set via :value bindings\r\nfunction getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}\r\n// retrieve raw value for true-value and false-value set via :true-value or :false-value bindings\r\nfunction getCheckboxValue(el, checked) {\r\n const key = checked ? '_trueValue' : '_falseValue';\r\n return key in el ? el[key] : checked;\r\n}\r\nconst vModelDynamic = {\r\n created(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'created');\r\n },\r\n mounted(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'mounted');\r\n },\r\n beforeUpdate(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'beforeUpdate');\r\n },\r\n updated(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'updated');\r\n }\r\n};\r\nfunction callModelHook(el, binding, vnode, prevVNode, hook) {\r\n let modelToUse;\r\n switch (el.tagName) {\r\n case 'SELECT':\r\n modelToUse = vModelSelect;\r\n break;\r\n case 'TEXTAREA':\r\n modelToUse = vModelText;\r\n break;\r\n default:\r\n switch (vnode.props && vnode.props.type) {\r\n case 'checkbox':\r\n modelToUse = vModelCheckbox;\r\n break;\r\n case 'radio':\r\n modelToUse = vModelRadio;\r\n break;\r\n default:\r\n modelToUse = vModelText;\r\n }\r\n }\r\n const fn = modelToUse[hook];\r\n fn && fn(el, binding, vnode, prevVNode);\r\n}\n\nconst systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];\r\nconst modifierGuards = {\r\n stop: e => e.stopPropagation(),\r\n prevent: e => e.preventDefault(),\r\n self: e => e.target !== e.currentTarget,\r\n ctrl: e => !e.ctrlKey,\r\n shift: e => !e.shiftKey,\r\n alt: e => !e.altKey,\r\n meta: e => !e.metaKey,\r\n left: e => 'button' in e && e.button !== 0,\r\n middle: e => 'button' in e && e.button !== 1,\r\n right: e => 'button' in e && e.button !== 2,\r\n exact: (e, modifiers) => systemModifiers.some(m => e[`${m}Key`] && !modifiers.includes(m))\r\n};\r\n/**\r\n * @private\r\n */\r\nconst withModifiers = (fn, modifiers) => {\r\n return (event, ...args) => {\r\n for (let i = 0; i < modifiers.length; i++) {\r\n const guard = modifierGuards[modifiers[i]];\r\n if (guard && guard(event, modifiers))\r\n return;\r\n }\r\n return fn(event, ...args);\r\n };\r\n};\r\n// Kept for 2.x compat.\r\n// Note: IE11 compat for `spacebar` and `del` is removed for now.\r\nconst keyNames = {\r\n esc: 'escape',\r\n space: ' ',\r\n up: 'arrow-up',\r\n left: 'arrow-left',\r\n right: 'arrow-right',\r\n down: 'arrow-down',\r\n delete: 'backspace'\r\n};\r\n/**\r\n * @private\r\n */\r\nconst withKeys = (fn, modifiers) => {\r\n return (event) => {\r\n if (!('key' in event))\r\n return;\r\n const eventKey = hyphenate(event.key);\r\n if (\r\n // None of the provided key modifiers match the current event key\r\n !modifiers.some(k => k === eventKey || keyNames[k] === eventKey)) {\r\n return;\r\n }\r\n return fn(event);\r\n };\r\n};\n\nconst vShow = {\r\n beforeMount(el, { value }, { transition }) {\r\n el._vod = el.style.display === 'none' ? '' : el.style.display;\r\n if (transition && value) {\r\n transition.beforeEnter(el);\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n mounted(el, { value }, { transition }) {\r\n if (transition && value) {\r\n transition.enter(el);\r\n }\r\n },\r\n updated(el, { value, oldValue }, { transition }) {\r\n if (!value === !oldValue)\r\n return;\r\n if (transition) {\r\n if (value) {\r\n transition.beforeEnter(el);\r\n setDisplay(el, true);\r\n transition.enter(el);\r\n }\r\n else {\r\n transition.leave(el, () => {\r\n setDisplay(el, false);\r\n });\r\n }\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n beforeUnmount(el, { value }) {\r\n setDisplay(el, value);\r\n }\r\n};\r\nfunction setDisplay(el, value) {\r\n el.style.display = value ? el._vod : 'none';\r\n}\n\nconst rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);\r\n// lazy create the renderer - this makes core renderer logic tree-shakable\r\n// in case the user only imports reactivity utilities from Vue.\r\nlet renderer;\r\nlet enabledHydration = false;\r\nfunction ensureRenderer() {\r\n return renderer || (renderer = createRenderer(rendererOptions));\r\n}\r\nfunction ensureHydrationRenderer() {\r\n renderer = enabledHydration\r\n ? renderer\r\n : createHydrationRenderer(rendererOptions);\r\n enabledHydration = true;\r\n return renderer;\r\n}\r\n// use explicit type casts here to avoid import() calls in rolled-up d.ts\r\nconst render = ((...args) => {\r\n ensureRenderer().render(...args);\r\n});\r\nconst hydrate = ((...args) => {\r\n ensureHydrationRenderer().hydrate(...args);\r\n});\r\nconst createApp = ((...args) => {\r\n const app = ensureRenderer().createApp(...args);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n injectNativeTagCheck(app);\r\n injectCustomElementCheck(app);\r\n }\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) => {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (!container)\r\n return;\r\n const component = app._component;\r\n if (!isFunction(component) && !component.render && !component.template) {\r\n component.template = container.innerHTML;\r\n }\r\n // clear content before mounting\r\n container.innerHTML = '';\r\n const proxy = mount(container, false, container instanceof SVGElement);\r\n if (container instanceof Element) {\r\n container.removeAttribute('v-cloak');\r\n container.setAttribute('data-v-app', '');\r\n }\r\n return proxy;\r\n };\r\n return app;\r\n});\r\nconst createSSRApp = ((...args) => {\r\n const app = ensureHydrationRenderer().createApp(...args);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n injectNativeTagCheck(app);\r\n injectCustomElementCheck(app);\r\n }\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) => {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (container) {\r\n return mount(container, true, container instanceof SVGElement);\r\n }\r\n };\r\n return app;\r\n});\r\nfunction injectNativeTagCheck(app) {\r\n // Inject `isNativeTag`\r\n // this is used for component name validation (dev only)\r\n Object.defineProperty(app.config, 'isNativeTag', {\r\n value: (tag) => isHTMLTag(tag) || isSVGTag(tag),\r\n writable: false\r\n });\r\n}\r\n// dev only\r\nfunction injectCustomElementCheck(app) {\r\n if (isRuntimeOnly()) {\r\n const value = app.config.isCustomElement;\r\n Object.defineProperty(app.config, 'isCustomElement', {\r\n get() {\r\n return value;\r\n },\r\n set() {\r\n warn(`The \\`isCustomElement\\` config option is only respected when using the runtime compiler.` +\r\n `If you are using the runtime-only build, \\`isCustomElement\\` must be passed to \\`@vue/compiler-dom\\` in the build setup instead` +\r\n `- for example, via the \\`compilerOptions\\` option in vue-loader: https://vue-loader.vuejs.org/options.html#compileroptions.`);\r\n }\r\n });\r\n }\r\n}\r\nfunction normalizeContainer(container) {\r\n if (isString(container)) {\r\n const res = document.querySelector(container);\r\n if ((process.env.NODE_ENV !== 'production') && !res) {\r\n warn(`Failed to mount app: mount target selector \"${container}\" returned null.`);\r\n }\r\n return res;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n container instanceof window.ShadowRoot &&\r\n container.mode === 'closed') {\r\n warn(`mounting on a ShadowRoot with \\`{mode: \"closed\"}\\` may lead to unpredictable bugs`);\r\n }\r\n return container;\r\n}\n\nexport { Transition, TransitionGroup, createApp, createSSRApp, hydrate, render, useCssModule, useCssVars, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","/**\r\n * Make a map and return a function for checking if a key\r\n * is in that map.\r\n * IMPORTANT: all calls of this function must be prefixed with\r\n * \\/\\*#\\_\\_PURE\\_\\_\\*\\/\r\n * So that rollup can tree-shake them if necessary.\r\n */\r\nfunction makeMap(str, expectsLowerCase) {\r\n const map = Object.create(null);\r\n const list = str.split(',');\r\n for (let i = 0; i < list.length; i++) {\r\n map[list[i]] = true;\r\n }\r\n return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\r\n}\n\n/**\r\n * dev only flag -> name mapping\r\n */\r\nconst PatchFlagNames = {\r\n [1 /* TEXT */]: `TEXT`,\r\n [2 /* CLASS */]: `CLASS`,\r\n [4 /* STYLE */]: `STYLE`,\r\n [8 /* PROPS */]: `PROPS`,\r\n [16 /* FULL_PROPS */]: `FULL_PROPS`,\r\n [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,\r\n [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,\r\n [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,\r\n [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,\r\n [512 /* NEED_PATCH */]: `NEED_PATCH`,\r\n [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,\r\n [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,\r\n [-1 /* HOISTED */]: `HOISTED`,\r\n [-2 /* BAIL */]: `BAIL`\r\n};\n\n/**\r\n * Dev only\r\n */\r\nconst slotFlagsText = {\r\n [1 /* STABLE */]: 'STABLE',\r\n [2 /* DYNAMIC */]: 'DYNAMIC',\r\n [3 /* FORWARDED */]: 'FORWARDED'\r\n};\n\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\r\n 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\r\n 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\r\nconst isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n\nconst range = 2;\r\nfunction generateCodeFrame(source, start = 0, end = source.length) {\r\n const lines = source.split(/\\r?\\n/);\r\n let count = 0;\r\n const res = [];\r\n for (let i = 0; i < lines.length; i++) {\r\n count += lines[i].length + 1;\r\n if (count >= start) {\r\n for (let j = i - range; j <= i + range || end > count; j++) {\r\n if (j < 0 || j >= lines.length)\r\n continue;\r\n const line = j + 1;\r\n res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\r\n const lineLength = lines[j].length;\r\n if (j === i) {\r\n // push underline\r\n const pad = start - (count - lineLength) + 1;\r\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\r\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\r\n }\r\n else if (j > i) {\r\n if (end > count) {\r\n const length = Math.max(Math.min(end - count, lineLength), 1);\r\n res.push(` | ` + '^'.repeat(length));\r\n }\r\n count += lineLength + 1;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return res.join('\\n');\r\n}\n\n/**\r\n * On the client we only need to offer special cases for boolean attributes that\r\n * have different names from their corresponding dom properties:\r\n * - itemscope -> N/A\r\n * - allowfullscreen -> allowFullscreen\r\n * - formnovalidate -> formNoValidate\r\n * - ismap -> isMap\r\n * - nomodule -> noModule\r\n * - novalidate -> noValidate\r\n * - readonly -> readOnly\r\n */\r\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\r\nconst isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\r\n/**\r\n * The full list is needed during SSR to produce the correct initial markup.\r\n */\r\nconst isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +\r\n `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +\r\n `loop,open,required,reversed,scoped,seamless,` +\r\n `checked,muted,multiple,selected`);\r\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\r\nconst attrValidationCache = {};\r\nfunction isSSRSafeAttrName(name) {\r\n if (attrValidationCache.hasOwnProperty(name)) {\r\n return attrValidationCache[name];\r\n }\r\n const isUnsafe = unsafeAttrCharRE.test(name);\r\n if (isUnsafe) {\r\n console.error(`unsafe attribute name: ${name}`);\r\n }\r\n return (attrValidationCache[name] = !isUnsafe);\r\n}\r\nconst propsToAttrMap = {\r\n acceptCharset: 'accept-charset',\r\n className: 'class',\r\n htmlFor: 'for',\r\n httpEquiv: 'http-equiv'\r\n};\r\n/**\r\n * CSS properties that accept plain numbers\r\n */\r\nconst isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +\r\n `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +\r\n `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +\r\n `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +\r\n `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +\r\n `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +\r\n // SVG\r\n `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +\r\n `stroke-miterlimit,stroke-opacity,stroke-width`);\r\n/**\r\n * Known attributes, this is used for stringification of runtime static nodes\r\n * so that we don't stringify bindings that cannot be set from HTML.\r\n * Don't also forget to allow `data-*` and `aria-*`!\r\n * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\r\n */\r\nconst isKnownAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +\r\n `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +\r\n `border,buffered,capture,challenge,charset,checked,cite,class,code,` +\r\n `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +\r\n `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +\r\n `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +\r\n `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +\r\n `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +\r\n `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +\r\n `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +\r\n `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +\r\n `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +\r\n `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +\r\n `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +\r\n `value,width,wrap`);\n\nfunction normalizeStyle(value) {\r\n if (isArray(value)) {\r\n const res = {};\r\n for (let i = 0; i < value.length; i++) {\r\n const item = value[i];\r\n const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\r\n if (normalized) {\r\n for (const key in normalized) {\r\n res[key] = normalized[key];\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n else if (isObject(value)) {\r\n return value;\r\n }\r\n}\r\nconst listDelimiterRE = /;(?![^(]*\\))/g;\r\nconst propertyDelimiterRE = /:(.+)/;\r\nfunction parseStringStyle(cssText) {\r\n const ret = {};\r\n cssText.split(listDelimiterRE).forEach(item => {\r\n if (item) {\r\n const tmp = item.split(propertyDelimiterRE);\r\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\r\n }\r\n });\r\n return ret;\r\n}\r\nfunction stringifyStyle(styles) {\r\n let ret = '';\r\n if (!styles) {\r\n return ret;\r\n }\r\n for (const key in styles) {\r\n const value = styles[key];\r\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\r\n if (isString(value) ||\r\n (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {\r\n // only render valid values\r\n ret += `${normalizedKey}:${value};`;\r\n }\r\n }\r\n return ret;\r\n}\r\nfunction normalizeClass(value) {\r\n let res = '';\r\n if (isString(value)) {\r\n res = value;\r\n }\r\n else if (isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n const normalized = normalizeClass(value[i]);\r\n if (normalized) {\r\n res += normalized + ' ';\r\n }\r\n }\r\n }\r\n else if (isObject(value)) {\r\n for (const name in value) {\r\n if (value[name]) {\r\n res += name + ' ';\r\n }\r\n }\r\n }\r\n return res.trim();\r\n}\n\n// These tag configs are shared between compiler-dom and runtime-dom, so they\r\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\r\nconst HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\r\n 'header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,' +\r\n 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\r\n 'data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,' +\r\n 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\r\n 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\r\n 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\r\n 'option,output,progress,select,textarea,details,dialog,menu,' +\r\n 'summary,template,blockquote,iframe,tfoot';\r\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\r\nconst SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\r\n 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\r\n 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\r\n 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\r\n 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\r\n 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\r\n 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\r\n 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\r\n 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\r\n 'text,textPath,title,tspan,unknown,use,view';\r\nconst VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\r\nconst isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);\r\nconst isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);\r\nconst isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);\n\nconst escapeRE = /[\"'&<>]/;\r\nfunction escapeHtml(string) {\r\n const str = '' + string;\r\n const match = escapeRE.exec(str);\r\n if (!match) {\r\n return str;\r\n }\r\n let html = '';\r\n let escaped;\r\n let index;\r\n let lastIndex = 0;\r\n for (index = match.index; index < str.length; index++) {\r\n switch (str.charCodeAt(index)) {\r\n case 34: // \"\r\n escaped = '"';\r\n break;\r\n case 38: // &\r\n escaped = '&';\r\n break;\r\n case 39: // '\r\n escaped = ''';\r\n break;\r\n case 60: // <\r\n escaped = '<';\r\n break;\r\n case 62: // >\r\n escaped = '>';\r\n break;\r\n default:\r\n continue;\r\n }\r\n if (lastIndex !== index) {\r\n html += str.substring(lastIndex, index);\r\n }\r\n lastIndex = index + 1;\r\n html += escaped;\r\n }\r\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\r\n}\r\n// https://www.w3.org/TR/html52/syntax.html#comments\r\nconst commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;\r\nfunction escapeHtmlComment(src) {\r\n return src.replace(commentStripRE, '');\r\n}\n\nfunction looseCompareArrays(a, b) {\r\n if (a.length !== b.length)\r\n return false;\r\n let equal = true;\r\n for (let i = 0; equal && i < a.length; i++) {\r\n equal = looseEqual(a[i], b[i]);\r\n }\r\n return equal;\r\n}\r\nfunction looseEqual(a, b) {\r\n if (a === b)\r\n return true;\r\n let aValidType = isDate(a);\r\n let bValidType = isDate(b);\r\n if (aValidType || bValidType) {\r\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\r\n }\r\n aValidType = isArray(a);\r\n bValidType = isArray(b);\r\n if (aValidType || bValidType) {\r\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\r\n }\r\n aValidType = isObject(a);\r\n bValidType = isObject(b);\r\n if (aValidType || bValidType) {\r\n /* istanbul ignore if: this if will probably never be called */\r\n if (!aValidType || !bValidType) {\r\n return false;\r\n }\r\n const aKeysCount = Object.keys(a).length;\r\n const bKeysCount = Object.keys(b).length;\r\n if (aKeysCount !== bKeysCount) {\r\n return false;\r\n }\r\n for (const key in a) {\r\n const aHasKey = a.hasOwnProperty(key);\r\n const bHasKey = b.hasOwnProperty(key);\r\n if ((aHasKey && !bHasKey) ||\r\n (!aHasKey && bHasKey) ||\r\n !looseEqual(a[key], b[key])) {\r\n return false;\r\n }\r\n }\r\n }\r\n return String(a) === String(b);\r\n}\r\nfunction looseIndexOf(arr, val) {\r\n return arr.findIndex(item => looseEqual(item, val));\r\n}\n\n/**\r\n * For converting {{ interpolation }} values to displayed strings.\r\n * @private\r\n */\r\nconst toDisplayString = (val) => {\r\n return val == null\r\n ? ''\r\n : isObject(val)\r\n ? JSON.stringify(val, replacer, 2)\r\n : String(val);\r\n};\r\nconst replacer = (_key, val) => {\r\n if (isMap(val)) {\r\n return {\r\n [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {\r\n entries[`${key} =>`] = val;\r\n return entries;\r\n }, {})\r\n };\r\n }\r\n else if (isSet(val)) {\r\n return {\r\n [`Set(${val.size})`]: [...val.values()]\r\n };\r\n }\r\n else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\r\n return String(val);\r\n }\r\n return val;\r\n};\n\n/**\r\n * List of @babel/parser plugins that are used for template expression\r\n * transforms and SFC script transforms. By default we enable proposals slated\r\n * for ES2020. This will need to be updated as the spec moves forward.\r\n * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins\r\n */\r\nconst babelParserDefaultPlugins = [\r\n 'bigInt',\r\n 'optionalChaining',\r\n 'nullishCoalescingOperator'\r\n];\r\nconst EMPTY_OBJ = (process.env.NODE_ENV !== 'production')\r\n ? Object.freeze({})\r\n : {};\r\nconst EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];\r\nconst NOOP = () => { };\r\n/**\r\n * Always return false.\r\n */\r\nconst NO = () => false;\r\nconst onRE = /^on[^a-z]/;\r\nconst isOn = (key) => onRE.test(key);\r\nconst isModelListener = (key) => key.startsWith('onUpdate:');\r\nconst extend = Object.assign;\r\nconst remove = (arr, el) => {\r\n const i = arr.indexOf(el);\r\n if (i > -1) {\r\n arr.splice(i, 1);\r\n }\r\n};\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\r\nconst isArray = Array.isArray;\r\nconst isMap = (val) => toTypeString(val) === '[object Map]';\r\nconst isSet = (val) => toTypeString(val) === '[object Set]';\r\nconst isDate = (val) => val instanceof Date;\r\nconst isFunction = (val) => typeof val === 'function';\r\nconst isString = (val) => typeof val === 'string';\r\nconst isSymbol = (val) => typeof val === 'symbol';\r\nconst isObject = (val) => val !== null && typeof val === 'object';\r\nconst isPromise = (val) => {\r\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\r\n};\r\nconst objectToString = Object.prototype.toString;\r\nconst toTypeString = (value) => objectToString.call(value);\r\nconst toRawType = (value) => {\r\n // extract \"RawType\" from strings like \"[object RawType]\"\r\n return toTypeString(value).slice(8, -1);\r\n};\r\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\r\nconst isIntegerKey = (key) => isString(key) &&\r\n key !== 'NaN' &&\r\n key[0] !== '-' &&\r\n '' + parseInt(key, 10) === key;\r\nconst isReservedProp = /*#__PURE__*/ makeMap(\r\n// the leading comma is intentional so empty string \"\" is also included\r\n',key,ref,' +\r\n 'onVnodeBeforeMount,onVnodeMounted,' +\r\n 'onVnodeBeforeUpdate,onVnodeUpdated,' +\r\n 'onVnodeBeforeUnmount,onVnodeUnmounted');\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null);\r\n return ((str) => {\r\n const hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n });\r\n};\r\nconst camelizeRE = /-(\\w)/g;\r\n/**\r\n * @private\r\n */\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\r\n});\r\nconst hyphenateRE = /\\B([A-Z])/g;\r\n/**\r\n * @private\r\n */\r\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\r\n/**\r\n * @private\r\n */\r\nconst capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\r\n/**\r\n * @private\r\n */\r\nconst toHandlerKey = cacheStringFunction((str) => (str ? `on${capitalize(str)}` : ``));\r\n// compare whether a value has changed, accounting for NaN.\r\nconst hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\r\nconst invokeArrayFns = (fns, arg) => {\r\n for (let i = 0; i < fns.length; i++) {\r\n fns[i](arg);\r\n }\r\n};\r\nconst def = (obj, key, value) => {\r\n Object.defineProperty(obj, key, {\r\n configurable: true,\r\n enumerable: false,\r\n value\r\n });\r\n};\r\nconst toNumber = (val) => {\r\n const n = parseFloat(val);\r\n return isNaN(n) ? val : n;\r\n};\r\nlet _globalThis;\r\nconst getGlobalThis = () => {\r\n return (_globalThis ||\r\n (_globalThis =\r\n typeof globalThis !== 'undefined'\r\n ? globalThis\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : typeof global !== 'undefined'\r\n ? global\r\n : {}));\r\n};\n\nexport { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, babelParserDefaultPlugins, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, invokeArrayFns, isArray, isBooleanAttr, isDate, isFunction, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownAttr, isMap, isModelListener, isNoUnitNumericStyleProp, isObject, isOn, isPlainObject, isPromise, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, makeMap, normalizeClass, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n"],"sourceRoot":""}
|