@mui/x-charts
Version:
The community edition of the charts components (MUI X).
43 lines • 1.59 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className"];
import { styled } from '@mui/material/styles';
import * as React from 'react';
import { useAxisEvents } from './hooks/useAxisEvents';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var ChartChartsSurfaceStyles = styled('svg', {
name: 'MuiChartsSurface',
slot: 'Root'
})(function () {
return {};
});
export var ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
var children = props.children,
width = props.width,
height = props.height,
viewBox = props.viewBox,
_props$disableAxisLis = props.disableAxisListener,
disableAxisListener = _props$disableAxisLis === void 0 ? false : _props$disableAxisLis,
className = props.className,
other = _objectWithoutProperties(props, _excluded);
var svgView = _extends({
width: width,
height: height,
x: 0,
y: 0
}, viewBox);
useAxisEvents(disableAxisListener);
return /*#__PURE__*/_jsxs(ChartChartsSurfaceStyles, _extends({
width: width,
height: height,
viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height),
ref: ref
}, other, {
children: [/*#__PURE__*/_jsx("title", {
children: props.title
}), /*#__PURE__*/_jsx("desc", {
children: props.desc
}), children]
}));
});