@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
25 lines (20 loc) • 768 B
JavaScript
import { isValidDataTable } from "../../../../utils/dataTable";
import { color, commonLabel, discreteLegend } from "./common";
export const funnelData = context => {
const {dataTable: dataTable, cell: cell, spec: spec} = context;
return spec.data = {
id: "data",
values: isValidDataTable(dataTable) ? dataTable.sort(((a, b) => b[cell.y] - a[cell.y])) : []
}, {
spec: spec
};
};
export const funnelField = context => {
const {cell: cell, spec: spec} = context;
return spec.categoryField = cell.color || cell.x, spec.valueField = cell.value || cell.y,
{
spec: spec
};
};
export const pipelineFunnel = [ funnelData, color, funnelField, discreteLegend, commonLabel ];
//# sourceMappingURL=funnel.js.map