@visactor/vmind
Version:
<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu
29 lines (23 loc) • 992 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.pipelineFunnel = exports.funnelField = exports.funnelData = void 0;
const dataTable_1 = require("../../../../utils/dataTable"), common_1 = require("./common"), funnelData = context => {
const {dataTable: dataTable, cell: cell, spec: spec} = context;
return spec.data = {
id: "data",
values: (0, dataTable_1.isValidDataTable)(dataTable) ? dataTable.sort(((a, b) => b[cell.y] - a[cell.y])) : []
}, {
spec: spec
};
};
exports.funnelData = funnelData;
const funnelField = context => {
const {cell: cell, spec: spec} = context;
return spec.categoryField = cell.color || cell.x, spec.valueField = cell.value || cell.y,
{
spec: spec
};
};
exports.funnelField = funnelField, exports.pipelineFunnel = [ exports.funnelData, common_1.color, exports.funnelField, common_1.discreteLegend, common_1.commonLabel ];
//# sourceMappingURL=funnel.js.map