| [a762898] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.CategoricalChart = void 0;
|
|---|
| 7 | var _react = _interopRequireWildcard(require("react"));
|
|---|
| 8 | var React = _react;
|
|---|
| 9 | var _RootSurface = require("../container/RootSurface");
|
|---|
| 10 | var _RechartsWrapper = require("./RechartsWrapper");
|
|---|
| 11 | var _ClipPathProvider = require("../container/ClipPathProvider");
|
|---|
| 12 | var _svgPropertiesNoEvents = require("../util/svgPropertiesNoEvents");
|
|---|
| 13 | var _chartLayoutContext = require("../context/chartLayoutContext");
|
|---|
| 14 | var _excluded = ["width", "height", "responsive", "children", "className", "style", "compact", "title", "desc"];
|
|---|
| 15 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|---|
| 16 | 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; }
|
|---|
| 17 | 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; }
|
|---|
| 18 | var CategoricalChart = exports.CategoricalChart = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|---|
| 19 | var {
|
|---|
| 20 | width,
|
|---|
| 21 | height,
|
|---|
| 22 | responsive,
|
|---|
| 23 | children,
|
|---|
| 24 | className,
|
|---|
| 25 | style,
|
|---|
| 26 | compact,
|
|---|
| 27 | title,
|
|---|
| 28 | desc
|
|---|
| 29 | } = props,
|
|---|
| 30 | others = _objectWithoutProperties(props, _excluded);
|
|---|
| 31 | var attrs = (0, _svgPropertiesNoEvents.svgPropertiesNoEvents)(others);
|
|---|
| 32 |
|
|---|
| 33 | /*
|
|---|
| 34 | * The "compact" mode is used as the panorama within Brush.
|
|---|
| 35 | * However because `compact` is a public prop, let's assume that it can render outside of Brush too.
|
|---|
| 36 | */
|
|---|
| 37 | if (compact) {
|
|---|
| 38 | return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_chartLayoutContext.ReportChartSize, {
|
|---|
| 39 | width: width,
|
|---|
| 40 | height: height
|
|---|
| 41 | }), /*#__PURE__*/React.createElement(_RootSurface.RootSurface, {
|
|---|
| 42 | otherAttributes: attrs,
|
|---|
| 43 | title: title,
|
|---|
| 44 | desc: desc
|
|---|
| 45 | }, children));
|
|---|
| 46 | }
|
|---|
| 47 | return /*#__PURE__*/React.createElement(_RechartsWrapper.RechartsWrapper, {
|
|---|
| 48 | className: className,
|
|---|
| 49 | style: style,
|
|---|
| 50 | width: width,
|
|---|
| 51 | height: height,
|
|---|
| 52 | responsive: responsive !== null && responsive !== void 0 ? responsive : false,
|
|---|
| 53 | onClick: props.onClick,
|
|---|
| 54 | onMouseLeave: props.onMouseLeave,
|
|---|
| 55 | onMouseEnter: props.onMouseEnter,
|
|---|
| 56 | onMouseMove: props.onMouseMove,
|
|---|
| 57 | onMouseDown: props.onMouseDown,
|
|---|
| 58 | onMouseUp: props.onMouseUp,
|
|---|
| 59 | onContextMenu: props.onContextMenu,
|
|---|
| 60 | onDoubleClick: props.onDoubleClick,
|
|---|
| 61 | onTouchStart: props.onTouchStart,
|
|---|
| 62 | onTouchMove: props.onTouchMove,
|
|---|
| 63 | onTouchEnd: props.onTouchEnd
|
|---|
| 64 | }, /*#__PURE__*/React.createElement(_RootSurface.RootSurface, {
|
|---|
| 65 | otherAttributes: attrs,
|
|---|
| 66 | title: title,
|
|---|
| 67 | desc: desc,
|
|---|
| 68 | ref: ref
|
|---|
| 69 | }, /*#__PURE__*/React.createElement(_ClipPathProvider.ClipPathProvider, null, children)));
|
|---|
| 70 | }); |
|---|