@vtx/ol-map 1.0.144 → 1.0.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +205 -205
- package/lib/_util/EventEmitter.js +80 -0
- package/lib/_util/EventEmitter.js.map +1 -0
- package/lib/_util/StyleCache.js +48 -0
- package/lib/_util/StyleCache.js.map +1 -0
- package/lib/_util/encryptParams.js +65 -0
- package/lib/_util/encryptParams.js.map +1 -0
- package/lib/_util/filterSpecialCharacters.js +90 -0
- package/lib/_util/filterSpecialCharacters.js.map +1 -0
- package/lib/_util/getComponentProps.js +14 -0
- package/lib/_util/getComponentProps.js.map +1 -0
- package/lib/_util/getCookie.js +25 -0
- package/lib/_util/getCookie.js.map +1 -0
- package/lib/_util/getDefaultMapInfo.js +51 -0
- package/lib/_util/getDefaultMapInfo.js.map +1 -0
- package/lib/_util/getSystemInfo.js +27 -0
- package/lib/_util/getSystemInfo.js.map +1 -0
- package/lib/_util/getToken.js +29 -0
- package/lib/_util/getToken.js.map +1 -0
- package/lib/_util/getUrlParam.js +16 -0
- package/lib/_util/getUrlParam.js.map +1 -0
- package/lib/_util/http.js +178 -0
- package/lib/_util/http.js.map +1 -0
- package/lib/_util/isFunction.js +10 -0
- package/lib/_util/isFunction.js.map +1 -0
- package/lib/_util/isObject.js +10 -0
- package/lib/_util/isObject.js.map +1 -0
- package/lib/_util/layer.js +156 -0
- package/lib/_util/layer.js.map +1 -0
- package/lib/_util/mapTool.js +189 -0
- package/lib/_util/mapTool.js.map +1 -0
- package/lib/_util/projzh/datum/bd-09.js +45 -0
- package/lib/_util/projzh/datum/bd-09.js.map +1 -0
- package/lib/_util/projzh/datum/gcj-02.js +73 -0
- package/lib/_util/projzh/datum/gcj-02.js.map +1 -0
- package/lib/_util/projzh/datum/index.js +15 -0
- package/lib/_util/projzh/datum/index.js.map +1 -0
- package/lib/_util/projzh/index.js +41 -0
- package/lib/_util/projzh/index.js.map +1 -0
- package/lib/_util/projzh/projection/baidu-mercator.js +75 -0
- package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -0
- package/lib/_util/projzh/projection/index.js +15 -0
- package/lib/_util/projzh/projection/index.js.map +1 -0
- package/lib/_util/projzh/projection/spherical-mercator.js +26 -0
- package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -0
- package/lib/_util/projzh/util.js +28 -0
- package/lib/_util/projzh/util.js.map +1 -0
- package/lib/_util/search.js +133 -0
- package/lib/_util/search.js.map +1 -0
- package/lib/_util/setCookie.js +16 -0
- package/lib/_util/setCookie.js.map +1 -0
- package/lib/_util/stringToFun.js +25 -0
- package/lib/_util/stringToFun.js.map +1 -0
- package/lib/_util/transform.js +170 -0
- package/lib/_util/transform.js.map +1 -0
- package/lib/_util/useColSize.js +29 -0
- package/lib/_util/useColSize.js.map +1 -0
- package/lib/_util/useInterval.js +19 -0
- package/lib/_util/useInterval.js.map +1 -0
- package/lib/_util/useSet.js +45 -0
- package/lib/_util/useSet.js.map +1 -0
- package/lib/analysis-layer/index.js +455 -0
- package/lib/analysis-layer/index.js.map +1 -0
- package/lib/analysis-layer/style/css.js +2 -0
- package/lib/analysis-layer/style/css.js.map +1 -0
- package/lib/analysis-layer/style/index.js +2 -0
- package/lib/analysis-layer/style/index.js.map +1 -0
- package/lib/assets/arrow.png +0 -0
- package/lib/assets/base-img-1.png +0 -0
- package/lib/assets/base-img-2.png +0 -0
- package/lib/assets/base-img-3.png +0 -0
- package/lib/assets/base-img-4.png +0 -0
- package/lib/assets/base-img-5.png +0 -0
- package/lib/assets/base-img-6.png +0 -0
- package/lib/assets/base-img.png +0 -0
- package/lib/assets/bz.png +0 -0
- package/lib/assets/img.png +0 -0
- package/lib/assets/kz.png +0 -0
- package/lib/assets/ll.png +0 -0
- package/lib/assets/location.png +0 -0
- package/lib/assets/noLocation.png +0 -0
- package/lib/assets/people.png +0 -0
- package/lib/assets/qd.png +0 -0
- package/lib/assets/sw.png +0 -0
- package/lib/assets/yl.png +0 -0
- package/lib/assets/zd.png +0 -0
- package/lib/buffer-draw/BufferDraw.js +400 -0
- package/lib/buffer-draw/BufferDraw.js.map +1 -0
- package/lib/buffer-draw/index.js +57 -0
- package/lib/buffer-draw/index.js.map +1 -0
- package/lib/buffer-draw/style/css.js +2 -0
- package/lib/buffer-draw/style/css.js.map +1 -0
- package/lib/buffer-draw/style/index.js +2 -0
- package/lib/buffer-draw/style/index.js.map +1 -0
- package/lib/circle/Circle.js +53 -0
- package/lib/circle/Circle.js.map +1 -0
- package/lib/circle/index.js +65 -0
- package/lib/circle/index.js.map +1 -0
- package/lib/circle/style/css.js +2 -0
- package/lib/circle/style/css.js.map +1 -0
- package/lib/circle/style/index.js +2 -0
- package/lib/circle/style/index.js.map +1 -0
- package/lib/config.js +13 -0
- package/lib/config.js.map +1 -0
- package/lib/convertCamelToCSS.js +24 -0
- package/lib/convertCamelToCSS.js.map +1 -0
- package/lib/dom/Dom.js +41 -0
- package/lib/dom/Dom.js.map +1 -0
- package/lib/dom/index.js +62 -0
- package/lib/dom/index.js.map +1 -0
- package/lib/dom/style/css.js +2 -0
- package/lib/dom/style/css.js.map +1 -0
- package/lib/dom/style/index.js +2 -0
- package/lib/dom/style/index.js.map +1 -0
- package/lib/events/index.js +27 -0
- package/lib/events/index.js.map +1 -0
- package/lib/feature-draw/FeatureDraw.js +236 -0
- package/lib/feature-draw/FeatureDraw.js.map +1 -0
- package/lib/feature-draw/index.js +73 -0
- package/lib/feature-draw/index.js.map +1 -0
- package/lib/feature-draw/style/css.js +2 -0
- package/lib/feature-draw/style/css.js.map +1 -0
- package/lib/feature-draw/style/index.js +2 -0
- package/lib/feature-draw/style/index.js.map +1 -0
- package/lib/feature-layer/FeatureLayer.js +1040 -0
- package/lib/feature-layer/FeatureLayer.js.map +1 -0
- package/lib/feature-layer/MyCluster.js +153 -0
- package/lib/feature-layer/MyCluster.js.map +1 -0
- package/lib/feature-layer/createFeatureCollection.js +175 -0
- package/lib/feature-layer/createFeatureCollection.js.map +1 -0
- package/lib/feature-layer/index.js +155 -0
- package/lib/feature-layer/index.js.map +1 -0
- package/lib/feature-layer/style/css.js +4 -0
- package/lib/feature-layer/style/css.js.map +1 -0
- package/lib/feature-layer/style/index.css +0 -0
- package/lib/feature-layer/style/index.js +4 -0
- package/lib/feature-layer/style/index.js.map +1 -0
- package/lib/feature-layer/style/index.less +0 -0
- package/lib/flow-line-layer/FlowLineLayer.js +200 -0
- package/lib/flow-line-layer/FlowLineLayer.js.map +1 -0
- package/lib/flow-line-layer/index.js +127 -0
- package/lib/flow-line-layer/index.js.map +1 -0
- package/lib/flow-line-layer/style/css.js +4 -0
- package/lib/flow-line-layer/style/css.js.map +1 -0
- package/lib/flow-line-layer/style/index.css +0 -0
- package/lib/flow-line-layer/style/index.js +4 -0
- package/lib/flow-line-layer/style/index.js.map +1 -0
- package/lib/flow-line-layer/style/index.less +0 -0
- package/lib/fly-line-layer/FlyLineLayer.js +220 -0
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -0
- package/lib/fly-line-layer/index.js +110 -0
- package/lib/fly-line-layer/index.js.map +1 -0
- package/lib/fly-line-layer/style/css.js +4 -0
- package/lib/fly-line-layer/style/css.js.map +1 -0
- package/lib/fly-line-layer/style/index.css +0 -0
- package/lib/fly-line-layer/style/index.js +4 -0
- package/lib/fly-line-layer/style/index.js.map +1 -0
- package/lib/fly-line-layer/style/index.less +0 -0
- package/lib/group-layer/GroupLayer.js +134 -0
- package/lib/group-layer/GroupLayer.js.map +1 -0
- package/lib/group-layer/index.js +74 -0
- package/lib/group-layer/index.js.map +1 -0
- package/lib/group-layer/style/css.js +4 -0
- package/lib/group-layer/style/css.js.map +1 -0
- package/lib/group-layer/style/index.css +0 -0
- package/lib/group-layer/style/index.js +4 -0
- package/lib/group-layer/style/index.js.map +1 -0
- package/lib/group-layer/style/index.less +0 -0
- package/lib/heatmap-layer/HeatmapLayer.js +192 -0
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -0
- package/lib/heatmap-layer/index.js +94 -0
- package/lib/heatmap-layer/index.js.map +1 -0
- package/lib/heatmap-layer/style/css.js +4 -0
- package/lib/heatmap-layer/style/css.js.map +1 -0
- package/lib/heatmap-layer/style/index.css +0 -0
- package/lib/heatmap-layer/style/index.js +4 -0
- package/lib/heatmap-layer/style/index.js.map +1 -0
- package/lib/heatmap-layer/style/index.less +0 -0
- package/lib/high-layer/HighLayer.js +201 -0
- package/lib/high-layer/HighLayer.js.map +1 -0
- package/lib/high-layer/index.js +46 -0
- package/lib/high-layer/index.js.map +1 -0
- package/lib/high-layer/style/css.js +2 -0
- package/lib/high-layer/style/css.js.map +1 -0
- package/lib/high-layer/style/index.js +2 -0
- package/lib/high-layer/style/index.js.map +1 -0
- package/lib/image-layer/ImageLayer.js +332 -0
- package/lib/image-layer/ImageLayer.js.map +1 -0
- package/lib/image-layer/ImageTileLayer.js +334 -0
- package/lib/image-layer/ImageTileLayer.js.map +1 -0
- package/lib/image-layer/index.js +101 -0
- package/lib/image-layer/index.js.map +1 -0
- package/lib/image-layer/style/css.js +4 -0
- package/lib/image-layer/style/css.js.map +1 -0
- package/lib/image-layer/style/index.css +0 -0
- package/lib/image-layer/style/index.js +4 -0
- package/lib/image-layer/style/index.js.map +1 -0
- package/lib/image-layer/style/index.less +0 -0
- package/lib/index.js +201 -0
- package/lib/index.js.map +1 -0
- package/lib/legend/index.js +255 -0
- package/lib/legend/index.js.map +1 -0
- package/lib/legend/style/css.js +8 -0
- package/lib/legend/style/css.js.map +1 -0
- package/lib/legend/style/index.css +109 -0
- package/lib/legend/style/index.js +8 -0
- package/lib/legend/style/index.js.map +1 -0
- package/lib/legend/style/index.less +100 -0
- package/lib/map/Analysis.js +151 -0
- package/lib/map/Analysis.js.map +1 -0
- package/lib/map/Layers.js +341 -0
- package/lib/map/Layers.js.map +1 -0
- package/lib/map/Popup.js +372 -0
- package/lib/map/Popup.js.map +1 -0
- package/lib/map/ScaleDenominator.js +70 -0
- package/lib/map/ScaleDenominator.js.map +1 -0
- package/lib/map/Test.js +146 -0
- package/lib/map/Test.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +164 -0
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +85 -0
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +67 -0
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +86 -0
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -0
- package/lib/map/getBaseLayers/index.js +48 -0
- package/lib/map/getBaseLayers/index.js.map +1 -0
- package/lib/map/index.js +823 -0
- package/lib/map/index.js.map +1 -0
- package/lib/map/style/css.js +5 -0
- package/lib/map/style/css.js.map +1 -0
- package/lib/map/style/index.css +171 -0
- package/lib/map/style/index.js +5 -0
- package/lib/map/style/index.js.map +1 -0
- package/lib/map/style/index.less +152 -0
- package/lib/map-icon/svg/index.js +82 -0
- package/lib/map-icon/svg/index.js.map +1 -0
- package/lib/map-icon/svg/tuceng.svg.js +2 -0
- package/lib/map-icon/svg/tuceng.svg.js.map +1 -0
- package/lib/marker/Marker.js +108 -0
- package/lib/marker/Marker.js.map +1 -0
- package/lib/marker/index.js +62 -0
- package/lib/marker/index.js.map +1 -0
- package/lib/marker/style/css.js +2 -0
- package/lib/marker/style/css.js.map +1 -0
- package/lib/marker/style/index.js +2 -0
- package/lib/marker/style/index.js.map +1 -0
- package/lib/path-line-layer/PathLineLayer.js +47 -0
- package/lib/path-line-layer/PathLineLayer.js.map +1 -0
- package/lib/path-line-layer/getPathLineStyles.js +72 -0
- package/lib/path-line-layer/getPathLineStyles.js.map +1 -0
- package/lib/path-line-layer/index.js +152 -0
- package/lib/path-line-layer/index.js.map +1 -0
- package/lib/path-line-layer/style/css.js +4 -0
- package/lib/path-line-layer/style/css.js.map +1 -0
- package/lib/path-line-layer/style/index.css +0 -0
- package/lib/path-line-layer/style/index.js +4 -0
- package/lib/path-line-layer/style/index.js.map +1 -0
- package/lib/path-line-layer/style/index.less +0 -0
- package/lib/path-play-back/PathPlayBack.js +677 -0
- package/lib/path-play-back/PathPlayBack.js.map +1 -0
- package/lib/path-play-back/index.js +76 -0
- package/lib/path-play-back/index.js.map +1 -0
- package/lib/path-play-back/style/css.js +2 -0
- package/lib/path-play-back/style/css.js.map +1 -0
- package/lib/path-play-back/style/index.js +2 -0
- package/lib/path-play-back/style/index.js.map +1 -0
- package/lib/poi-search/Location.js +63 -0
- package/lib/poi-search/Location.js.map +1 -0
- package/lib/poi-search/PoiList.js +116 -0
- package/lib/poi-search/PoiList.js.map +1 -0
- package/lib/poi-search/Search.js +208 -0
- package/lib/poi-search/Search.js.map +1 -0
- package/lib/poi-search/index.js +174 -0
- package/lib/poi-search/index.js.map +1 -0
- package/lib/poi-search/style/css.js +8 -0
- package/lib/poi-search/style/css.js.map +1 -0
- package/lib/poi-search/style/index.css +96 -0
- package/lib/poi-search/style/index.js +8 -0
- package/lib/poi-search/style/index.js.map +1 -0
- package/lib/poi-search/style/index.less +97 -0
- package/lib/point/Point.js +59 -0
- package/lib/point/Point.js.map +1 -0
- package/lib/point/index.js +62 -0
- package/lib/point/index.js.map +1 -0
- package/lib/point/style/css.js +2 -0
- package/lib/point/style/css.js.map +1 -0
- package/lib/point/style/index.js +2 -0
- package/lib/point/style/index.js.map +1 -0
- package/lib/polygon/Polygon.js +53 -0
- package/lib/polygon/Polygon.js.map +1 -0
- package/lib/polygon/index.js +62 -0
- package/lib/polygon/index.js.map +1 -0
- package/lib/polygon/style/css.js +2 -0
- package/lib/polygon/style/css.js.map +1 -0
- package/lib/polygon/style/index.js +2 -0
- package/lib/polygon/style/index.js.map +1 -0
- package/lib/polyline/Polyline.js +53 -0
- package/lib/polyline/Polyline.js.map +1 -0
- package/lib/polyline/index.js +62 -0
- package/lib/polyline/index.js.map +1 -0
- package/lib/polyline/style/css.js +2 -0
- package/lib/polyline/style/css.js.map +1 -0
- package/lib/polyline/style/index.js +2 -0
- package/lib/polyline/style/index.js.map +1 -0
- package/lib/popup/index.js +204 -0
- package/lib/popup/index.js.map +1 -0
- package/lib/popup/style/css.js +4 -0
- package/lib/popup/style/css.js.map +1 -0
- package/lib/popup/style/index.css +131 -0
- package/lib/popup/style/index.js +4 -0
- package/lib/popup/style/index.js.map +1 -0
- package/lib/popup/style/index.less +129 -0
- package/lib/provider/index.js +14 -0
- package/lib/provider/index.js.map +1 -0
- package/lib/provider/style/css.js +2 -0
- package/lib/provider/style/css.js.map +1 -0
- package/lib/provider/style/index.js +2 -0
- package/lib/provider/style/index.js.map +1 -0
- package/lib/renderer/Fill.js +39 -0
- package/lib/renderer/Fill.js.map +1 -0
- package/lib/renderer/Stroke.js +41 -0
- package/lib/renderer/Stroke.js.map +1 -0
- package/lib/renderer/index.js +140 -0
- package/lib/renderer/index.js.map +1 -0
- package/lib/renderer/style/css.js +4 -0
- package/lib/renderer/style/css.js.map +1 -0
- package/lib/renderer/style/index.css +0 -0
- package/lib/renderer/style/index.js +4 -0
- package/lib/renderer/style/index.js.map +1 -0
- package/lib/renderer/style/index.less +0 -0
- package/lib/renderer/transformRgb.js +34 -0
- package/lib/renderer/transformRgb.js.map +1 -0
- package/lib/search-map/VtxModal.js +205 -0
- package/lib/search-map/VtxModal.js.map +1 -0
- package/lib/search-map/index.js +418 -0
- package/lib/search-map/index.js.map +1 -0
- package/lib/search-map/style/css.js +6 -0
- package/lib/search-map/style/css.js.map +1 -0
- package/lib/search-map/style/index.css +73 -0
- package/lib/search-map/style/index.js +6 -0
- package/lib/search-map/style/index.js.map +1 -0
- package/lib/search-map/style/index.less +83 -0
- package/lib/search-map/style/modal.css +54 -0
- package/lib/search-map/style/modal.less +58 -0
- package/lib/style/index.css +0 -0
- package/lib/style/index.less +2 -0
- package/lib/style/themes/compact.css +0 -0
- package/lib/style/themes/compact.less +1 -0
- package/lib/style/themes/dark.css +0 -0
- package/lib/style/themes/dark.less +9 -0
- package/lib/style/themes/default.css +0 -0
- package/lib/style/themes/default.less +7 -0
- package/lib/style/themes/index.css +0 -0
- package/lib/style/themes/index.less +1 -0
- package/lib/style/themes/variable.css +0 -0
- package/lib/style/themes/variable.less +5 -0
- package/lib/tile-layer/TileLayer.js +88 -0
- package/lib/tile-layer/TileLayer.js.map +1 -0
- package/lib/tile-layer/index.js +53 -0
- package/lib/tile-layer/index.js.map +1 -0
- package/lib/tile-layer/style/css.js +4 -0
- package/lib/tile-layer/style/css.js.map +1 -0
- package/lib/tile-layer/style/index.css +0 -0
- package/lib/tile-layer/style/index.js +4 -0
- package/lib/tile-layer/style/index.js.map +1 -0
- package/lib/tile-layer/style/index.less +0 -0
- package/lib/tools/Layer/LayerService.js +183 -0
- package/lib/tools/Layer/LayerService.js.map +1 -0
- package/lib/tools/Layer/LayersCheckService.js +195 -0
- package/lib/tools/Layer/LayersCheckService.js.map +1 -0
- package/lib/tools/Layer/index.css +50 -0
- package/lib/tools/Layer/index.js +226 -0
- package/lib/tools/Layer/index.js.map +1 -0
- package/lib/tools/Layer/index.less +43 -0
- package/lib/tools/Search/index.js +298 -0
- package/lib/tools/Search/index.js.map +1 -0
- package/lib/tools/Toolbox/BoxSelect/index.js +20 -0
- package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/CircleSelect/index.js +20 -0
- package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/EagleEye/index.js +57 -0
- package/lib/tools/Toolbox/EagleEye/index.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js +153 -0
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/index.css +18 -0
- package/lib/tools/Toolbox/MapBookmark/index.js +430 -0
- package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -0
- package/lib/tools/Toolbox/MapBookmark/index.less +20 -0
- package/lib/tools/Toolbox/MapDownload/index.js +16 -0
- package/lib/tools/Toolbox/MapDownload/index.js.map +1 -0
- package/lib/tools/Toolbox/MapPrint/index.css +4 -0
- package/lib/tools/Toolbox/MapPrint/index.js +234 -0
- package/lib/tools/Toolbox/MapPrint/index.js.map +1 -0
- package/lib/tools/Toolbox/MapPrint/index.less +4 -0
- package/lib/tools/Toolbox/Measure/Area/index.js +17 -0
- package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -0
- package/lib/tools/Toolbox/Measure/Distance/index.js +17 -0
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -0
- package/lib/tools/Toolbox/Measure/Measure.js +229 -0
- package/lib/tools/Toolbox/Measure/Measure.js.map +1 -0
- package/lib/tools/Toolbox/Measure/index.js +77 -0
- package/lib/tools/Toolbox/Measure/index.js.map +1 -0
- package/lib/tools/Toolbox/PolygonSelect/index.js +20 -0
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -0
- package/lib/tools/Toolbox/ScaleLine/index.js +59 -0
- package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -0
- package/lib/tools/Toolbox/SelectTools/index.css +103 -0
- package/lib/tools/Toolbox/SelectTools/index.js +779 -0
- package/lib/tools/Toolbox/SelectTools/index.js.map +1 -0
- package/lib/tools/Toolbox/SelectTools/index.less +87 -0
- package/lib/tools/Toolbox/SpaceQuery/index.css +19 -0
- package/lib/tools/Toolbox/SpaceQuery/index.js +593 -0
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -0
- package/lib/tools/Toolbox/SpaceQuery/index.less +16 -0
- package/lib/tools/Toolbox/ZoomInput/index.css +6 -0
- package/lib/tools/Toolbox/ZoomInput/index.js +50 -0
- package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -0
- package/lib/tools/Toolbox/ZoomInput/index.less +6 -0
- package/lib/tools/Toolbox/index.css +0 -0
- package/lib/tools/Toolbox/index.js +172 -0
- package/lib/tools/Toolbox/index.js.map +1 -0
- package/lib/tools/Toolbox/index.less +2 -0
- package/lib/tools/Utils/CreateOverlay.js +47 -0
- package/lib/tools/Utils/CreateOverlay.js.map +1 -0
- package/lib/tools/Utils/Draw.js +130 -0
- package/lib/tools/Utils/Draw.js.map +1 -0
- package/lib/tools/Utils/HighLayer.js +213 -0
- package/lib/tools/Utils/HighLayer.js.map +1 -0
- package/lib/tools/Utils/measure.js +247 -0
- package/lib/tools/Utils/measure.js.map +1 -0
- package/lib/tools/Utils/utils.js +272 -0
- package/lib/tools/Utils/utils.js.map +1 -0
- package/lib/tools/View/index.css +35 -0
- package/lib/tools/View/index.js +166 -0
- package/lib/tools/View/index.js.map +1 -0
- package/lib/tools/View/index.less +28 -0
- package/lib/tools/analysis-tool/index.js +113 -0
- package/lib/tools/analysis-tool/index.js.map +1 -0
- package/lib/tools/base-map-switch/index.js +150 -0
- package/lib/tools/base-map-switch/index.js.map +1 -0
- package/lib/tools/components/Chart/index.js +828 -0
- package/lib/tools/components/Chart/index.js.map +1 -0
- package/lib/tools/components/Icon/index.js +32 -0
- package/lib/tools/components/Icon/index.js.map +1 -0
- package/lib/tools/components/Info/index.css +39 -0
- package/lib/tools/components/Info/index.js +35 -0
- package/lib/tools/components/Info/index.js.map +1 -0
- package/lib/tools/components/Info/index.less +26 -0
- package/lib/tools/components/ItemWrap/index.css +43 -0
- package/lib/tools/components/ItemWrap/index.js +48 -0
- package/lib/tools/components/ItemWrap/index.js.map +1 -0
- package/lib/tools/components/ItemWrap/index.less +41 -0
- package/lib/tools/components/Modal/index.css +42 -0
- package/lib/tools/components/Modal/index.js +46 -0
- package/lib/tools/components/Modal/index.js.map +1 -0
- package/lib/tools/components/Modal/index.less +33 -0
- package/lib/tools/components/MyTabs/index.js +22 -0
- package/lib/tools/components/MyTabs/index.js.map +1 -0
- package/lib/tools/components/RequiredLabel/index.css +5 -0
- package/lib/tools/components/RequiredLabel/index.js +32 -0
- package/lib/tools/components/RequiredLabel/index.js.map +1 -0
- package/lib/tools/components/RequiredLabel/index.less +5 -0
- package/lib/tools/components/Select/index.js +33 -0
- package/lib/tools/components/Select/index.js.map +1 -0
- package/lib/tools/components/Table/assets/tableIcon.png +0 -0
- package/lib/tools/components/Table/index.css +10 -0
- package/lib/tools/components/Table/index.js +91 -0
- package/lib/tools/components/Table/index.js.map +1 -0
- package/lib/tools/components/Table/index.less +13 -0
- package/lib/tools/components/ToolItem/index.css +30 -0
- package/lib/tools/components/ToolItem/index.js +29 -0
- package/lib/tools/components/ToolItem/index.js.map +1 -0
- package/lib/tools/components/ToolItem/index.less +27 -0
- package/lib/tools/components/ToolsSelect/index.css +15 -0
- package/lib/tools/components/ToolsSelect/index.js +45 -0
- package/lib/tools/components/ToolsSelect/index.js.map +1 -0
- package/lib/tools/components/ToolsSelect/index.less +10 -0
- package/lib/tools/full-screen/index.js +47 -0
- package/lib/tools/full-screen/index.js.map +1 -0
- package/lib/tools/index.js +151 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/layer-control/index.js +173 -0
- package/lib/tools/layer-control/index.js.map +1 -0
- package/lib/tools/refresh/index.js +41 -0
- package/lib/tools/refresh/index.js.map +1 -0
- package/lib/tools/style/css.js +22 -0
- package/lib/tools/style/css.js.map +1 -0
- package/lib/tools/style/index.css +136 -0
- package/lib/tools/style/index.js +22 -0
- package/lib/tools/style/index.js.map +1 -0
- package/lib/tools/style/index.less +154 -0
- package/lib/tools-item/index.js +67 -0
- package/lib/tools-item/index.js.map +1 -0
- package/lib/use-props/index.js +15 -0
- package/lib/use-props/index.js.map +1 -0
- package/lib/use-props/style/css.js +2 -0
- package/lib/use-props/style/css.js.map +1 -0
- package/lib/use-props/style/index.js +2 -0
- package/lib/use-props/style/index.js.map +1 -0
- package/lib/wms-layer/WmsLayer.js +315 -0
- package/lib/wms-layer/WmsLayer.js.map +1 -0
- package/lib/wms-layer/index.js +98 -0
- package/lib/wms-layer/index.js.map +1 -0
- package/lib/wms-layer/style/css.js +4 -0
- package/lib/wms-layer/style/css.js.map +1 -0
- package/lib/wms-layer/style/index.css +0 -0
- package/lib/wms-layer/style/index.js +4 -0
- package/lib/wms-layer/style/index.js.map +1 -0
- package/lib/wms-layer/style/index.less +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.numberTo = exports.mergeXAxisAndData = exports.mergeSeriesAndData = exports.mergeConfigAndData = exports.getColor = exports["default"] = exports.convertPieData = exports.convertDecimal = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _excluded = ["data"],
|
|
11
|
+
_excluded2 = ["name", "nameTextStyle"],
|
|
12
|
+
_excluded3 = ["name", "data"],
|
|
13
|
+
_excluded4 = ["name", "data", "type"],
|
|
14
|
+
_excluded5 = ["name", "data", "type"],
|
|
15
|
+
_excluded6 = ["name", "data", "type", "lingColor"],
|
|
16
|
+
_excluded7 = ["type", "color", "barLabelConfig"],
|
|
17
|
+
_excluded8 = ["name", "data"],
|
|
18
|
+
_excluded9 = ["name", "data"],
|
|
19
|
+
_excluded10 = ["data", "onEvents", "color", "legend", "unit", "tooltip", "grid", "xAxis", "yAxis", "height", "series", "loading", "title", "dataZoom", "noDataText", "style", "imgStyle", "noDataStyle"];
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
24
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
34
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
36
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
var color = '#86909C';
|
|
42
|
+
var fontSize = '12px';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 小数处理,默认2位
|
|
46
|
+
* @param value
|
|
47
|
+
* @param len
|
|
48
|
+
* @returns {number|*}
|
|
49
|
+
*/
|
|
50
|
+
var convertDecimal = function convertDecimal(value) {
|
|
51
|
+
var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
52
|
+
if (value && String(value).indexOf('.') !== -1) {
|
|
53
|
+
var _String$split = String(value).split('.'),
|
|
54
|
+
_String$split2 = _slicedToArray(_String$split, 2),
|
|
55
|
+
start = _String$split2[0],
|
|
56
|
+
end = _String$split2[1];
|
|
57
|
+
if (String(end).length > len) {
|
|
58
|
+
end = end.substring(0, len);
|
|
59
|
+
}
|
|
60
|
+
return Number("".concat(start, ".").concat(end));
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 转换饼图数据,处理占比截取为默认2位小数
|
|
67
|
+
* @param data
|
|
68
|
+
* @returns {*[]}
|
|
69
|
+
*/
|
|
70
|
+
exports.convertDecimal = convertDecimal;
|
|
71
|
+
var convertPieData = function convertPieData(data) {
|
|
72
|
+
var _data2;
|
|
73
|
+
var _data = [];
|
|
74
|
+
if ((_data2 = data) !== null && _data2 !== void 0 && _data2.length) {
|
|
75
|
+
data = data.filter(function (v) {
|
|
76
|
+
return Number(v.value);
|
|
77
|
+
});
|
|
78
|
+
var total = 0;
|
|
79
|
+
data.map(function (v) {
|
|
80
|
+
if (v.value) {
|
|
81
|
+
total += Number(v.value);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
data.map(function (v) {
|
|
85
|
+
var value = v.value;
|
|
86
|
+
var rate = (value || 0) / total * 100 || 0;
|
|
87
|
+
rate = convertDecimal(rate);
|
|
88
|
+
_data.push(_objectSpread(_objectSpread({}, v), {}, {
|
|
89
|
+
rate: rate
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return _data;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 合并 xAxis 配置及数据
|
|
98
|
+
* @param xAxis
|
|
99
|
+
* @param data
|
|
100
|
+
* @returns {*&{data: *[]}}
|
|
101
|
+
*/
|
|
102
|
+
exports.convertPieData = convertPieData;
|
|
103
|
+
var mergeXAxisAndData = function mergeXAxisAndData(xAxis, data) {
|
|
104
|
+
var times = [];
|
|
105
|
+
if (data !== null && data !== void 0 && data.length) {
|
|
106
|
+
var field = xAxis.field,
|
|
107
|
+
format = xAxis.format;
|
|
108
|
+
if (field) {
|
|
109
|
+
data.map(function (v) {
|
|
110
|
+
var time = field ? v[field] : v;
|
|
111
|
+
times.push(time);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return _objectSpread({
|
|
116
|
+
data: times
|
|
117
|
+
}, xAxis);
|
|
118
|
+
};
|
|
119
|
+
exports.mergeXAxisAndData = mergeXAxisAndData;
|
|
120
|
+
var numberTo = function numberTo(data, number, limit) {
|
|
121
|
+
if (number) {
|
|
122
|
+
return (Number(data) / number).toFixed(limit || 2);
|
|
123
|
+
}
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 合并 series 和数据
|
|
129
|
+
* @param series
|
|
130
|
+
* @param data
|
|
131
|
+
* @returns {*[]}
|
|
132
|
+
*/
|
|
133
|
+
exports.numberTo = numberTo;
|
|
134
|
+
var mergeSeriesAndData = function mergeSeriesAndData(series, data) {
|
|
135
|
+
var _series = [];
|
|
136
|
+
series.map(function (s) {
|
|
137
|
+
var seriesItem = _objectSpread({}, s);
|
|
138
|
+
if (data !== null && data !== void 0 && data.length && s.field) {
|
|
139
|
+
seriesItem.data = [];
|
|
140
|
+
data.map(function (v) {
|
|
141
|
+
seriesItem.data.push(numberTo(v[s.field], s.numberTo));
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
_series.push(seriesItem);
|
|
145
|
+
});
|
|
146
|
+
return _series;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 合并配置和数据
|
|
151
|
+
* @param options
|
|
152
|
+
* @returns {{}}
|
|
153
|
+
*/
|
|
154
|
+
exports.mergeSeriesAndData = mergeSeriesAndData;
|
|
155
|
+
var mergeConfigAndData = function mergeConfigAndData(options) {
|
|
156
|
+
var xAxis = options.xAxis,
|
|
157
|
+
yAxis = options.yAxis,
|
|
158
|
+
series = options.series,
|
|
159
|
+
data = options.data;
|
|
160
|
+
var val = {};
|
|
161
|
+
if (!(data && (data.length || Object.keys(data).length))) {
|
|
162
|
+
return options;
|
|
163
|
+
}
|
|
164
|
+
if (yAxis !== null && yAxis !== void 0 && yAxis.field) {
|
|
165
|
+
val.yAxis = mergeXAxisAndData(yAxis, data);
|
|
166
|
+
}
|
|
167
|
+
if (xAxis !== null && xAxis !== void 0 && xAxis.field) {
|
|
168
|
+
val.xAxis = mergeXAxisAndData(xAxis, data);
|
|
169
|
+
}
|
|
170
|
+
if (series !== null && series !== void 0 && series.length) {
|
|
171
|
+
val.series = mergeSeriesAndData(series, data);
|
|
172
|
+
}
|
|
173
|
+
return _objectSpread(_objectSpread({}, options), val);
|
|
174
|
+
};
|
|
175
|
+
exports.mergeConfigAndData = mergeConfigAndData;
|
|
176
|
+
var getUnit = function getUnit(units, name) {
|
|
177
|
+
if (units && _typeof(units) === 'object') {
|
|
178
|
+
if (Array.isArray(units)) {
|
|
179
|
+
var _units$filter$;
|
|
180
|
+
return (_units$filter$ = units.filter(function (item) {
|
|
181
|
+
return item.name === name;
|
|
182
|
+
})[0]) === null || _units$filter$ === void 0 ? void 0 : _units$filter$.value;
|
|
183
|
+
} else {
|
|
184
|
+
return (units === null || units === void 0 ? void 0 : units[name]) || '';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return units || '';
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* 获取 tooltip
|
|
191
|
+
* @param options
|
|
192
|
+
* @returns {*&{trigger: string}}
|
|
193
|
+
*/
|
|
194
|
+
var getTooltip = function getTooltip(options, unit, series) {
|
|
195
|
+
var _series$;
|
|
196
|
+
return _objectSpread({
|
|
197
|
+
trigger: ((_series$ = series[0]) === null || _series$ === void 0 ? void 0 : _series$.type) === 'pie' ? 'item' : 'axis',
|
|
198
|
+
confine: true,
|
|
199
|
+
// 限制在图表区域里
|
|
200
|
+
borderWidth: 0,
|
|
201
|
+
formatter: function formatter(params) {
|
|
202
|
+
var _series$2;
|
|
203
|
+
if (((_series$2 = series[0]) === null || _series$2 === void 0 ? void 0 : _series$2.type) === 'pie') {
|
|
204
|
+
var currentUnit = getUnit(unit, params.name);
|
|
205
|
+
return "".concat(params.name, "\uFF1A").concat(params.value).concat(currentUnit);
|
|
206
|
+
}
|
|
207
|
+
var res = params[0].name;
|
|
208
|
+
for (var i = 0; i < params.length; i++) {
|
|
209
|
+
var _currentUnit = getUnit(unit, params[i].seriesName);
|
|
210
|
+
res += "<br>".concat(params[i].marker).concat(params[i].seriesName, "\uFF1A").concat(params[i].value).concat(_currentUnit);
|
|
211
|
+
}
|
|
212
|
+
return res;
|
|
213
|
+
}
|
|
214
|
+
}, options);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* 获取 图例
|
|
219
|
+
* @param options
|
|
220
|
+
* @returns {*&{pageTextStyle: {color: string}, textStyle: {color: string}, type: string, pageIconInactiveColor: string, pageIconColor: string}}
|
|
221
|
+
*/
|
|
222
|
+
var getLegend = function getLegend(options) {
|
|
223
|
+
return _objectSpread({
|
|
224
|
+
type: 'scroll',
|
|
225
|
+
left: 'center',
|
|
226
|
+
itemGap: 12
|
|
227
|
+
}, options);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* 获取布局
|
|
232
|
+
* @param grid
|
|
233
|
+
* @param dataZoom
|
|
234
|
+
* @returns {*&{top: string, left: number, bottom: string, right: number, containLabel: boolean}}
|
|
235
|
+
*/
|
|
236
|
+
var getGrid = function getGrid(grid, dataZoom) {
|
|
237
|
+
return _objectSpread({
|
|
238
|
+
left: 5,
|
|
239
|
+
right: 5,
|
|
240
|
+
top: 35,
|
|
241
|
+
bottom: dataZoom !== null && dataZoom !== void 0 && dataZoom.show ? 30 : 10,
|
|
242
|
+
containLabel: true
|
|
243
|
+
}, grid);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* 获取 xAxis 单项
|
|
248
|
+
* @param options 参数可以是: "[xx, xx]"、"{data: [xx, xx], ...}"
|
|
249
|
+
* @returns {{axisLabel: {textStyle: {color: string}}, data: *, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, type: string, boundaryGap: boolean}}
|
|
250
|
+
*/
|
|
251
|
+
var getXAxisItem = function getXAxisItem(options) {
|
|
252
|
+
var _ref = Array.isArray(options) ? {
|
|
253
|
+
data: options
|
|
254
|
+
} : options,
|
|
255
|
+
data = _ref.data,
|
|
256
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
257
|
+
return _objectSpread({
|
|
258
|
+
type: 'category',
|
|
259
|
+
boundaryGap: true,
|
|
260
|
+
// false 从0开始
|
|
261
|
+
axisTick: {
|
|
262
|
+
show: false
|
|
263
|
+
},
|
|
264
|
+
axisLabel: {
|
|
265
|
+
textStyle: {
|
|
266
|
+
fontSize: fontSize,
|
|
267
|
+
color: color
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
axisLine: {
|
|
271
|
+
show: true,
|
|
272
|
+
lineStyle: {
|
|
273
|
+
type: [3, 3],
|
|
274
|
+
dashOffset: 3,
|
|
275
|
+
color: '#E5E6EB'
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
data: data
|
|
279
|
+
}, other);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* 获取 xAxis 配置
|
|
284
|
+
* @param xAxis 参数说明:"[xx, xx]"、"[[xx, xx], [xx, xx]]"、"[{data: [xx, xx], ...}]"
|
|
285
|
+
* @returns {(*&{axisLabel: {textStyle: {color: string}}, data, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, type: string, boundaryGap: boolean})|*[]}
|
|
286
|
+
*/
|
|
287
|
+
var getXAxis = function getXAxis(xAxis) {
|
|
288
|
+
if (xAxis) {
|
|
289
|
+
if (_typeof(xAxis[0]) === 'object') {
|
|
290
|
+
var _xAxis = [];
|
|
291
|
+
_xAxis.map(function (v) {
|
|
292
|
+
_xAxis.push(getXAxisItem(v));
|
|
293
|
+
});
|
|
294
|
+
return _xAxis;
|
|
295
|
+
}
|
|
296
|
+
return getXAxisItem(xAxis);
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
show: false
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* 获取单个 yAxis 配置
|
|
305
|
+
* @param options 参数可以是:"xx"、"{name: 'xx', ...其他配置}"
|
|
306
|
+
* @returns {{axisLabel: {textStyle: {color: string}, showMaxLabel: boolean}, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, splitLine: {show: boolean}, nameTextStyle: {color: string}}}
|
|
307
|
+
*/
|
|
308
|
+
var getYAxisItem = function getYAxisItem(options) {
|
|
309
|
+
options = options || {};
|
|
310
|
+
var _ref2 = typeof options === 'string' ? {
|
|
311
|
+
name: options
|
|
312
|
+
} : options,
|
|
313
|
+
name = _ref2.name,
|
|
314
|
+
nameTextStyle = _ref2.nameTextStyle,
|
|
315
|
+
other = _objectWithoutProperties(_ref2, _excluded2);
|
|
316
|
+
return _objectSpread({
|
|
317
|
+
name: name,
|
|
318
|
+
axisLabel: {
|
|
319
|
+
textStyle: {
|
|
320
|
+
color: color,
|
|
321
|
+
fontSize: fontSize
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
axisLine: {
|
|
325
|
+
show: false,
|
|
326
|
+
lineStyle: {
|
|
327
|
+
color: '#E5E6EB',
|
|
328
|
+
width: 1
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
axisTick: {
|
|
332
|
+
show: false
|
|
333
|
+
},
|
|
334
|
+
splitLine: {
|
|
335
|
+
show: true,
|
|
336
|
+
lineStyle: {
|
|
337
|
+
type: [3, 3],
|
|
338
|
+
dashOffset: 3,
|
|
339
|
+
color: '#E5E6EB'
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
nameTextStyle: _objectSpread({
|
|
343
|
+
fontSize: fontSize,
|
|
344
|
+
color: color
|
|
345
|
+
}, nameTextStyle)
|
|
346
|
+
}, other);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* 获取 yAxis 配置
|
|
351
|
+
* @param yAxis 参数可以是: "xx"、"['xx', 'xxx']"、"[{name: 'xx', ...其他配置}]"
|
|
352
|
+
* @returns {{axisLabel: {textStyle: {color: string}, showMaxLabel: boolean}, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, splitLine: {show: boolean}, nameTextStyle: {color: string}}|*[]}
|
|
353
|
+
*/
|
|
354
|
+
var getYAxis = function getYAxis(yAxis) {
|
|
355
|
+
if (yAxis) {
|
|
356
|
+
if (Array.isArray(yAxis)) {
|
|
357
|
+
var _yAxis = [];
|
|
358
|
+
yAxis.map(function (v, i) {
|
|
359
|
+
var options = typeof v === 'string' ? {
|
|
360
|
+
name: v
|
|
361
|
+
} : v;
|
|
362
|
+
_yAxis.push(getYAxisItem(_objectSpread({
|
|
363
|
+
nameTextStyle: {
|
|
364
|
+
padding: i === 0 ? [0, 30, 0, 0] : [0, 0, 0, 30]
|
|
365
|
+
}
|
|
366
|
+
}, options)));
|
|
367
|
+
});
|
|
368
|
+
return _yAxis;
|
|
369
|
+
}
|
|
370
|
+
return getYAxisItem(yAxis);
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
show: false
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* 获取 折线图 数据项
|
|
379
|
+
* @param name
|
|
380
|
+
* @param data
|
|
381
|
+
* @param other
|
|
382
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
383
|
+
*/
|
|
384
|
+
var getLineSeries = function getLineSeries(_ref3) {
|
|
385
|
+
var name = _ref3.name,
|
|
386
|
+
data = _ref3.data,
|
|
387
|
+
other = _objectWithoutProperties(_ref3, _excluded3);
|
|
388
|
+
return _objectSpread({
|
|
389
|
+
type: 'line',
|
|
390
|
+
symbol: 'circle',
|
|
391
|
+
symbolSize: 0,
|
|
392
|
+
smooth: true,
|
|
393
|
+
connectNulls: true,
|
|
394
|
+
name: name,
|
|
395
|
+
data: data
|
|
396
|
+
}, other);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* 获取 柱状图 数据项
|
|
401
|
+
* @param name
|
|
402
|
+
* @param data
|
|
403
|
+
* @param other
|
|
404
|
+
* @returns {*&{barMaxWidth: number, connectNulls: boolean, data, barMinWidth: number, name, type: string}}
|
|
405
|
+
*/
|
|
406
|
+
var getBarSeries = function getBarSeries(_ref4) {
|
|
407
|
+
var name = _ref4.name,
|
|
408
|
+
data = _ref4.data,
|
|
409
|
+
type = _ref4.type,
|
|
410
|
+
other = _objectWithoutProperties(_ref4, _excluded4);
|
|
411
|
+
// 特殊样式处理
|
|
412
|
+
return _objectSpread({
|
|
413
|
+
type: 'bar',
|
|
414
|
+
symbol: 'circle',
|
|
415
|
+
barMaxWidth: 20,
|
|
416
|
+
barMinWidth: 5,
|
|
417
|
+
connectNulls: true,
|
|
418
|
+
name: name,
|
|
419
|
+
data: data
|
|
420
|
+
}, other);
|
|
421
|
+
};
|
|
422
|
+
var getPictorialBar = function getPictorialBar(_ref5) {
|
|
423
|
+
var name = _ref5.name,
|
|
424
|
+
data = _ref5.data,
|
|
425
|
+
type = _ref5.type,
|
|
426
|
+
other = _objectWithoutProperties(_ref5, _excluded5);
|
|
427
|
+
return _objectSpread({
|
|
428
|
+
type: 'pictorialBar',
|
|
429
|
+
name: name,
|
|
430
|
+
data: data
|
|
431
|
+
}, other);
|
|
432
|
+
};
|
|
433
|
+
var getLingBarSeries = function getLingBarSeries(_ref6) {
|
|
434
|
+
var name = _ref6.name,
|
|
435
|
+
data = _ref6.data,
|
|
436
|
+
type = _ref6.type,
|
|
437
|
+
lingColor = _ref6.lingColor,
|
|
438
|
+
other = _objectWithoutProperties(_ref6, _excluded6);
|
|
439
|
+
return [_objectSpread({
|
|
440
|
+
type: 'bar',
|
|
441
|
+
barWidth: 20,
|
|
442
|
+
name: name,
|
|
443
|
+
data: data
|
|
444
|
+
}, other), {
|
|
445
|
+
name: name,
|
|
446
|
+
data: data,
|
|
447
|
+
type: 'pictorialBar',
|
|
448
|
+
barMaxWidth: 10,
|
|
449
|
+
symbol: 'diamond',
|
|
450
|
+
symbolOffset: [0, '50%'],
|
|
451
|
+
symbolSize: [20, 10],
|
|
452
|
+
itemStyle: {
|
|
453
|
+
color: getColor(lingColor || other.color)
|
|
454
|
+
},
|
|
455
|
+
silent: true,
|
|
456
|
+
// 图形是否不响应和触发鼠标事件,默认为 false,即响应和触发鼠标事件。
|
|
457
|
+
tooltip: {
|
|
458
|
+
show: false
|
|
459
|
+
},
|
|
460
|
+
legend: {
|
|
461
|
+
show: false
|
|
462
|
+
},
|
|
463
|
+
zlevel: 2
|
|
464
|
+
}, {
|
|
465
|
+
name: name,
|
|
466
|
+
data: data,
|
|
467
|
+
type: 'pictorialBar',
|
|
468
|
+
barMaxWidth: 10,
|
|
469
|
+
symbolPosition: 'end',
|
|
470
|
+
symbol: 'diamond',
|
|
471
|
+
symbolOffset: [0, '-50%'],
|
|
472
|
+
symbolSize: [20, 10],
|
|
473
|
+
itemStyle: {
|
|
474
|
+
color: getColor(lingColor || other.color)
|
|
475
|
+
},
|
|
476
|
+
silent: true,
|
|
477
|
+
// 图形是否不响应和触发鼠标事件,默认为 false,即响应和触发鼠标事件。
|
|
478
|
+
tooltip: {
|
|
479
|
+
show: false
|
|
480
|
+
},
|
|
481
|
+
legend: {
|
|
482
|
+
show: false
|
|
483
|
+
},
|
|
484
|
+
zlevel: 2
|
|
485
|
+
}];
|
|
486
|
+
};
|
|
487
|
+
var getNailBarSeries = function getNailBarSeries(_ref7) {
|
|
488
|
+
var type = _ref7.type,
|
|
489
|
+
color = _ref7.color,
|
|
490
|
+
barLabelConfig = _ref7.barLabelConfig,
|
|
491
|
+
other = _objectWithoutProperties(_ref7, _excluded7);
|
|
492
|
+
var _color = Array.isArray(color) ? color : [color, color];
|
|
493
|
+
return _objectSpread({
|
|
494
|
+
type: 'bar',
|
|
495
|
+
barWidth: 16,
|
|
496
|
+
label: _objectSpread({
|
|
497
|
+
show: true,
|
|
498
|
+
formatter: function formatter() {
|
|
499
|
+
return '';
|
|
500
|
+
},
|
|
501
|
+
position: 'top',
|
|
502
|
+
offset: [0, 4],
|
|
503
|
+
// 相对于数据点的偏移量,[水平偏移, 垂直偏移]
|
|
504
|
+
shadowColor: _color[0],
|
|
505
|
+
backgroundColor: _color[0],
|
|
506
|
+
shadowBlur: 10,
|
|
507
|
+
width: 20,
|
|
508
|
+
height: 4
|
|
509
|
+
}, barLabelConfig),
|
|
510
|
+
name: name,
|
|
511
|
+
color: color
|
|
512
|
+
}, other);
|
|
513
|
+
};
|
|
514
|
+
var getWordCloudSeries = function getWordCloudSeries(_ref8) {
|
|
515
|
+
var name = _ref8.name,
|
|
516
|
+
data = _ref8.data;
|
|
517
|
+
return [{
|
|
518
|
+
// name,
|
|
519
|
+
type: 'wordCloud',
|
|
520
|
+
//size: ['9%', '99%'],
|
|
521
|
+
sizeRange: [14, 50],
|
|
522
|
+
//textRotation: [0, 45, 90, -45],
|
|
523
|
+
rotationRange: [-45, 90],
|
|
524
|
+
shape: 'circle',
|
|
525
|
+
textPadding: 0,
|
|
526
|
+
width: '100%',
|
|
527
|
+
// 画布高
|
|
528
|
+
height: '100%',
|
|
529
|
+
autoSize: {
|
|
530
|
+
enable: true,
|
|
531
|
+
minSize: 6
|
|
532
|
+
},
|
|
533
|
+
textStyle: {
|
|
534
|
+
normal: {
|
|
535
|
+
color: function color() {
|
|
536
|
+
return "rgb(".concat(Math.round(Math.random() * 256), ",").concat(Math.round(Math.random() * 256), ",").concat(Math.round(Math.random() * 256), ")");
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
emphasis: {
|
|
540
|
+
shadowBlur: 2,
|
|
541
|
+
shadowColor: '#333'
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
data: data
|
|
545
|
+
}];
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* 获取 饼图 数据项
|
|
550
|
+
* @param name
|
|
551
|
+
* @param data
|
|
552
|
+
* @param other
|
|
553
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
554
|
+
*/
|
|
555
|
+
var getPieSeries = function getPieSeries(_ref9) {
|
|
556
|
+
var name = _ref9.name,
|
|
557
|
+
data = _ref9.data,
|
|
558
|
+
other = _objectWithoutProperties(_ref9, _excluded8);
|
|
559
|
+
return _objectSpread({
|
|
560
|
+
type: 'pie',
|
|
561
|
+
name: name,
|
|
562
|
+
data: data
|
|
563
|
+
}, other);
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* 获取 散点图 数据项
|
|
568
|
+
* @param name
|
|
569
|
+
* @param data
|
|
570
|
+
* @param other
|
|
571
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
572
|
+
*/
|
|
573
|
+
var getScatterSeries = function getScatterSeries(_ref10) {
|
|
574
|
+
var name = _ref10.name,
|
|
575
|
+
data = _ref10.data,
|
|
576
|
+
other = _objectWithoutProperties(_ref10, _excluded9);
|
|
577
|
+
return _objectSpread({
|
|
578
|
+
type: 'scatter',
|
|
579
|
+
name: name,
|
|
580
|
+
data: data
|
|
581
|
+
}, other);
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* 获取颜色
|
|
586
|
+
* @param color 参数可为:"#xxx", "['#xxx', '#xxx]"
|
|
587
|
+
* @returns {string|{x: number, y: number, y2: number, x2: number, global: boolean, colorStops: *[], type: string}}
|
|
588
|
+
*/
|
|
589
|
+
var getColor = function getColor(color) {
|
|
590
|
+
if (typeof color === 'string') {
|
|
591
|
+
return color;
|
|
592
|
+
} else if (Array.isArray(color)) {
|
|
593
|
+
var colorStops = [];
|
|
594
|
+
color.map(function (c, i) {
|
|
595
|
+
if (typeof c === 'string') {
|
|
596
|
+
colorStops.push({
|
|
597
|
+
offset: i,
|
|
598
|
+
color: color[i] // 0% 处的颜色
|
|
599
|
+
});
|
|
600
|
+
} else {
|
|
601
|
+
colorStops.push(_objectSpread({
|
|
602
|
+
offset: i,
|
|
603
|
+
color: c.color
|
|
604
|
+
}, c));
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
return {
|
|
608
|
+
type: 'linear',
|
|
609
|
+
x: 0,
|
|
610
|
+
y: 0,
|
|
611
|
+
x2: 0,
|
|
612
|
+
y2: 1,
|
|
613
|
+
colorStops: colorStops,
|
|
614
|
+
global: false // 缺省为 false
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* 获取区间渐变颜色
|
|
621
|
+
* @param color 参数可为:"#xxx", "['#xxx', '#xxx]"
|
|
622
|
+
* @returns {{color: {x: number, y: number, y2: number, globalCoord: boolean, x2: number, colorStops: [{offset: number, color: string},{offset: number, color: string}], type: string}}}
|
|
623
|
+
*/
|
|
624
|
+
exports.getColor = getColor;
|
|
625
|
+
var getAreaColor = function getAreaColor(color) {
|
|
626
|
+
var _ref11 = typeof color === 'string' ? [color, color] : color,
|
|
627
|
+
_ref12 = _slicedToArray(_ref11, 2),
|
|
628
|
+
start = _ref12[0],
|
|
629
|
+
end = _ref12[1];
|
|
630
|
+
return {
|
|
631
|
+
color: {
|
|
632
|
+
type: 'linear',
|
|
633
|
+
x: 0,
|
|
634
|
+
y: 0,
|
|
635
|
+
x2: 0,
|
|
636
|
+
y2: 1,
|
|
637
|
+
colorStops: [{
|
|
638
|
+
offset: 0,
|
|
639
|
+
color: start
|
|
640
|
+
} /*0% 处的颜色*/, {
|
|
641
|
+
offset: 1,
|
|
642
|
+
color: end
|
|
643
|
+
} /* 100% 处的颜色*/],
|
|
644
|
+
|
|
645
|
+
globalCoord: false // 缺省为 false
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* 获取数据
|
|
652
|
+
* @param series 参数:"{name, data, type, color, areaColor}"
|
|
653
|
+
* @returns {*[]}
|
|
654
|
+
*/
|
|
655
|
+
var getSeries = function getSeries(series) {
|
|
656
|
+
var _series = [];
|
|
657
|
+
var FUN_MAP = {
|
|
658
|
+
nailBar: getNailBarSeries,
|
|
659
|
+
// 钉子柱状图
|
|
660
|
+
bar: getBarSeries,
|
|
661
|
+
// 柱状图
|
|
662
|
+
lingBar: getLingBarSeries,
|
|
663
|
+
// 立体柱状图
|
|
664
|
+
line: getLineSeries,
|
|
665
|
+
// 折线图
|
|
666
|
+
pie: getPieSeries,
|
|
667
|
+
// 饼图
|
|
668
|
+
scatter: getScatterSeries,
|
|
669
|
+
//散点图
|
|
670
|
+
pictorialBar: getPictorialBar,
|
|
671
|
+
// 自定义样式的柱状图
|
|
672
|
+
wordCloud: getWordCloudSeries // 词云图
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
series.map(function (v) {
|
|
676
|
+
var type = v.type,
|
|
677
|
+
color = v.color,
|
|
678
|
+
areaColor = v.areaColor;
|
|
679
|
+
if (type === 'nailBar') {
|
|
680
|
+
color = color || ['rgba(88,139,240,0.6)', 'rgba(138,177,255,0.2)'];
|
|
681
|
+
}
|
|
682
|
+
var _seriesItem;
|
|
683
|
+
if (FUN_MAP[type]) {
|
|
684
|
+
_seriesItem = FUN_MAP[type](v);
|
|
685
|
+
} else {
|
|
686
|
+
//其他类型
|
|
687
|
+
_seriesItem = v;
|
|
688
|
+
}
|
|
689
|
+
// 自身颜色
|
|
690
|
+
if (color) {
|
|
691
|
+
if (Array.isArray(_seriesItem)) {
|
|
692
|
+
_seriesItem[0].itemStyle = _seriesItem[0].itemStyle || {};
|
|
693
|
+
_seriesItem[0].itemStyle.color = getColor(color);
|
|
694
|
+
} else {
|
|
695
|
+
_seriesItem.itemStyle = _seriesItem.itemStyle || {};
|
|
696
|
+
_seriesItem.itemStyle.color = getColor(color);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// 区间颜色
|
|
701
|
+
if (areaColor && areaColor.length) {
|
|
702
|
+
_seriesItem.areaStyle = getAreaColor(areaColor);
|
|
703
|
+
}
|
|
704
|
+
if (Array.isArray(_seriesItem)) {
|
|
705
|
+
_series.push.apply(_series, _toConsumableArray(_seriesItem));
|
|
706
|
+
} else {
|
|
707
|
+
_series.push(_seriesItem);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
return _series;
|
|
711
|
+
};
|
|
712
|
+
var getDataZoom = function getDataZoom(options) {
|
|
713
|
+
var _dataZoom = [];
|
|
714
|
+
if (options !== null && options !== void 0 && options.show) {
|
|
715
|
+
_dataZoom = options !== null && options !== void 0 && options.otherDataZoom ? options.otherDataZoom : [{
|
|
716
|
+
type: 'slider',
|
|
717
|
+
filterMode: 'none',
|
|
718
|
+
height: 10,
|
|
719
|
+
textStyle: {
|
|
720
|
+
opacity: 0
|
|
721
|
+
},
|
|
722
|
+
startValue: 0,
|
|
723
|
+
// 开始的值
|
|
724
|
+
endValue: 100,
|
|
725
|
+
// 结束的值
|
|
726
|
+
bottom: 10
|
|
727
|
+
}, {
|
|
728
|
+
type: 'inside',
|
|
729
|
+
filterMode: 'none',
|
|
730
|
+
height: 10,
|
|
731
|
+
textStyle: {
|
|
732
|
+
opacity: 0
|
|
733
|
+
}
|
|
734
|
+
}];
|
|
735
|
+
}
|
|
736
|
+
return _dataZoom;
|
|
737
|
+
};
|
|
738
|
+
var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
739
|
+
var _option$series, _option$series$, _option$series$$data;
|
|
740
|
+
var _mergeConfigAndData = mergeConfigAndData(props || {}),
|
|
741
|
+
data = _mergeConfigAndData.data,
|
|
742
|
+
onEvents = _mergeConfigAndData.onEvents,
|
|
743
|
+
color = _mergeConfigAndData.color,
|
|
744
|
+
legend = _mergeConfigAndData.legend,
|
|
745
|
+
_mergeConfigAndData$u = _mergeConfigAndData.unit,
|
|
746
|
+
unit = _mergeConfigAndData$u === void 0 ? '' : _mergeConfigAndData$u,
|
|
747
|
+
tooltip = _mergeConfigAndData.tooltip,
|
|
748
|
+
grid = _mergeConfigAndData.grid,
|
|
749
|
+
xAxis = _mergeConfigAndData.xAxis,
|
|
750
|
+
yAxis = _mergeConfigAndData.yAxis,
|
|
751
|
+
_mergeConfigAndData$h = _mergeConfigAndData.height,
|
|
752
|
+
height = _mergeConfigAndData$h === void 0 ? '100%' : _mergeConfigAndData$h,
|
|
753
|
+
series = _mergeConfigAndData.series,
|
|
754
|
+
_mergeConfigAndData$l = _mergeConfigAndData.loading,
|
|
755
|
+
loading = _mergeConfigAndData$l === void 0 ? false : _mergeConfigAndData$l,
|
|
756
|
+
title = _mergeConfigAndData.title,
|
|
757
|
+
dataZoom = _mergeConfigAndData.dataZoom,
|
|
758
|
+
noDataText = _mergeConfigAndData.noDataText,
|
|
759
|
+
_mergeConfigAndData$s = _mergeConfigAndData.style,
|
|
760
|
+
style = _mergeConfigAndData$s === void 0 ? {} : _mergeConfigAndData$s,
|
|
761
|
+
_mergeConfigAndData$i = _mergeConfigAndData.imgStyle,
|
|
762
|
+
imgStyle = _mergeConfigAndData$i === void 0 ? {} : _mergeConfigAndData$i,
|
|
763
|
+
_mergeConfigAndData$n = _mergeConfigAndData.noDataStyle,
|
|
764
|
+
noDataStyle = _mergeConfigAndData$n === void 0 ? {} : _mergeConfigAndData$n,
|
|
765
|
+
other = _objectWithoutProperties(_mergeConfigAndData, _excluded10);
|
|
766
|
+
var option = _objectSpread({
|
|
767
|
+
title: title,
|
|
768
|
+
legend: getLegend(legend),
|
|
769
|
+
tooltip: getTooltip(tooltip, unit || (typeof yAxis === 'string' ? yAxis : ''), series),
|
|
770
|
+
grid: getGrid(grid, dataZoom),
|
|
771
|
+
xAxis: getXAxis(xAxis),
|
|
772
|
+
yAxis: getYAxis(yAxis),
|
|
773
|
+
series: getSeries(series),
|
|
774
|
+
dataZoom: getDataZoom(dataZoom)
|
|
775
|
+
}, other);
|
|
776
|
+
if (color) {
|
|
777
|
+
option.color = color;
|
|
778
|
+
}
|
|
779
|
+
var chartRef = (0, _react.useRef)({});
|
|
780
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
781
|
+
return _objectSpread({}, chartRef.current);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
// 解决 echarts 点击空白地方不生效的问题
|
|
785
|
+
var onClick = function onClick(e) {
|
|
786
|
+
if (onEvents !== null && onEvents !== void 0 && onEvents.onClick) {
|
|
787
|
+
var _chartRef$current, _chartRef$current$get;
|
|
788
|
+
var chart = (_chartRef$current = chartRef.current) === null || _chartRef$current === void 0 ? void 0 : (_chartRef$current$get = _chartRef$current.getEchartsInstance) === null || _chartRef$current$get === void 0 ? void 0 : _chartRef$current$get.call(_chartRef$current);
|
|
789
|
+
if (chart) {
|
|
790
|
+
var rect = chart.getDom().getBoundingClientRect();
|
|
791
|
+
var x = e.clientX - rect.left;
|
|
792
|
+
var y = e.clientY - rect.top;
|
|
793
|
+
var pointInPixel = [x, y];
|
|
794
|
+
if (chart.containPixel('grid', pointInPixel)) {
|
|
795
|
+
var xIndex = chart.convertFromPixel({
|
|
796
|
+
seriesIndex: 0
|
|
797
|
+
}, [x, y])[0];
|
|
798
|
+
onEvents === null || onEvents === void 0 ? void 0 : onEvents.onClick(xIndex);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
804
|
+
onClick: onClick,
|
|
805
|
+
style: _objectSpread({
|
|
806
|
+
height: height,
|
|
807
|
+
width: '100%'
|
|
808
|
+
}, style)
|
|
809
|
+
}, (_option$series = option.series) !== null && _option$series !== void 0 && (_option$series$ = _option$series[0]) !== null && _option$series$ !== void 0 && (_option$series$$data = _option$series$.data) !== null && _option$series$$data !== void 0 && _option$series$$data.length ? /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
|
|
810
|
+
ref: chartRef,
|
|
811
|
+
option: option,
|
|
812
|
+
notMerge: true,
|
|
813
|
+
lazyUpdate: true,
|
|
814
|
+
style: {
|
|
815
|
+
height: height || '100%'
|
|
816
|
+
},
|
|
817
|
+
onEvents: onEvents
|
|
818
|
+
}) : /*#__PURE__*/_react["default"].createElement(_antd.Empty, {
|
|
819
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
820
|
+
}));
|
|
821
|
+
}), function (prevProps, nextProps) {
|
|
822
|
+
// 这个函数用于比较前后两个props是否相同
|
|
823
|
+
// 如果相同,则不会重新渲染
|
|
824
|
+
return JSON.stringify(prevProps) === JSON.stringify(nextProps);
|
|
825
|
+
});
|
|
826
|
+
var _default = Chart;
|
|
827
|
+
exports["default"] = _default;
|
|
828
|
+
//# sourceMappingURL=index.js.map
|