@patternfly/react-charts
Version:
This library provides a set of React chart components for use with the PatternFly reference implementation.
26 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSankeySeries = void 0;
const tslib_1 = require("tslib");
const defaultsDeep_1 = tslib_1.__importDefault(require("lodash/defaultsDeep"));
/**
* Returns series properties for Sankey chart
*
* @param serie
* @param theme
* @param isSkeleton
* @private Not intended as public API and subject to change
*/
const getSankeySeries = (serie, theme, isSkeleton) => {
const defaults = Object.assign(Object.assign({ data: serie.data.map((datum, index) => ({
itemStyle: {
color: theme === null || theme === void 0 ? void 0 : theme.color[index % (theme === null || theme === void 0 ? void 0 : theme.color.length)]
}
})) }, (isSkeleton ? { draggable: false } : {})), { emphasis: Object.assign({}, (isSkeleton ? { disabled: true } : { focus: 'adjacency' })), layout: 'none', lineStyle: {
color: 'source',
opacity: 0.6
}, type: 'sankey' });
return (0, defaultsDeep_1.default)(serie, defaults);
};
exports.getSankeySeries = getSankeySeries;
//# sourceMappingURL=Sankey.js.map