@vtx/ol-map 1.0.120 → 1.0.122
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/CHANGELOG.md +217 -0
- package/README.md +205 -205
- package/lib/_util/EventEmitter.js +3 -2
- package/lib/_util/EventEmitter.js.map +1 -1
- package/lib/_util/StyleCache.js +3 -2
- package/lib/_util/StyleCache.js.map +1 -1
- package/lib/_util/encryptParams.js +3 -2
- package/lib/_util/encryptParams.js.map +1 -1
- package/lib/_util/filterSpecialCharacters.js +6 -6
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +1 -1
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getCookie.js +6 -5
- package/lib/_util/getCookie.js.map +1 -1
- package/lib/_util/getDefaultMapInfo.js +5 -4
- package/lib/_util/getDefaultMapInfo.js.map +1 -1
- package/lib/_util/getSystemInfo.js +5 -4
- package/lib/_util/getSystemInfo.js.map +1 -1
- package/lib/_util/getToken.js +4 -2
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +2 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/http.js +23 -22
- package/lib/_util/http.js.map +1 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/layer.js +33 -29
- package/lib/_util/layer.js.map +1 -1
- package/lib/_util/mapTool.js +37 -36
- package/lib/_util/mapTool.js.map +1 -1
- package/lib/_util/projzh/datum/bd-09.js +2 -1
- package/lib/_util/projzh/datum/bd-09.js.map +1 -1
- package/lib/_util/projzh/datum/gcj-02.js +2 -1
- package/lib/_util/projzh/datum/gcj-02.js.map +1 -1
- package/lib/_util/projzh/datum/index.js +2 -1
- package/lib/_util/projzh/datum/index.js.map +1 -1
- package/lib/_util/projzh/index.js +2 -1
- package/lib/_util/projzh/index.js.map +1 -1
- package/lib/_util/projzh/projection/baidu-mercator.js +2 -1
- package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -1
- package/lib/_util/projzh/projection/index.js +2 -1
- package/lib/_util/projzh/projection/index.js.map +1 -1
- package/lib/_util/projzh/projection/spherical-mercator.js +2 -1
- package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -1
- package/lib/_util/projzh/util.js +2 -1
- package/lib/_util/projzh/util.js.map +1 -1
- package/lib/_util/search.js +10 -7
- package/lib/_util/search.js.map +1 -1
- package/lib/_util/setCookie.js +6 -5
- package/lib/_util/setCookie.js.map +1 -1
- package/lib/_util/stringToFun.js +1 -1
- package/lib/_util/stringToFun.js.map +1 -1
- package/lib/_util/transform.js +5 -4
- package/lib/_util/transform.js.map +1 -1
- package/lib/_util/useColSize.js +2 -1
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +6 -5
- package/lib/_util/useSet.js.map +1 -1
- package/lib/analysis-layer/index.js +36 -31
- package/lib/analysis-layer/index.js.map +1 -1
- package/lib/buffer-draw/BufferDraw.js +5 -4
- package/lib/buffer-draw/BufferDraw.js.map +1 -1
- package/lib/buffer-draw/index.js +8 -8
- package/lib/buffer-draw/index.js.map +1 -1
- package/lib/circle/Circle.js +5 -4
- package/lib/circle/Circle.js.map +1 -1
- package/lib/circle/index.js +3 -3
- package/lib/circle/index.js.map +1 -1
- package/lib/config.js +2 -1
- package/lib/config.js.map +1 -1
- package/lib/convertCamelToCSS.js +2 -1
- package/lib/convertCamelToCSS.js.map +1 -1
- package/lib/dom/Dom.js +3 -2
- package/lib/dom/Dom.js.map +1 -1
- package/lib/dom/index.js +5 -5
- package/lib/dom/index.js.map +1 -1
- package/lib/events/index.js +4 -2
- package/lib/events/index.js.map +1 -1
- package/lib/feature-draw/FeatureDraw.js +11 -9
- package/lib/feature-draw/FeatureDraw.js.map +1 -1
- package/lib/feature-draw/index.js +7 -7
- package/lib/feature-draw/index.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js +11 -10
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/MyCluster.js +13 -12
- package/lib/feature-layer/MyCluster.js.map +1 -1
- package/lib/feature-layer/createFeatureCollection.js +35 -27
- package/lib/feature-layer/createFeatureCollection.js.map +1 -1
- package/lib/feature-layer/index.js +6 -6
- package/lib/feature-layer/index.js.map +1 -1
- package/lib/feature-layer/style/css.js.map +1 -1
- package/lib/feature-layer/style/index.js.map +1 -1
- package/lib/flow-line-layer/FlowLineLayer.js +5 -4
- package/lib/flow-line-layer/FlowLineLayer.js.map +1 -1
- package/lib/flow-line-layer/index.js +6 -6
- package/lib/flow-line-layer/index.js.map +1 -1
- package/lib/flow-line-layer/style/css.js.map +1 -1
- package/lib/flow-line-layer/style/index.js.map +1 -1
- package/lib/fly-line-layer/FlyLineLayer.js +5 -4
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/index.js +4 -4
- package/lib/fly-line-layer/index.js.map +1 -1
- package/lib/fly-line-layer/style/css.js.map +1 -1
- package/lib/fly-line-layer/style/index.js.map +1 -1
- package/lib/group-layer/GroupLayer.js +3 -2
- package/lib/group-layer/GroupLayer.js.map +1 -1
- package/lib/group-layer/index.js +4 -4
- package/lib/group-layer/index.js.map +1 -1
- package/lib/group-layer/style/css.js.map +1 -1
- package/lib/group-layer/style/index.js.map +1 -1
- package/lib/heatmap-layer/HeatmapLayer.js +5 -4
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/index.js +4 -4
- package/lib/heatmap-layer/index.js.map +1 -1
- package/lib/heatmap-layer/style/css.js.map +1 -1
- package/lib/heatmap-layer/style/index.js.map +1 -1
- package/lib/high-layer/HighLayer.js +7 -6
- package/lib/high-layer/HighLayer.js.map +1 -1
- package/lib/high-layer/index.js +7 -6
- package/lib/high-layer/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +7 -5
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/index.js +5 -5
- package/lib/image-layer/index.js.map +1 -1
- package/lib/image-layer/style/css.js.map +1 -1
- package/lib/image-layer/style/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legend/index.js +10 -8
- package/lib/legend/index.js.map +1 -1
- package/lib/legend/style/css.js.map +1 -1
- package/lib/legend/style/index.js.map +1 -1
- package/lib/legend/style/index.less +73 -73
- package/lib/map/Analysis.js +3 -2
- package/lib/map/Analysis.js.map +1 -1
- package/lib/map/Layers.js +4 -3
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js +13 -12
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +2 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +2 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +5 -3
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +5 -3
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/index.js +7 -5
- package/lib/map/getBaseLayers/index.js.map +1 -1
- package/lib/map/index.js +25 -24
- package/lib/map/index.js.map +1 -1
- package/lib/map/style/css.js.map +1 -1
- package/lib/map/style/index.js.map +1 -1
- package/lib/map/style/index.less +152 -152
- package/lib/map-icon/svg/index.js +2 -1
- package/lib/map-icon/svg/index.js.map +1 -1
- package/lib/marker/Marker.js +7 -5
- package/lib/marker/Marker.js.map +1 -1
- package/lib/marker/index.js +3 -3
- package/lib/marker/index.js.map +1 -1
- package/lib/path-line-layer/PathLineLayer.js +5 -4
- package/lib/path-line-layer/PathLineLayer.js.map +1 -1
- package/lib/path-line-layer/getPathLineStyles.js +5 -4
- package/lib/path-line-layer/getPathLineStyles.js.map +1 -1
- package/lib/path-line-layer/index.js +6 -6
- package/lib/path-line-layer/index.js.map +1 -1
- package/lib/path-line-layer/style/css.js.map +1 -1
- package/lib/path-line-layer/style/index.js.map +1 -1
- package/lib/path-play-back/PathPlayBack.js +7 -6
- package/lib/path-play-back/PathPlayBack.js.map +1 -1
- package/lib/path-play-back/index.js +5 -4
- package/lib/path-play-back/index.js.map +1 -1
- package/lib/poi-search/Location.js +4 -4
- package/lib/poi-search/Location.js.map +1 -1
- package/lib/poi-search/PoiList.js +4 -4
- package/lib/poi-search/PoiList.js.map +1 -1
- package/lib/poi-search/Search.js +9 -9
- package/lib/poi-search/Search.js.map +1 -1
- package/lib/poi-search/index.js +6 -5
- package/lib/poi-search/index.js.map +1 -1
- package/lib/poi-search/style/css.js.map +1 -1
- package/lib/poi-search/style/index.js.map +1 -1
- package/lib/poi-search/style/index.less +97 -97
- package/lib/point/Point.js +5 -4
- package/lib/point/Point.js.map +1 -1
- package/lib/point/index.js +3 -3
- package/lib/point/index.js.map +1 -1
- package/lib/polygon/Polygon.js +5 -4
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polygon/index.js +3 -3
- package/lib/polygon/index.js.map +1 -1
- package/lib/polyline/Polyline.js +5 -4
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/polyline/index.js +3 -3
- package/lib/polyline/index.js.map +1 -1
- package/lib/popup/index.js +7 -6
- package/lib/popup/index.js.map +1 -1
- package/lib/popup/style/css.js.map +1 -1
- package/lib/popup/style/index.css +9 -8
- package/lib/popup/style/index.js.map +1 -1
- package/lib/popup/style/index.less +129 -128
- package/lib/provider/index.js +4 -2
- package/lib/provider/index.js.map +1 -1
- package/lib/renderer/Fill.js +3 -2
- package/lib/renderer/Fill.js.map +1 -1
- package/lib/renderer/Stroke.js +3 -2
- package/lib/renderer/Stroke.js.map +1 -1
- package/lib/renderer/index.js +9 -7
- package/lib/renderer/index.js.map +1 -1
- package/lib/renderer/style/css.js.map +1 -1
- package/lib/renderer/style/index.js.map +1 -1
- package/lib/renderer/transformRgb.js +2 -1
- package/lib/renderer/transformRgb.js.map +1 -1
- package/lib/search-map/VtxModal.js +5 -4
- package/lib/search-map/VtxModal.js.map +1 -1
- package/lib/search-map/index.js +6 -5
- package/lib/search-map/index.js.map +1 -1
- package/lib/search-map/style/css.js.map +1 -1
- package/lib/search-map/style/index.js.map +1 -1
- package/lib/search-map/style/index.less +71 -71
- package/lib/search-map/style/modal.less +58 -58
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/tile-layer/TileLayer.js +5 -4
- package/lib/tile-layer/TileLayer.js.map +1 -1
- package/lib/tile-layer/index.js +3 -3
- package/lib/tile-layer/index.js.map +1 -1
- package/lib/tile-layer/style/css.js.map +1 -1
- package/lib/tile-layer/style/index.js.map +1 -1
- package/lib/tools/Layer/LayerService.js +5 -4
- package/lib/tools/Layer/LayerService.js.map +1 -1
- package/lib/tools/Layer/LayersCheckService.js +15 -9
- package/lib/tools/Layer/LayersCheckService.js.map +1 -1
- package/lib/tools/Layer/index.js +6 -6
- package/lib/tools/Layer/index.js.map +1 -1
- package/lib/tools/Layer/index.less +43 -43
- package/lib/tools/Search/index.js +16 -15
- package/lib/tools/Search/index.js.map +1 -1
- package/lib/tools/Toolbox/BoxSelect/index.js +4 -3
- package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/CircleSelect/index.js +4 -3
- package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/EagleEye/index.js +6 -5
- package/lib/tools/Toolbox/EagleEye/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js +8 -7
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.js +16 -15
- package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.less +20 -20
- package/lib/tools/Toolbox/MapDownload/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.js +10 -10
- package/lib/tools/Toolbox/MapPrint/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.less +4 -4
- package/lib/tools/Toolbox/Measure/Area/index.js +2 -1
- package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js +2 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Measure.js +3 -2
- package/lib/tools/Toolbox/Measure/Measure.js.map +1 -1
- package/lib/tools/Toolbox/Measure/index.js +6 -5
- package/lib/tools/Toolbox/Measure/index.js.map +1 -1
- package/lib/tools/Toolbox/PolygonSelect/index.js +4 -3
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/ScaleLine/index.js +6 -5
- package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.js +34 -33
- package/lib/tools/Toolbox/SelectTools/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.less +87 -87
- package/lib/tools/Toolbox/SpaceQuery/index.js +5 -5
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -1
- package/lib/tools/Toolbox/SpaceQuery/index.less +16 -16
- package/lib/tools/Toolbox/ZoomInput/index.js +6 -5
- package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -1
- package/lib/tools/Toolbox/ZoomInput/index.less +5 -5
- package/lib/tools/Toolbox/index.js +9 -7
- package/lib/tools/Toolbox/index.js.map +1 -1
- package/lib/tools/Toolbox/index.less +2 -2
- package/lib/tools/Utils/CreateOverlay.js +5 -4
- package/lib/tools/Utils/CreateOverlay.js.map +1 -1
- package/lib/tools/Utils/Draw.js +11 -9
- package/lib/tools/Utils/Draw.js.map +1 -1
- package/lib/tools/Utils/HighLayer.js +7 -6
- package/lib/tools/Utils/HighLayer.js.map +1 -1
- package/lib/tools/Utils/measure.js +2 -1
- package/lib/tools/Utils/measure.js.map +1 -1
- package/lib/tools/Utils/utils.js +35 -27
- package/lib/tools/Utils/utils.js.map +1 -1
- package/lib/tools/View/index.js +8 -7
- package/lib/tools/View/index.js.map +1 -1
- package/lib/tools/View/index.less +28 -28
- package/lib/tools/analysis-tool/index.js +10 -9
- package/lib/tools/analysis-tool/index.js.map +1 -1
- package/lib/tools/base-map-switch/index.js +8 -8
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/components/Chart/index.js +114 -106
- package/lib/tools/components/Chart/index.js.map +1 -1
- package/lib/tools/components/Icon/index.js +2 -1
- package/lib/tools/components/Icon/index.js.map +1 -1
- package/lib/tools/components/Info/index.js +2 -1
- package/lib/tools/components/Info/index.js.map +1 -1
- package/lib/tools/components/Info/index.less +26 -26
- package/lib/tools/components/ItemWrap/index.js +6 -5
- package/lib/tools/components/ItemWrap/index.js.map +1 -1
- package/lib/tools/components/ItemWrap/index.less +41 -41
- package/lib/tools/components/Modal/index.js +7 -6
- package/lib/tools/components/Modal/index.js.map +1 -1
- package/lib/tools/components/Modal/index.less +33 -33
- package/lib/tools/components/MyTabs/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.js +3 -3
- package/lib/tools/components/RequiredLabel/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.less +5 -5
- package/lib/tools/components/Select/index.js +2 -1
- package/lib/tools/components/Select/index.js.map +1 -1
- package/lib/tools/components/Table/index.js +7 -6
- package/lib/tools/components/Table/index.js.map +1 -1
- package/lib/tools/components/Table/index.less +13 -13
- package/lib/tools/components/ToolItem/index.js +2 -1
- package/lib/tools/components/ToolItem/index.js.map +1 -1
- package/lib/tools/components/ToolItem/index.less +27 -27
- package/lib/tools/components/ToolsSelect/index.js +2 -1
- package/lib/tools/components/ToolsSelect/index.js.map +1 -1
- package/lib/tools/components/ToolsSelect/index.less +10 -10
- package/lib/tools/full-screen/index.js +6 -5
- package/lib/tools/full-screen/index.js.map +1 -1
- package/lib/tools/index.js +5 -5
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/layer-control/index.js +12 -9
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/refresh/index.js +7 -6
- package/lib/tools/refresh/index.js.map +1 -1
- package/lib/tools/style/css.js.map +1 -1
- package/lib/tools/style/index.js.map +1 -1
- package/lib/tools/style/index.less +154 -154
- package/lib/tools-item/index.js +6 -5
- package/lib/tools-item/index.js.map +1 -1
- package/lib/use-props/index.js +2 -1
- package/lib/use-props/index.js.map +1 -1
- package/package.json +119 -119
|
@@ -18,17 +18,17 @@ var _excluded = ["data"],
|
|
|
18
18
|
_excluded9 = ["name", "data"],
|
|
19
19
|
_excluded10 = ["data", "onEvents", "color", "legend", "unit", "tooltip", "grid", "xAxis", "yAxis", "height", "series", "loading", "title", "dataZoom", "noDataText", "style", "imgStyle", "noDataStyle"];
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
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
23
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
24
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
25
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
26
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
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
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(
|
|
30
|
-
function ownKeys(
|
|
31
|
-
function _objectSpread(
|
|
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
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
33
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
34
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); }
|
|
@@ -36,18 +36,18 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
36
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
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
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(
|
|
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
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
41
|
var color = '#86909C';
|
|
42
42
|
var fontSize = '12px';
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* 小数处理,默认2位
|
|
46
|
-
* @param value
|
|
47
|
-
* @param len
|
|
48
|
-
* @returns {number|*}
|
|
44
|
+
/**
|
|
45
|
+
* 小数处理,默认2位
|
|
46
|
+
* @param value
|
|
47
|
+
* @param len
|
|
48
|
+
* @returns {number|*}
|
|
49
49
|
*/
|
|
50
|
-
var convertDecimal =
|
|
50
|
+
var convertDecimal = function convertDecimal(value) {
|
|
51
51
|
var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
52
52
|
if (value && String(value).indexOf('.') !== -1) {
|
|
53
53
|
var _String$split = String(value).split('.'),
|
|
@@ -62,12 +62,13 @@ var convertDecimal = exports.convertDecimal = function convertDecimal(value) {
|
|
|
62
62
|
return value;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
/**
|
|
66
|
-
* 转换饼图数据,处理占比截取为默认2位小数
|
|
67
|
-
* @param data
|
|
68
|
-
* @returns {*[]}
|
|
65
|
+
/**
|
|
66
|
+
* 转换饼图数据,处理占比截取为默认2位小数
|
|
67
|
+
* @param data
|
|
68
|
+
* @returns {*[]}
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
exports.convertDecimal = convertDecimal;
|
|
71
|
+
var convertPieData = function convertPieData(data) {
|
|
71
72
|
var _data2;
|
|
72
73
|
var _data = [];
|
|
73
74
|
if ((_data2 = data) !== null && _data2 !== void 0 && _data2.length) {
|
|
@@ -92,13 +93,14 @@ var convertPieData = exports.convertPieData = function convertPieData(data) {
|
|
|
92
93
|
return _data;
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
/**
|
|
96
|
-
* 合并 xAxis 配置及数据
|
|
97
|
-
* @param xAxis
|
|
98
|
-
* @param data
|
|
99
|
-
* @returns {*&{data: *[]}}
|
|
96
|
+
/**
|
|
97
|
+
* 合并 xAxis 配置及数据
|
|
98
|
+
* @param xAxis
|
|
99
|
+
* @param data
|
|
100
|
+
* @returns {*&{data: *[]}}
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
exports.convertPieData = convertPieData;
|
|
103
|
+
var mergeXAxisAndData = function mergeXAxisAndData(xAxis, data) {
|
|
102
104
|
var times = [];
|
|
103
105
|
if (data !== null && data !== void 0 && data.length) {
|
|
104
106
|
var field = xAxis.field,
|
|
@@ -114,20 +116,22 @@ var mergeXAxisAndData = exports.mergeXAxisAndData = function mergeXAxisAndData(x
|
|
|
114
116
|
data: times
|
|
115
117
|
}, xAxis);
|
|
116
118
|
};
|
|
117
|
-
|
|
119
|
+
exports.mergeXAxisAndData = mergeXAxisAndData;
|
|
120
|
+
var numberTo = function numberTo(data, number, limit) {
|
|
118
121
|
if (number) {
|
|
119
122
|
return (Number(data) / number).toFixed(limit || 2);
|
|
120
123
|
}
|
|
121
124
|
return data;
|
|
122
125
|
};
|
|
123
126
|
|
|
124
|
-
/**
|
|
125
|
-
* 合并 series 和数据
|
|
126
|
-
* @param series
|
|
127
|
-
* @param data
|
|
128
|
-
* @returns {*[]}
|
|
127
|
+
/**
|
|
128
|
+
* 合并 series 和数据
|
|
129
|
+
* @param series
|
|
130
|
+
* @param data
|
|
131
|
+
* @returns {*[]}
|
|
129
132
|
*/
|
|
130
|
-
|
|
133
|
+
exports.numberTo = numberTo;
|
|
134
|
+
var mergeSeriesAndData = function mergeSeriesAndData(series, data) {
|
|
131
135
|
var _series = [];
|
|
132
136
|
series.map(function (s) {
|
|
133
137
|
var seriesItem = _objectSpread({}, s);
|
|
@@ -142,12 +146,13 @@ var mergeSeriesAndData = exports.mergeSeriesAndData = function mergeSeriesAndDat
|
|
|
142
146
|
return _series;
|
|
143
147
|
};
|
|
144
148
|
|
|
145
|
-
/**
|
|
146
|
-
* 合并配置和数据
|
|
147
|
-
* @param options
|
|
148
|
-
* @returns {{}}
|
|
149
|
+
/**
|
|
150
|
+
* 合并配置和数据
|
|
151
|
+
* @param options
|
|
152
|
+
* @returns {{}}
|
|
149
153
|
*/
|
|
150
|
-
|
|
154
|
+
exports.mergeSeriesAndData = mergeSeriesAndData;
|
|
155
|
+
var mergeConfigAndData = function mergeConfigAndData(options) {
|
|
151
156
|
var xAxis = options.xAxis,
|
|
152
157
|
yAxis = options.yAxis,
|
|
153
158
|
series = options.series,
|
|
@@ -167,6 +172,7 @@ var mergeConfigAndData = exports.mergeConfigAndData = function mergeConfigAndDat
|
|
|
167
172
|
}
|
|
168
173
|
return _objectSpread(_objectSpread({}, options), val);
|
|
169
174
|
};
|
|
175
|
+
exports.mergeConfigAndData = mergeConfigAndData;
|
|
170
176
|
var getUnit = function getUnit(units, name) {
|
|
171
177
|
if (units && _typeof(units) === 'object') {
|
|
172
178
|
if (Array.isArray(units)) {
|
|
@@ -180,10 +186,10 @@ var getUnit = function getUnit(units, name) {
|
|
|
180
186
|
}
|
|
181
187
|
return units || '';
|
|
182
188
|
};
|
|
183
|
-
/**
|
|
184
|
-
* 获取 tooltip
|
|
185
|
-
* @param options
|
|
186
|
-
* @returns {*&{trigger: string}}
|
|
189
|
+
/**
|
|
190
|
+
* 获取 tooltip
|
|
191
|
+
* @param options
|
|
192
|
+
* @returns {*&{trigger: string}}
|
|
187
193
|
*/
|
|
188
194
|
var getTooltip = function getTooltip(options, unit, series) {
|
|
189
195
|
var _series$;
|
|
@@ -208,10 +214,10 @@ var getTooltip = function getTooltip(options, unit, series) {
|
|
|
208
214
|
}, options);
|
|
209
215
|
};
|
|
210
216
|
|
|
211
|
-
/**
|
|
212
|
-
* 获取 图例
|
|
213
|
-
* @param options
|
|
214
|
-
* @returns {*&{pageTextStyle: {color: string}, textStyle: {color: string}, type: string, pageIconInactiveColor: string, pageIconColor: string}}
|
|
217
|
+
/**
|
|
218
|
+
* 获取 图例
|
|
219
|
+
* @param options
|
|
220
|
+
* @returns {*&{pageTextStyle: {color: string}, textStyle: {color: string}, type: string, pageIconInactiveColor: string, pageIconColor: string}}
|
|
215
221
|
*/
|
|
216
222
|
var getLegend = function getLegend(options) {
|
|
217
223
|
return _objectSpread({
|
|
@@ -221,11 +227,11 @@ var getLegend = function getLegend(options) {
|
|
|
221
227
|
}, options);
|
|
222
228
|
};
|
|
223
229
|
|
|
224
|
-
/**
|
|
225
|
-
* 获取布局
|
|
226
|
-
* @param grid
|
|
227
|
-
* @param dataZoom
|
|
228
|
-
* @returns {*&{top: string, left: number, bottom: string, right: number, containLabel: boolean}}
|
|
230
|
+
/**
|
|
231
|
+
* 获取布局
|
|
232
|
+
* @param grid
|
|
233
|
+
* @param dataZoom
|
|
234
|
+
* @returns {*&{top: string, left: number, bottom: string, right: number, containLabel: boolean}}
|
|
229
235
|
*/
|
|
230
236
|
var getGrid = function getGrid(grid, dataZoom) {
|
|
231
237
|
return _objectSpread({
|
|
@@ -237,10 +243,10 @@ var getGrid = function getGrid(grid, dataZoom) {
|
|
|
237
243
|
}, grid);
|
|
238
244
|
};
|
|
239
245
|
|
|
240
|
-
/**
|
|
241
|
-
* 获取 xAxis 单项
|
|
242
|
-
* @param options 参数可以是: "[xx, xx]"、"{data: [xx, xx], ...}"
|
|
243
|
-
* @returns {{axisLabel: {textStyle: {color: string}}, data: *, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, type: string, boundaryGap: boolean}}
|
|
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}}
|
|
244
250
|
*/
|
|
245
251
|
var getXAxisItem = function getXAxisItem(options) {
|
|
246
252
|
var _ref = Array.isArray(options) ? {
|
|
@@ -273,10 +279,10 @@ var getXAxisItem = function getXAxisItem(options) {
|
|
|
273
279
|
}, other);
|
|
274
280
|
};
|
|
275
281
|
|
|
276
|
-
/**
|
|
277
|
-
* 获取 xAxis 配置
|
|
278
|
-
* @param xAxis 参数说明:"[xx, xx]"、"[[xx, xx], [xx, xx]]"、"[{data: [xx, xx], ...}]"
|
|
279
|
-
* @returns {(*&{axisLabel: {textStyle: {color: string}}, data, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, type: string, boundaryGap: boolean})|*[]}
|
|
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})|*[]}
|
|
280
286
|
*/
|
|
281
287
|
var getXAxis = function getXAxis(xAxis) {
|
|
282
288
|
if (xAxis) {
|
|
@@ -294,10 +300,10 @@ var getXAxis = function getXAxis(xAxis) {
|
|
|
294
300
|
};
|
|
295
301
|
};
|
|
296
302
|
|
|
297
|
-
/**
|
|
298
|
-
* 获取单个 yAxis 配置
|
|
299
|
-
* @param options 参数可以是:"xx"、"{name: 'xx', ...其他配置}"
|
|
300
|
-
* @returns {{axisLabel: {textStyle: {color: string}, showMaxLabel: boolean}, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, splitLine: {show: boolean}, nameTextStyle: {color: string}}}
|
|
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}}}
|
|
301
307
|
*/
|
|
302
308
|
var getYAxisItem = function getYAxisItem(options) {
|
|
303
309
|
options = options || {};
|
|
@@ -340,10 +346,10 @@ var getYAxisItem = function getYAxisItem(options) {
|
|
|
340
346
|
}, other);
|
|
341
347
|
};
|
|
342
348
|
|
|
343
|
-
/**
|
|
344
|
-
* 获取 yAxis 配置
|
|
345
|
-
* @param yAxis 参数可以是: "xx"、"['xx', 'xxx']"、"[{name: 'xx', ...其他配置}]"
|
|
346
|
-
* @returns {{axisLabel: {textStyle: {color: string}, showMaxLabel: boolean}, axisLine: {lineStyle: {color: string}}, axisTick: {show: boolean}, splitLine: {show: boolean}, nameTextStyle: {color: string}}|*[]}
|
|
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}}|*[]}
|
|
347
353
|
*/
|
|
348
354
|
var getYAxis = function getYAxis(yAxis) {
|
|
349
355
|
if (yAxis) {
|
|
@@ -368,12 +374,12 @@ var getYAxis = function getYAxis(yAxis) {
|
|
|
368
374
|
};
|
|
369
375
|
};
|
|
370
376
|
|
|
371
|
-
/**
|
|
372
|
-
* 获取 折线图 数据项
|
|
373
|
-
* @param name
|
|
374
|
-
* @param data
|
|
375
|
-
* @param other
|
|
376
|
-
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
377
|
+
/**
|
|
378
|
+
* 获取 折线图 数据项
|
|
379
|
+
* @param name
|
|
380
|
+
* @param data
|
|
381
|
+
* @param other
|
|
382
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
377
383
|
*/
|
|
378
384
|
var getLineSeries = function getLineSeries(_ref3) {
|
|
379
385
|
var name = _ref3.name,
|
|
@@ -390,12 +396,12 @@ var getLineSeries = function getLineSeries(_ref3) {
|
|
|
390
396
|
}, other);
|
|
391
397
|
};
|
|
392
398
|
|
|
393
|
-
/**
|
|
394
|
-
* 获取 柱状图 数据项
|
|
395
|
-
* @param name
|
|
396
|
-
* @param data
|
|
397
|
-
* @param other
|
|
398
|
-
* @returns {*&{barMaxWidth: number, connectNulls: boolean, data, barMinWidth: number, name, type: string}}
|
|
399
|
+
/**
|
|
400
|
+
* 获取 柱状图 数据项
|
|
401
|
+
* @param name
|
|
402
|
+
* @param data
|
|
403
|
+
* @param other
|
|
404
|
+
* @returns {*&{barMaxWidth: number, connectNulls: boolean, data, barMinWidth: number, name, type: string}}
|
|
399
405
|
*/
|
|
400
406
|
var getBarSeries = function getBarSeries(_ref4) {
|
|
401
407
|
var name = _ref4.name,
|
|
@@ -539,12 +545,12 @@ var getWordCloudSeries = function getWordCloudSeries(_ref8) {
|
|
|
539
545
|
}];
|
|
540
546
|
};
|
|
541
547
|
|
|
542
|
-
/**
|
|
543
|
-
* 获取 饼图 数据项
|
|
544
|
-
* @param name
|
|
545
|
-
* @param data
|
|
546
|
-
* @param other
|
|
547
|
-
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
548
|
+
/**
|
|
549
|
+
* 获取 饼图 数据项
|
|
550
|
+
* @param name
|
|
551
|
+
* @param data
|
|
552
|
+
* @param other
|
|
553
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
548
554
|
*/
|
|
549
555
|
var getPieSeries = function getPieSeries(_ref9) {
|
|
550
556
|
var name = _ref9.name,
|
|
@@ -557,12 +563,12 @@ var getPieSeries = function getPieSeries(_ref9) {
|
|
|
557
563
|
}, other);
|
|
558
564
|
};
|
|
559
565
|
|
|
560
|
-
/**
|
|
561
|
-
* 获取 散点图 数据项
|
|
562
|
-
* @param name
|
|
563
|
-
* @param data
|
|
564
|
-
* @param other
|
|
565
|
-
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
566
|
+
/**
|
|
567
|
+
* 获取 散点图 数据项
|
|
568
|
+
* @param name
|
|
569
|
+
* @param data
|
|
570
|
+
* @param other
|
|
571
|
+
* @returns {*&{connectNulls: boolean, data, symbolSize: number, name, type: string, smooth: boolean}}
|
|
566
572
|
*/
|
|
567
573
|
var getScatterSeries = function getScatterSeries(_ref10) {
|
|
568
574
|
var name = _ref10.name,
|
|
@@ -575,12 +581,12 @@ var getScatterSeries = function getScatterSeries(_ref10) {
|
|
|
575
581
|
}, other);
|
|
576
582
|
};
|
|
577
583
|
|
|
578
|
-
/**
|
|
579
|
-
* 获取颜色
|
|
580
|
-
* @param color 参数可为:"#xxx", "['#xxx', '#xxx]"
|
|
581
|
-
* @returns {string|{x: number, y: number, y2: number, x2: number, global: boolean, colorStops: *[], type: string}}
|
|
584
|
+
/**
|
|
585
|
+
* 获取颜色
|
|
586
|
+
* @param color 参数可为:"#xxx", "['#xxx', '#xxx]"
|
|
587
|
+
* @returns {string|{x: number, y: number, y2: number, x2: number, global: boolean, colorStops: *[], type: string}}
|
|
582
588
|
*/
|
|
583
|
-
var getColor =
|
|
589
|
+
var getColor = function getColor(color) {
|
|
584
590
|
if (typeof color === 'string') {
|
|
585
591
|
return color;
|
|
586
592
|
} else if (Array.isArray(color)) {
|
|
@@ -610,11 +616,12 @@ var getColor = exports.getColor = function getColor(color) {
|
|
|
610
616
|
}
|
|
611
617
|
};
|
|
612
618
|
|
|
613
|
-
/**
|
|
614
|
-
* 获取区间渐变颜色
|
|
615
|
-
* @param color 参数可为:"#xxx", "['#xxx', '#xxx]"
|
|
616
|
-
* @returns {{color: {x: number, y: number, y2: number, globalCoord: boolean, x2: number, colorStops: [{offset: number, color: string},{offset: number, color: string}], type: string}}}
|
|
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}}}
|
|
617
623
|
*/
|
|
624
|
+
exports.getColor = getColor;
|
|
618
625
|
var getAreaColor = function getAreaColor(color) {
|
|
619
626
|
var _ref11 = typeof color === 'string' ? [color, color] : color,
|
|
620
627
|
_ref12 = _slicedToArray(_ref11, 2),
|
|
@@ -640,10 +647,10 @@ var getAreaColor = function getAreaColor(color) {
|
|
|
640
647
|
};
|
|
641
648
|
};
|
|
642
649
|
|
|
643
|
-
/**
|
|
644
|
-
* 获取数据
|
|
645
|
-
* @param series 参数:"{name, data, type, color, areaColor}"
|
|
646
|
-
* @returns {*[]}
|
|
650
|
+
/**
|
|
651
|
+
* 获取数据
|
|
652
|
+
* @param series 参数:"{name, data, type, color, areaColor}"
|
|
653
|
+
* @returns {*[]}
|
|
647
654
|
*/
|
|
648
655
|
var getSeries = function getSeries(series) {
|
|
649
656
|
var _series = [];
|
|
@@ -729,7 +736,7 @@ var getDataZoom = function getDataZoom(options) {
|
|
|
729
736
|
return _dataZoom;
|
|
730
737
|
};
|
|
731
738
|
var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
732
|
-
var _option$series;
|
|
739
|
+
var _option$series, _option$series$, _option$series$$data;
|
|
733
740
|
var _mergeConfigAndData = mergeConfigAndData(props || {}),
|
|
734
741
|
data = _mergeConfigAndData.data,
|
|
735
742
|
onEvents = _mergeConfigAndData.onEvents,
|
|
@@ -778,7 +785,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
778
785
|
var onClick = function onClick(e) {
|
|
779
786
|
if (onEvents !== null && onEvents !== void 0 && onEvents.onClick) {
|
|
780
787
|
var _chartRef$current, _chartRef$current$get;
|
|
781
|
-
var chart = (_chartRef$current = chartRef.current) === null || _chartRef$current === void 0
|
|
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);
|
|
782
789
|
if (chart) {
|
|
783
790
|
var rect = chart.getDom().getBoundingClientRect();
|
|
784
791
|
var x = e.clientX - rect.left;
|
|
@@ -788,7 +795,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
788
795
|
var xIndex = chart.convertFromPixel({
|
|
789
796
|
seriesIndex: 0
|
|
790
797
|
}, [x, y])[0];
|
|
791
|
-
onEvents === null || onEvents === void 0
|
|
798
|
+
onEvents === null || onEvents === void 0 ? void 0 : onEvents.onClick(xIndex);
|
|
792
799
|
}
|
|
793
800
|
}
|
|
794
801
|
}
|
|
@@ -799,7 +806,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
799
806
|
height: height,
|
|
800
807
|
width: '100%'
|
|
801
808
|
}, style)
|
|
802
|
-
}, (_option$series = option.series) !== null && _option$series !== void 0 && (_option$series = _option$series[0]) !== null && _option$series !== void 0 && (_option$series = _option$series
|
|
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"], {
|
|
803
810
|
ref: chartRef,
|
|
804
811
|
option: option,
|
|
805
812
|
notMerge: true,
|
|
@@ -816,5 +823,6 @@ var Chart = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
816
823
|
// 如果相同,则不会重新渲染
|
|
817
824
|
return JSON.stringify(prevProps) === JSON.stringify(nextProps);
|
|
818
825
|
});
|
|
819
|
-
var _default =
|
|
826
|
+
var _default = Chart;
|
|
827
|
+
exports["default"] = _default;
|
|
820
828
|
//# sourceMappingURL=index.js.map
|