@mui/x-charts
Version:
The community edition of MUI X Charts components.
46 lines (45 loc) • 1.78 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.polarSeriesTypes = exports.cartesianSeriesTypes = void 0;
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
let cartesianInstance;
let polarInstance;
class CartesianSeriesTypes {
types = new Set();
constructor() {
if (cartesianInstance) {
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X Charts: Only one CartesianSeriesTypes instance can be created. ' + 'This is a singleton class used internally for series type registration. ' + 'Use the existing instance instead of creating a new one.' : (0, _formatErrorMessage2.default)(24));
}
cartesianInstance = this.types;
}
addType(value) {
this.types.add(value);
}
getTypes() {
return this.types;
}
}
class PolarSeriesTypes {
types = new Set();
constructor() {
if (polarInstance) {
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X Charts: Only one PolarSeriesTypes instance can be created. ' + 'This is a singleton class used internally for series type registration. ' + 'Use the existing instance instead of creating a new one.' : (0, _formatErrorMessage2.default)(25));
}
polarInstance = this.types;
}
addType(value) {
this.types.add(value);
}
getTypes() {
return this.types;
}
}
const cartesianSeriesTypes = exports.cartesianSeriesTypes = new CartesianSeriesTypes();
cartesianSeriesTypes.addType('bar');
cartesianSeriesTypes.addType('line');
cartesianSeriesTypes.addType('scatter');
const polarSeriesTypes = exports.polarSeriesTypes = new PolarSeriesTypes();
polarSeriesTypes.addType('radar');