UNPKG

@mui/x-charts

Version:

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

41 lines 1.37 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _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"; const ChartChartsSurfaceStyles = styled('svg', { name: 'MuiChartsSurface', slot: 'Root' })(() => ({})); export const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) { const { children, width, height, viewBox, disableAxisListener = false } = props, other = _objectWithoutPropertiesLoose(props, _excluded); const svgView = _extends({ width, height, x: 0, y: 0 }, viewBox); useAxisEvents(disableAxisListener); return /*#__PURE__*/_jsxs(ChartChartsSurfaceStyles, _extends({ width: width, height: height, viewBox: `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`, ref: ref }, other, { children: [/*#__PURE__*/_jsx("title", { children: props.title }), /*#__PURE__*/_jsx("desc", { children: props.desc }), children] })); });