@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
51 lines (50 loc) • 2.06 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 __());
};
})();
import ChartCommonActionService from './base-chart-action';
/**
* 桑基图实现Link Service
*/
var RelationChartActionService = /** @class */ (function (_super) {
__extends(RelationChartActionService, _super);
function RelationChartActionService() {
return _super !== null && _super.apply(this, arguments) || this;
}
RelationChartActionService.prototype.toEvent = function (params) {
var buckets = [];
var metrics = [];
buckets = [
this.generateBucket(params.fromField, params.fromFieldValue, params.fields),
this.generateBucket(params.toField, params.toFieldValue, params.fields)
];
metrics = [this.generateMetric(params.metricField, params.metricValue)];
return this.generateValidResults({ buckets: buckets, metrics: metrics });
};
RelationChartActionService.prototype.toActionToken = function (params) {
var _a;
return {
row: (_a = {},
_a[params.fromField] = params.fromFieldValue,
_a[params.toField] = params.toFieldValue,
_a),
click: {
name: params.fromField,
value: params.fromFieldValue,
name1: params.toField,
value1: params.toFieldValue
}
};
};
return RelationChartActionService;
}(ChartCommonActionService));
export default RelationChartActionService;