From fc54395d934cab54fdea07c0c2a45c1f422b9b1f Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Fri, 13 Jul 2018 11:53:18 +0200 Subject: [PATCH] Updated react-vis to 1.10.2 (#999) * Updated react-vis to 1.10.2 The features we introduced in XYPlot are now merged into react-vis after https://github.com/uber/react-vis/pull/857. The XYPlotExtended class is removed. The div aroung the XYPlot is also removed since it's not required. All snapshots are updated after this removal. * Updated CHANGELOG * Reverting 492d28a5 to keep the wrapping div around the chart * Fixed the react-vis version to the stable one. Check this issue comments to see the status: https://github.com/uber/react-vis/issues/861 --- CHANGELOG.md | 1 + package.json | 2 +- src/components/xy_chart/xy_chart.js | 107 +--------------------------- yarn.lock | 63 ++++++++++++---- 4 files changed, 55 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 484d49da42e..0d305323b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Make some proprties of `EuiFlyout` optional ([#1003](https://github.com/elastic/eui/pull/1003)) - Add typings for `EuiFlyout`, `EuiFlyoutBody`, `EuiFlyoutHeader`, and `EuiFlyoutFooter` ([#1001](https://github.com/elastic/eui/pull/1001)) - Gave `EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000)) +- Updated `react-vis` version to `1.10.2`. ([#999](https://github.com/elastic/eui/pull/999)) **Breaking changes** diff --git a/package.json b/package.json index e6374819c5f..89b3b88391f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "react-datepicker": "v1.4.1", "react-input-autosize": "^2.2.1", "react-virtualized": "^9.18.5", - "react-vis": "^1.10.1", + "react-vis": "1.10.2", "serve": "^6.3.1", "tabbable": "^1.1.0", "uuid": "^3.1.0" diff --git a/src/components/xy_chart/xy_chart.js b/src/components/xy_chart/xy_chart.js index a594f38bde2..35b8071ef28 100644 --- a/src/components/xy_chart/xy_chart.js +++ b/src/components/xy_chart/xy_chart.js @@ -8,7 +8,6 @@ import { EuiDefaultAxis } from './axis/default_axis'; import { EuiCrosshairX } from './crosshairs/crosshair_x'; import { EuiCrosshairY } from './crosshairs/crosshair_y'; import { VISUALIZATION_COLORS } from '../../services'; -import { getSeriesChildren } from './utils/series_utils'; import { ORIENTATION, SCALE } from './utils/chart_utils'; const { HORIZONTAL, VERTICAL, BOTH } = ORIENTATION; const { LINEAR, ORDINAL, CATEGORY, TIME, TIME_UTC, LOG, LITERAL } = SCALE; @@ -20,108 +19,6 @@ const DEFAULT_MARGINS = { bottom: 40 }; -/** - * The extended version of the react-vis XYPlot with the mouseLeave and mouseUp handlers. - * TODO: send a PR to react-vis for incorporate these two changes directly into XYPlot class. - */ -class XYExtendedPlot extends XYPlot { - /** - * Trigger onMouseLeave handler if it was passed in props. - * @param {Event} event Native event. - * @private - */ - _mouseLeaveHandler(event) { - const { onMouseLeave, children } = this.props; - if (onMouseLeave) { - super.onMouseLeave(event); - } - const seriesChildren = getSeriesChildren(children); - seriesChildren.forEach((child, index) => { - const component = this[`series${index}`]; - if (component && component.onParentMouseLeave) { - component.onParentMouseLeave(event); - } - }); - } - - /** - * Trigger onMouseUp handler if it was passed in props. - * @param {Event} event Native event. - * @private - */ - _mouseUpHandler = (event) => { - const { onMouseUp, children } = this.props; - if (onMouseUp) { - super.onMouseUp(event); - } - const seriesChildren = getSeriesChildren(children); - seriesChildren.forEach((child, index) => { - const component = this[`series${index}`]; - if (component && component.onParentMouseUp) { - component.onParentMouseUp(event); - } - }); - } - - render() { - const { - className, - dontCheckIfEmpty, - style, - width, - height, - } = this.props; - - if (!dontCheckIfEmpty && this._isPlotEmpty()) { - return ( -
- ); - } - const components = this._getClonedChildComponents(); - - return ( -
- - {components.filter(c => c && c.type.requiresSVG)} - - {this.renderCanvasComponents(components, this.props)} - {components.filter(c => c && !c.type.requiresSVG && !c.type.isCanvas)} -
- ); - } -} - - /** * The root component of any XY chart. * It renders an react-vis XYPlot including default axis and a valid crosshair. @@ -231,7 +128,7 @@ class XYChart extends PureComponent { const seriesNames = this._getSeriesNames(children); return (
- )} - +
); } diff --git a/yarn.lock b/yarn.lock index 1f432462fda..c4180232778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3628,7 +3628,19 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.16, fbjs@^0.8.9: +fbjs@^0.8.16: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +fbjs@^0.8.9: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: @@ -4641,10 +4653,16 @@ i@0.3.x: version "0.3.6" resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" -iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@~0.4.13: +iconv-lite@0.4.19, iconv-lite@^0.4.17: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +iconv-lite@~0.4.13: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + icss-replace-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" @@ -5617,6 +5635,10 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" @@ -6085,7 +6107,13 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.0, loose-envify@^1.3.1: +loose-envify@^1.0.0, loose-envify@^1.3.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: @@ -7884,7 +7912,7 @@ prompt@^1.0.0: utile "0.3.x" winston "2.1.x" -prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0: +prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" dependencies: @@ -7892,6 +7920,13 @@ prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.5.8: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + prop-types@^15.6.1: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" @@ -8192,9 +8227,9 @@ react-virtualized@^9.18.5: loose-envify "^1.3.0" prop-types "^15.6.0" -react-vis@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/react-vis/-/react-vis-1.10.1.tgz#e9b49474001186666b4094cfa8b0395f74b22df6" +react-vis@1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/react-vis/-/react-vis-1.10.2.tgz#7520bd31bb2f81a8faef49cc285f678fd0795242" dependencies: d3-array "^1.2.0" d3-collection "^1.0.3" @@ -8811,6 +8846,10 @@ safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + samsam@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" @@ -9956,9 +9995,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -ua-parser-js@^0.7.9: - version "0.7.17" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" +ua-parser-js@^0.7.18, ua-parser-js@^0.7.9: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" @@ -10538,8 +10577,8 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: iconv-lite "0.4.19" whatwg-fetch@>=0.10.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" whatwg-url@^6.4.0: version "6.4.0"