@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
23 lines (22 loc) • 846 B
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSeriesToDisplay = getSeriesToDisplay;
var _legend = _interopRequireDefault(require("../BarChart/legend"));
var _legend2 = _interopRequireDefault(require("../ScatterChart/legend"));
var _legend3 = _interopRequireDefault(require("../LineChart/legend"));
var _legend4 = _interopRequireDefault(require("../PieChart/legend"));
const legendGetter = {
bar: _legend.default,
scatter: _legend2.default,
line: _legend3.default,
pie: _legend4.default
};
function getSeriesToDisplay(series) {
return Object.keys(series).flatMap(seriesType => {
const getter = legendGetter[seriesType];
return getter === undefined ? [] : getter(series[seriesType]);
});
}
;