diff --git a/.playground/playgroud.tsx b/.playground/playgroud.tsx index ea06707393..759a5c8e8c 100644 --- a/.playground/playgroud.tsx +++ b/.playground/playgroud.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { loremIpsum } from 'lorem-ipsum'; import { Axis, @@ -10,129 +9,103 @@ import { Position, ScaleType, Settings, - AreaSeries, - mergeWithDefaultTheme, + LineSeries, } from '../src'; import { KIBANA_METRICS } from '../src/utils/data_samples/test_dataset_kibana'; +import { CursorEvent } from '../src/specs/settings'; +import { CursorUpdateListener } from '../src/chart_types/xy_chart/store/chart_state'; export class Playground extends React.Component { + ref1 = React.createRef(); + ref2 = React.createRef(); + ref3 = React.createRef(); + + onCursorUpdate: CursorUpdateListener = (event?: CursorEvent) => { + this.ref1.current!.dispatchExternalCursorEvent(event); + this.ref2.current!.dispatchExternalCursorEvent(event); + this.ref3.current!.dispatchExternalCursorEvent(event); + }; + render() { - return <>{this.renderChart(Position.Bottom)}; + return ( + <> + {renderChart( + '1', + this.ref1, + KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 15), + this.onCursorUpdate, + true, + )} + {renderChart( + '2', + this.ref2, + KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(0, 15), + this.onCursorUpdate, + true, + )} + {renderChart('3', this.ref3, KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(15, 30), this.onCursorUpdate)} + + ); } - renderChart(legendPosition: Position) { - const renderMore = () => { - const random = Math.floor(Math.random() * 3) + 1; - const id = loremIpsum({ count: random, units: 'words' }); - return ( - , + data: any, + onCursorUpdate?: CursorUpdateListener, + timeSeries: boolean = false, +) { + return ( +
+ + + + d.toFixed(2)} /> + - ); - }; - const theme = mergeWithDefaultTheme({ - lineSeriesStyle: { - line: { - stroke: 'violet', - strokeWidth: 4, - }, - point: { - fill: 'yellow', - stroke: 'black', - strokeWidth: 2, - radius: 6, - }, - }, - }); - return ( -
- - - - d.toFixed(2)} /> - - - - - {Array(10) - .fill(null) - .map(renderMore)} - -
- ); - } + + +
+
+ ); } diff --git a/package.json b/package.json index 70b1940e0e..5ad6ddcd52 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "semantic-release": "semantic-release", "typecheck:src": "yarn build:ts --noEmit", "typecheck:all": "tsc -p ./tsconfig.json --noEmit", - "playground": "cd .playground && webpack-dev-server" + "playground": "cd .playground && webpack-dev-server", + "playground:ie": "cd .playground && webpack-dev-server --host=0.0.0.0 --disable-host-check --useLocalIp" }, "files": [ "dist/**/*", @@ -145,6 +146,7 @@ "yarn": "^1.10.1" }, "browserslist": [ - "last 2 versions" + "last 2 versions", + "ie 11" ] } diff --git a/src/components/_tooltip.scss b/src/components/_tooltip.scss index 9200337d28..5e0e379eb9 100644 --- a/src/components/_tooltip.scss +++ b/src/components/_tooltip.scss @@ -24,7 +24,8 @@ } &__label { - @include euiTextOverflowWrap; + overflow-wrap: break-word; + word-wrap: break-word; min-width: 1px; flex: 1 1 auto; }