@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
55 lines (50 loc) • 1.48 kB
JavaScript
import { color, data } from "./common";
export const linearProgressField = context => {
const {cell: cell, spec: spec} = context;
return spec.xField = cell.y, spec.yField = cell.x, cell.color && (spec.seriesField = cell.color),
spec.cornerRadius = 20, {
spec: spec
};
};
export const linearProgressAxes = context => {
const {cell: cell, spec: spec} = context, hasSingleData = spec.data.values && 1 === spec.data.values.length;
return spec.axes = [ {
orient: "left",
type: "band",
domainLine: {
visible: !1
},
tick: {
visible: !1
},
label: {
formatMethod: hasSingleData ? val => `${cell.x}: ${val}` : null,
style: {
fontSize: 16
}
}
}, {
orient: "bottom",
type: "linear",
visible: !0,
grid: {
visible: !1
},
label: {
formatMethod: val => val >= 0 && val <= 1 ? 100 * val + "%" : val,
flush: !0
}
} ], {
spec: spec
};
};
export const linearProgressStyle = context => {
const {spec: spec} = context;
return spec.progress = Object.assign(Object.assign({}, spec.progress), {
style: {}
}), {
spec: spec
};
};
export const pipelineLinearProgress = [ data, color, linearProgressField, linearProgressAxes, linearProgressStyle ];
//# sourceMappingURL=linearProgress.js.map