@alicloud/cloud-charts
Version:

62 lines (45 loc) • 2 kB
JavaScript
;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _cloudCharts = require("@alicloud/cloud-charts");
var _worldWithoutAntarctic = _interopRequireDefault(require("./data/world-without-antarctic.json"));
// @ts-ignore
// @ts-ignore
var defaultWorldProjection = _cloudCharts.Wmap.getGeoProjection('geoEquirectangular');
function WorldMap(props) {
var geoData = props.geoData,
children = props.children,
config = props.config,
other = (0, _objectWithoutPropertiesLoose2["default"])(props, ["geoData", "children", "config"]);
var newConfig = Object.assign({}, config || {});
if (newConfig.showSouthChinaSea === undefined || newConfig.showSouthChinaSea) {
newConfig.showSouthChinaSea = false;
}
if (!newConfig.projection) {
newConfig.projection = defaultWorldProjection;
}
if (!newConfig.padding) {
newConfig.padding = [0, 0, 0, 0];
}
return /*#__PURE__*/React.createElement(_cloudCharts.Wmap, (0, _extends2["default"])({
geoData: geoData || _worldWithoutAntarctic["default"],
config: newConfig
}, other), children);
}
WorldMap.Area = _cloudCharts.Wmap.Area;
WorldMap.Point = _cloudCharts.Wmap.Point;
WorldMap.HeatMap = _cloudCharts.Wmap.HeatMap;
WorldMap.Shoot = _cloudCharts.Wmap.Shoot;
WorldMap.Custom = _cloudCharts.Wmap.Custom;
WorldMap.worldGeoData = _worldWithoutAntarctic["default"];
WorldMap.isG2Chart = true;
if (_cloudCharts.pluginManager) {
_cloudCharts.pluginManager.register('WorldMap', WorldMap);
}
var _default = WorldMap;
exports["default"] = _default;