UNPKG

@mui/x-charts

Version:

The community edition of the charts components (MUI X).

20 lines (19 loc) 765 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 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 => legendGetter[seriesType](series[seriesType])); }