@mui/x-charts
Version:
The community edition of MUI X Charts components.
61 lines (57 loc) • 1.75 kB
JavaScript
;
'use client';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useRadiusScale = useRadiusScale;
exports.useRotationScale = useRotationScale;
exports.useXScale = useXScale;
exports.useYScale = useYScale;
var _useAxis = require("./useAxis");
/**
* Get the X scale.
*
* @param axisId - The axis identifier. Can be:
* - A string or number matching the axis ID defined in the chart's `xAxis` prop
* - Undefined to get the default (first) X axis
* @returns The X axis scale
*/
function useXScale(axisId) {
const axis = (0, _useAxis.useXAxis)(axisId);
return axis.scale;
}
/**
* Get the Y scale.
*
* @param axisId - The axis identifier. Can be:
* - A string or number matching the axis ID defined in the chart's `yAxis` prop
* - Undefined to get the default (first) Y axis
* @returns The Y axis scale
*/
function useYScale(axisId) {
const axis = (0, _useAxis.useYAxis)(axisId);
return axis.scale;
}
/**
* Get the rotation scale.
*
* @param axisId - The axis identifier. Can be:
* - A string or number matching the axis ID defined in the chart's `rotationAxis` prop
* - Undefined to get the default rotation axis
* @returns The rotation axis scale, or undefined if not found
*/
function useRotationScale(axisId) {
const axis = (0, _useAxis.useRotationAxis)(axisId);
return axis?.scale;
}
/**
* Get the radius scale.
* @param axisId - The axis identifier. Can be:
* - A string or number matching the axis ID defined in the chart's `radiusAxis` prop
* - Undefined to get the default radius axis
* @returns The radius axis scale, or undefined if not found
*/
function useRadiusScale(axisId) {
const axis = (0, _useAxis.useRadiusAxis)(axisId);
return axis?.scale;
}