@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
60 lines (59 loc) • 2.75 kB
JavaScript
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.");
};
import { values, keys } from 'lodash';
import { MapType } from '../../../constants/map/map';
import { worldNameMap } from '../../../constants/map/nameMap';
import MapBubbleChartStore from '../store';
var BubbleChinaChartStore = /** @class */ (function (_super) {
__extends(BubbleChinaChartStore, _super);
function BubbleChinaChartStore() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.mapType = 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 (keys(worldNameMap).indexOf(name_1) > -1 ||
values(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;
}(MapBubbleChartStore));
export default BubbleChinaChartStore;