UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

65 lines (64 loc) 3.01 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var lodash_1 = require("lodash"); var map_1 = require("../../../constants/map/map"); var nameMap_1 = require("../../../constants/map/nameMap"); var store_1 = __importDefault(require("../store")); var BubbleChinaChartStore = /** @class */ (function (_super) { __extends(BubbleChinaChartStore, _super); function BubbleChinaChartStore() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.mapType = map_1.MapType.World; _this.getIsValidMapData = function (seriesNames) { var e_1, _a; try { // 世界地图: series的名字里只要出现世界地图允许的国家名字, 则为true, 若所有series的名字都不为世界地图所认识的国家名字,则返回false for (var seriesNames_1 = __values(seriesNames), seriesNames_1_1 = seriesNames_1.next(); !seriesNames_1_1.done; seriesNames_1_1 = seriesNames_1.next()) { var name_1 = seriesNames_1_1.value; if (lodash_1.keys(nameMap_1.worldNameMap).indexOf(name_1) > -1 || lodash_1.values(nameMap_1.worldNameMap).indexOf(name_1) > -1) { return true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (seriesNames_1_1 && !seriesNames_1_1.done && (_a = seriesNames_1.return)) _a.call(seriesNames_1); } finally { if (e_1) throw e_1.error; } } return false; }; return _this; } return BubbleChinaChartStore; }(store_1.default)); exports.default = BubbleChinaChartStore;