| 1 | var _excluded = ["width", "height", "responsive", "children", "className", "style", "compact", "title", "desc"];
|
|---|
| 2 | function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|---|
| 3 | function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|---|
| 4 | import * as React from 'react';
|
|---|
| 5 | import { forwardRef } from 'react';
|
|---|
| 6 | import { RootSurface } from '../container/RootSurface';
|
|---|
| 7 | import { RechartsWrapper } from './RechartsWrapper';
|
|---|
| 8 | import { ClipPathProvider } from '../container/ClipPathProvider';
|
|---|
| 9 | import { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';
|
|---|
| 10 | import { ReportChartSize } from '../context/chartLayoutContext';
|
|---|
| 11 | export var CategoricalChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|---|
| 12 | var {
|
|---|
| 13 | width,
|
|---|
| 14 | height,
|
|---|
| 15 | responsive,
|
|---|
| 16 | children,
|
|---|
| 17 | className,
|
|---|
| 18 | style,
|
|---|
| 19 | compact,
|
|---|
| 20 | title,
|
|---|
| 21 | desc
|
|---|
| 22 | } = props,
|
|---|
| 23 | others = _objectWithoutProperties(props, _excluded);
|
|---|
| 24 | var attrs = svgPropertiesNoEvents(others);
|
|---|
| 25 |
|
|---|
| 26 | /*
|
|---|
| 27 | * The "compact" mode is used as the panorama within Brush.
|
|---|
| 28 | * However because `compact` is a public prop, let's assume that it can render outside of Brush too.
|
|---|
| 29 | */
|
|---|
| 30 | if (compact) {
|
|---|
| 31 | return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReportChartSize, {
|
|---|
| 32 | width: width,
|
|---|
| 33 | height: height
|
|---|
| 34 | }), /*#__PURE__*/React.createElement(RootSurface, {
|
|---|
| 35 | otherAttributes: attrs,
|
|---|
| 36 | title: title,
|
|---|
| 37 | desc: desc
|
|---|
| 38 | }, children));
|
|---|
| 39 | }
|
|---|
| 40 | return /*#__PURE__*/React.createElement(RechartsWrapper, {
|
|---|
| 41 | className: className,
|
|---|
| 42 | style: style,
|
|---|
| 43 | width: width,
|
|---|
| 44 | height: height,
|
|---|
| 45 | responsive: responsive !== null && responsive !== void 0 ? responsive : false,
|
|---|
| 46 | onClick: props.onClick,
|
|---|
| 47 | onMouseLeave: props.onMouseLeave,
|
|---|
| 48 | onMouseEnter: props.onMouseEnter,
|
|---|
| 49 | onMouseMove: props.onMouseMove,
|
|---|
| 50 | onMouseDown: props.onMouseDown,
|
|---|
| 51 | onMouseUp: props.onMouseUp,
|
|---|
| 52 | onContextMenu: props.onContextMenu,
|
|---|
| 53 | onDoubleClick: props.onDoubleClick,
|
|---|
| 54 | onTouchStart: props.onTouchStart,
|
|---|
| 55 | onTouchMove: props.onTouchMove,
|
|---|
| 56 | onTouchEnd: props.onTouchEnd
|
|---|
| 57 | }, /*#__PURE__*/React.createElement(RootSurface, {
|
|---|
| 58 | otherAttributes: attrs,
|
|---|
| 59 | title: title,
|
|---|
| 60 | desc: desc,
|
|---|
| 61 | ref: ref
|
|---|
| 62 | }, /*#__PURE__*/React.createElement(ClipPathProvider, null, children)));
|
|---|
| 63 | }); |
|---|