Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  4. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8. // Copyright (c) 2016 - 2017 Uber Technologies, Inc.
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining a copy
  11. // of this software and associated documentation files (the "Software"), to deal
  12. // in the Software without restriction, including without limitation the rights
  13. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14. // copies of the Software, and to permit persons to whom the Software is
  15. // furnished to do so, subject to the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be included in
  18. // all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  25. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  26. // THE SOFTWARE.
  27. import React from 'react';
  28. import PropTypes from 'prop-types';
  29. import equal from 'deep-equal';
  30. import { extractScalePropsFromProps, getMissingScaleProps, getOptionalScaleProps, getXYPlotValues } from '../utils/scales-utils';
  31. import { getStackedData, getSeriesChildren, getSeriesPropsFromChildren } from '../utils/series-utils';
  32. import { getInnerDimensions, MarginPropType, DEFAULT_MARGINS } from '../utils/chart-utils';
  33. import { AnimationPropType } from '../animation';
  34. import { CONTINUOUS_COLOR_RANGE, EXTENDED_DISCRETE_COLOR_RANGE, SIZE_RANGE, OPACITY_TYPE } from '../theme';
  35. import CanvasWrapper from './series/canvas-wrapper';
  36. var ATTRIBUTES = ['x', 'y', 'radius', 'angle', 'color', 'fill', 'stroke', 'opacity', 'size'];
  37. /**
  38. * Remove parents from tree formatted data. deep-equal doesnt play nice with data
  39. * that has circular structures, so we make every node single directional by pruning the parents.
  40. * @param {Array} data - the data object to have circular deps resolved in
  41. * @returns {Array} the sanitized data
  42. */
  43. function cleanseData(data) {
  44. return data.map(function (series) {
  45. if (!Array.isArray(series)) {
  46. return series;
  47. }
  48. return series.map(function (row) {
  49. return _extends({}, row, { parent: null });
  50. });
  51. });
  52. }
  53. /**
  54. * Wrapper on the deep-equal method for checking equality of next props vs current props
  55. * @param {Object} scaleMixins - Scale object.
  56. * @param {Object} nextScaleMixins - Scale object.
  57. * @param {Boolean} hasTreeStructure - Whether or not to cleanse the data of possible cyclic structures
  58. * @returns {Boolean} whether or not the two mixins objects are equal
  59. */
  60. function checkIfMixinsAreEqual(nextScaleMixins, scaleMixins, hasTreeStructure) {
  61. var newMixins = _extends({}, nextScaleMixins, {
  62. _allData: hasTreeStructure ? cleanseData(nextScaleMixins._allData) : nextScaleMixins._allData
  63. });
  64. var oldMixins = _extends({}, scaleMixins, {
  65. _allData: hasTreeStructure ? cleanseData(scaleMixins._allData) : scaleMixins._allData
  66. });
  67. // it's hard to say if this function is reasonable?
  68. return equal(newMixins, oldMixins);
  69. }
  70. var XYPlot = function (_React$Component) {
  71. _inherits(XYPlot, _React$Component);
  72. _createClass(XYPlot, null, [{
  73. key: 'defaultProps',
  74. get: function get() {
  75. return {
  76. className: ''
  77. };
  78. }
  79. }, {
  80. key: 'propTypes',
  81. get: function get() {
  82. return {
  83. animation: AnimationPropType,
  84. className: PropTypes.string,
  85. dontCheckIfEmpty: PropTypes.bool,
  86. height: PropTypes.number.isRequired,
  87. margin: MarginPropType,
  88. onClick: PropTypes.func,
  89. onDoubleClick: PropTypes.func,
  90. onMouseDown: PropTypes.func,
  91. onMouseUp: PropTypes.func,
  92. onMouseEnter: PropTypes.func,
  93. onMouseLeave: PropTypes.func,
  94. onMouseMove: PropTypes.func,
  95. onTouchStart: PropTypes.func,
  96. onTouchMove: PropTypes.func,
  97. onTouchEnd: PropTypes.func,
  98. onTouchCancel: PropTypes.func,
  99. onWheel: PropTypes.func,
  100. stackBy: PropTypes.oneOf(ATTRIBUTES),
  101. style: PropTypes.object,
  102. width: PropTypes.number.isRequired
  103. };
  104. }
  105. }]);
  106. function XYPlot(props) {
  107. _classCallCheck(this, XYPlot);
  108. var _this = _possibleConstructorReturn(this, (XYPlot.__proto__ || Object.getPrototypeOf(XYPlot)).call(this, props));
  109. _initialiseProps.call(_this);
  110. var stackBy = props.stackBy;
  111. var children = getSeriesChildren(props.children);
  112. var data = getStackedData(children, stackBy);
  113. _this.state = {
  114. scaleMixins: _this._getScaleMixins(data, props),
  115. data: data
  116. };
  117. return _this;
  118. }
  119. _createClass(XYPlot, [{
  120. key: 'componentWillReceiveProps',
  121. value: function componentWillReceiveProps(nextProps) {
  122. var children = getSeriesChildren(nextProps.children);
  123. var nextData = getStackedData(children, nextProps.stackBy);
  124. var scaleMixins = this.state.scaleMixins;
  125. var nextScaleMixins = this._getScaleMixins(nextData, nextProps);
  126. if (!checkIfMixinsAreEqual(nextScaleMixins, scaleMixins, nextProps.hasTreeStructure)) {
  127. this.setState({
  128. scaleMixins: nextScaleMixins,
  129. data: nextData
  130. });
  131. }
  132. }
  133. /**
  134. * Trigger click related callbacks if they are available.
  135. * @param {React.SyntheticEvent} event Click event.
  136. * @private
  137. */
  138. /**
  139. * Trigger doule-click related callbacks if they are available.
  140. * @param {React.SyntheticEvent} event Double-click event.
  141. * @private
  142. */
  143. }, {
  144. key: '_getClonedChildComponents',
  145. /**
  146. * Prepare the child components (including series) for rendering.
  147. * @returns {Array} Array of child components.
  148. * @private
  149. */
  150. value: function _getClonedChildComponents() {
  151. var _this2 = this;
  152. var props = this.props;
  153. var animation = this.props.animation;
  154. var _state = this.state,
  155. scaleMixins = _state.scaleMixins,
  156. data = _state.data;
  157. var dimensions = getInnerDimensions(this.props, DEFAULT_MARGINS);
  158. var children = React.Children.toArray(this.props.children);
  159. var seriesProps = getSeriesPropsFromChildren(children);
  160. var XYPlotValues = getXYPlotValues(props, children);
  161. return children.map(function (child, index) {
  162. var dataProps = null;
  163. if (seriesProps[index]) {
  164. // Get the index of the series in the list of props and retrieve
  165. // the data property from it.
  166. var seriesIndex = seriesProps[index].seriesIndex;
  167. dataProps = { data: data[seriesIndex] };
  168. }
  169. return React.cloneElement(child, _extends({}, dimensions, {
  170. animation: animation
  171. }, dataProps && child.type.prototype && child.type.prototype.render ? {
  172. ref: function ref(_ref) {
  173. return _this2['series' + seriesProps[index].seriesIndex] = _ref;
  174. }
  175. } : {}, seriesProps[index], scaleMixins, child.props, XYPlotValues[index], dataProps));
  176. });
  177. }
  178. /**
  179. * Get the list of scale-related settings that should be applied by default.
  180. * @param {Object} props Object of props.
  181. * @returns {Object} Defaults.
  182. * @private
  183. */
  184. }, {
  185. key: '_getDefaultScaleProps',
  186. value: function _getDefaultScaleProps(props) {
  187. var _getInnerDimensions = getInnerDimensions(props, DEFAULT_MARGINS),
  188. innerWidth = _getInnerDimensions.innerWidth,
  189. innerHeight = _getInnerDimensions.innerHeight;
  190. var colorRanges = ['color', 'fill', 'stroke'].reduce(function (acc, attr) {
  191. var range = props[attr + 'Type'] === 'category' ? EXTENDED_DISCRETE_COLOR_RANGE : CONTINUOUS_COLOR_RANGE;
  192. return _extends({}, acc, _defineProperty({}, attr + 'Range', range));
  193. }, {});
  194. return _extends({
  195. xRange: [0, innerWidth],
  196. yRange: [innerHeight, 0]
  197. }, colorRanges, {
  198. opacityType: OPACITY_TYPE,
  199. sizeRange: SIZE_RANGE
  200. });
  201. }
  202. /**
  203. * Get the map of scales from the props, apply defaults to them and then pass
  204. * them further.
  205. * @param {Object} data Array of all data.
  206. * @param {Object} props Props of the component.
  207. * @returns {Object} Map of scale-related props.
  208. * @private
  209. */
  210. }, {
  211. key: '_getScaleMixins',
  212. value: function _getScaleMixins(data, props) {
  213. var _ref2;
  214. var filteredData = data.filter(function (d) {
  215. return d;
  216. });
  217. var allData = (_ref2 = []).concat.apply(_ref2, _toConsumableArray(filteredData));
  218. var defaultScaleProps = this._getDefaultScaleProps(props);
  219. var optionalScaleProps = getOptionalScaleProps(props);
  220. var userScaleProps = extractScalePropsFromProps(props, ATTRIBUTES);
  221. var missingScaleProps = getMissingScaleProps(_extends({}, defaultScaleProps, optionalScaleProps, userScaleProps), allData, ATTRIBUTES);
  222. var children = getSeriesChildren(props.children);
  223. var zeroBaseProps = {};
  224. var adjustBy = new Set();
  225. var adjustWhat = new Set();
  226. children.forEach(function (child, index) {
  227. if (!child || !data[index]) {
  228. return;
  229. }
  230. ATTRIBUTES.forEach(function (attr) {
  231. var _child$type$getParent = child.type.getParentConfig(attr, child.props),
  232. isDomainAdjustmentNeeded = _child$type$getParent.isDomainAdjustmentNeeded,
  233. zeroBaseValue = _child$type$getParent.zeroBaseValue;
  234. if (isDomainAdjustmentNeeded) {
  235. adjustBy.add(attr);
  236. adjustWhat.add(index);
  237. }
  238. if (zeroBaseValue) {
  239. var specifiedDomain = props[attr + 'Domain'];
  240. zeroBaseProps[attr + 'BaseValue'] = specifiedDomain ? specifiedDomain[0] : 0;
  241. }
  242. });
  243. });
  244. return _extends({}, defaultScaleProps, zeroBaseProps, userScaleProps, missingScaleProps, {
  245. _allData: data,
  246. _adjustBy: Array.from(adjustBy),
  247. _adjustWhat: Array.from(adjustWhat),
  248. _stackBy: props.stackBy
  249. });
  250. }
  251. /**
  252. * Checks if the plot is empty or not.
  253. * Currently checks the data only.
  254. * @returns {boolean} True for empty.
  255. * @private
  256. */
  257. }, {
  258. key: '_isPlotEmpty',
  259. value: function _isPlotEmpty() {
  260. var data = this.state.data;
  261. return !data || !data.length || !data.some(function (series) {
  262. return series && series.some(function (d) {
  263. return d;
  264. });
  265. });
  266. }
  267. /**
  268. * Trigger mouse-down related callbacks if they are available.
  269. * @param {React.SyntheticEvent} event Mouse down event.
  270. * @private
  271. */
  272. /**
  273. * Trigger onMouseEnter handler if it was passed in props.
  274. * @param {React.SyntheticEvent} event Mouse enter event.
  275. * @private
  276. */
  277. /**
  278. * Trigger onMouseLeave handler if it was passed in props.
  279. * @param {React.SyntheticEvent} event Mouse leave event.
  280. * @private
  281. */
  282. /**
  283. * Trigger movement-related callbacks if they are available.
  284. * @param {React.SyntheticEvent} event Mouse move event.
  285. * @private
  286. */
  287. /**
  288. * Trigger mouse-up related callbacks if they are available.
  289. * @param {React.SyntheticEvent} event Mouse up event.
  290. * @private
  291. */
  292. /**
  293. * Trigger onTouchCancel handler if it was passed in props.
  294. * @param {React.SyntheticEvent} event Touch Cancel event.
  295. * @private
  296. */
  297. /**
  298. * Trigger onTouchEnd handler if it was passed in props.
  299. * @param {React.SyntheticEvent} event Touch End event.
  300. * @private
  301. */
  302. /**
  303. * Trigger touch movement-related callbacks if they are available.
  304. * @param {React.SyntheticEvent} event Touch move event.
  305. * @private
  306. */
  307. /**
  308. * Trigger touch-start related callbacks if they are available.
  309. * @param {React.SyntheticEvent} event Touch start event.
  310. * @private
  311. */
  312. /**
  313. * Trigger doule-click related callbacks if they are available.
  314. * @param {React.SyntheticEvent} event Double-click event.
  315. * @private
  316. */
  317. }, {
  318. key: 'renderCanvasComponents',
  319. value: function renderCanvasComponents(components, props) {
  320. var componentsToRender = components.filter(function (c) {
  321. return c && !c.type.requiresSVG && c.type.isCanvas;
  322. });
  323. if (componentsToRender.length === 0) {
  324. return null;
  325. }
  326. var _componentsToRender$ = componentsToRender[0].props,
  327. marginLeft = _componentsToRender$.marginLeft,
  328. marginTop = _componentsToRender$.marginTop,
  329. marginBottom = _componentsToRender$.marginBottom,
  330. marginRight = _componentsToRender$.marginRight,
  331. innerHeight = _componentsToRender$.innerHeight,
  332. innerWidth = _componentsToRender$.innerWidth;
  333. return React.createElement(
  334. CanvasWrapper,
  335. {
  336. innerHeight: innerHeight,
  337. innerWidth: innerWidth,
  338. marginLeft: marginLeft,
  339. marginTop: marginTop,
  340. marginBottom: marginBottom,
  341. marginRight: marginRight
  342. },
  343. componentsToRender
  344. );
  345. }
  346. }, {
  347. key: 'render',
  348. value: function render() {
  349. var _props = this.props,
  350. className = _props.className,
  351. dontCheckIfEmpty = _props.dontCheckIfEmpty,
  352. style = _props.style,
  353. width = _props.width,
  354. height = _props.height;
  355. if (!dontCheckIfEmpty && this._isPlotEmpty()) {
  356. return React.createElement('div', {
  357. className: 'rv-xy-plot ' + className,
  358. style: _extends({
  359. width: width + 'px',
  360. height: height + 'px'
  361. }, this.props.style)
  362. });
  363. }
  364. var components = this._getClonedChildComponents();
  365. return React.createElement(
  366. 'div',
  367. {
  368. style: {
  369. width: width + 'px',
  370. height: height + 'px'
  371. },
  372. className: 'rv-xy-plot ' + className
  373. },
  374. React.createElement(
  375. 'svg',
  376. {
  377. className: 'rv-xy-plot__inner',
  378. width: width,
  379. height: height,
  380. style: style,
  381. onClick: this._clickHandler,
  382. onDoubleClick: this._doubleClickHandler,
  383. onMouseDown: this._mouseDownHandler,
  384. onMouseUp: this._mouseUpHandler,
  385. onMouseMove: this._mouseMoveHandler,
  386. onMouseLeave: this._mouseLeaveHandler,
  387. onMouseEnter: this._mouseEnterHandler,
  388. onTouchStart: this._mouseDownHandler,
  389. onTouchMove: this._touchMoveHandler,
  390. onTouchEnd: this._touchEndHandler,
  391. onTouchCancel: this._touchCancelHandler,
  392. onWheel: this._wheelHandler
  393. },
  394. components.filter(function (c) {
  395. return c && c.type.requiresSVG;
  396. })
  397. ),
  398. this.renderCanvasComponents(components, this.props),
  399. components.filter(function (c) {
  400. return c && !c.type.requiresSVG && !c.type.isCanvas;
  401. })
  402. );
  403. }
  404. }]);
  405. return XYPlot;
  406. }(React.Component);
  407. var _initialiseProps = function _initialiseProps() {
  408. var _this3 = this;
  409. this._clickHandler = function (event) {
  410. var onClick = _this3.props.onClick;
  411. if (onClick) {
  412. onClick(event);
  413. }
  414. };
  415. this._doubleClickHandler = function (event) {
  416. var onDoubleClick = _this3.props.onDoubleClick;
  417. if (onDoubleClick) {
  418. onDoubleClick(event);
  419. }
  420. };
  421. this._mouseDownHandler = function (event) {
  422. var _props2 = _this3.props,
  423. onMouseDown = _props2.onMouseDown,
  424. children = _props2.children;
  425. if (onMouseDown) {
  426. onMouseDown(event);
  427. }
  428. var seriesChildren = getSeriesChildren(children);
  429. seriesChildren.forEach(function (child, index) {
  430. var component = _this3['series' + index];
  431. if (component && component.onParentMouseDown) {
  432. component.onParentMouseDown(event);
  433. }
  434. });
  435. };
  436. this._mouseEnterHandler = function (event) {
  437. var _props3 = _this3.props,
  438. onMouseEnter = _props3.onMouseEnter,
  439. children = _props3.children;
  440. if (onMouseEnter) {
  441. onMouseEnter(event);
  442. }
  443. var seriesChildren = getSeriesChildren(children);
  444. seriesChildren.forEach(function (child, index) {
  445. var component = _this3['series' + index];
  446. if (component && component.onParentMouseEnter) {
  447. component.onParentMouseEnter(event);
  448. }
  449. });
  450. };
  451. this._mouseLeaveHandler = function (event) {
  452. var _props4 = _this3.props,
  453. onMouseLeave = _props4.onMouseLeave,
  454. children = _props4.children;
  455. if (onMouseLeave) {
  456. onMouseLeave(event);
  457. }
  458. var seriesChildren = getSeriesChildren(children);
  459. seriesChildren.forEach(function (child, index) {
  460. var component = _this3['series' + index];
  461. if (component && component.onParentMouseLeave) {
  462. component.onParentMouseLeave(event);
  463. }
  464. });
  465. };
  466. this._mouseMoveHandler = function (event) {
  467. var _props5 = _this3.props,
  468. onMouseMove = _props5.onMouseMove,
  469. children = _props5.children;
  470. if (onMouseMove) {
  471. onMouseMove(event);
  472. }
  473. var seriesChildren = getSeriesChildren(children);
  474. seriesChildren.forEach(function (child, index) {
  475. var component = _this3['series' + index];
  476. if (component && component.onParentMouseMove) {
  477. component.onParentMouseMove(event);
  478. }
  479. });
  480. };
  481. this._mouseUpHandler = function (event) {
  482. var _props6 = _this3.props,
  483. onMouseUp = _props6.onMouseUp,
  484. children = _props6.children;
  485. if (onMouseUp) {
  486. onMouseUp(event);
  487. }
  488. var seriesChildren = getSeriesChildren(children);
  489. seriesChildren.forEach(function (child, index) {
  490. var component = _this3['series' + index];
  491. if (component && component.onParentMouseUp) {
  492. component.onParentMouseUp(event);
  493. }
  494. });
  495. };
  496. this._touchCancelHandler = function (event) {
  497. var onTouchCancel = _this3.props.onTouchCancel;
  498. if (onTouchCancel) {
  499. onTouchCancel(event);
  500. }
  501. };
  502. this._touchEndHandler = function (event) {
  503. var onTouchEnd = _this3.props.onTouchEnd;
  504. if (onTouchEnd) {
  505. onTouchEnd(event);
  506. }
  507. };
  508. this._touchMoveHandler = function (event) {
  509. var _props7 = _this3.props,
  510. onTouchMove = _props7.onTouchMove,
  511. children = _props7.children;
  512. if (onTouchMove) {
  513. onTouchMove(event);
  514. }
  515. var seriesChildren = getSeriesChildren(children);
  516. seriesChildren.forEach(function (child, index) {
  517. var component = _this3['series' + index];
  518. if (component && component.onParentTouchMove) {
  519. component.onParentTouchMove(event);
  520. }
  521. });
  522. };
  523. this._touchStartHandler = function (event) {
  524. var _props8 = _this3.props,
  525. onTouchStart = _props8.onTouchStart,
  526. children = _props8.children;
  527. if (onTouchStart) {
  528. onTouchStart(event);
  529. }
  530. var seriesChildren = getSeriesChildren(children);
  531. seriesChildren.forEach(function (child, index) {
  532. var component = _this3['series' + index];
  533. if (component && component.onParentTouchStart) {
  534. component.onParentTouchStart(event);
  535. }
  536. });
  537. };
  538. this._wheelHandler = function (event) {
  539. var onWheel = _this3.props.onWheel;
  540. if (onWheel) {
  541. onWheel(event);
  542. }
  543. };
  544. };
  545. XYPlot.displayName = 'XYPlot';
  546. export default XYPlot;