UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

51 lines (50 loc) 2.09 kB
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 ChartDrillDownService from './base-chart-drill'; /** * 桑基图实现DrillDown Service */ var RelationChartDrillDownService = /** @class */ (function (_super) { __extends(RelationChartDrillDownService, _super); function RelationChartDrillDownService() { return _super !== null && _super.apply(this, arguments) || this; } RelationChartDrillDownService.prototype.toSearchAutoEvent = 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 }); }; RelationChartDrillDownService.prototype.toDrillDownToken = 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 RelationChartDrillDownService; }(ChartDrillDownService)); export default RelationChartDrillDownService;