UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

39 lines (38 loc) 2.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selectorChartSvgWidth = exports.selectorChartSvgHeight = exports.selectorChartPropsWidth = exports.selectorChartPropsHeight = exports.selectorChartMargin = exports.selectorChartDrawingArea = exports.selectorChartDimensionsState = void 0; var _store = require("@mui/x-internals/store"); var _useChartAxisSize = require("../../featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors"); const selectorChartDimensionsState = state => state.dimensions; exports.selectorChartDimensionsState = selectorChartDimensionsState; const selectorChartMargin = state => state.dimensions.margin; exports.selectorChartMargin = selectorChartMargin; const selectorChartDrawingArea = exports.selectorChartDrawingArea = (0, _store.createSelectorMemoized)(selectorChartDimensionsState, selectorChartMargin, _useChartAxisSize.selectorChartAxisSizes, function selectorChartDrawingArea({ width, height }, { top: marginTop, right: marginRight, bottom: marginBottom, left: marginLeft }, { left: axisSizeLeft, right: axisSizeRight, top: axisSizeTop, bottom: axisSizeBottom }) { return { width: width - marginLeft - marginRight - axisSizeLeft - axisSizeRight, left: marginLeft + axisSizeLeft, right: marginRight + axisSizeRight, height: height - marginTop - marginBottom - axisSizeTop - axisSizeBottom, top: marginTop + axisSizeTop, bottom: marginBottom + axisSizeBottom }; }); const selectorChartSvgWidth = exports.selectorChartSvgWidth = (0, _store.createSelector)(selectorChartDimensionsState, dimensionsState => dimensionsState.width); const selectorChartSvgHeight = exports.selectorChartSvgHeight = (0, _store.createSelector)(selectorChartDimensionsState, dimensionsState => dimensionsState.height); const selectorChartPropsWidth = exports.selectorChartPropsWidth = (0, _store.createSelector)(selectorChartDimensionsState, dimensionsState => dimensionsState.propsWidth); const selectorChartPropsHeight = exports.selectorChartPropsHeight = (0, _store.createSelector)(selectorChartDimensionsState, dimensionsState => dimensionsState.propsHeight);