+
+
+ This component is still in Beta. We consider it to be reasonably stable, and welcome you to implament it,
+ but please be aware that breaking changes can come at any time with this component as such changes on beta
+ components does not necessitate a major version bump.
+
+
+
+
You can use EuiXYChart with EuiBarSeries to
displaying bar charts.
diff --git a/src-docs/src/views/xy_chart_histogram/histogram_example.js b/src-docs/src/views/xy_chart_histogram/histogram_example.js
index f151e40d0921..c5cdd5c4c1e1 100644
--- a/src-docs/src/views/xy_chart_histogram/histogram_example.js
+++ b/src-docs/src/views/xy_chart_histogram/histogram_example.js
@@ -19,6 +19,18 @@ export const XYChartHistogramExample = {
title: 'Histograms',
intro: (
+
+
+ This component is still in Beta. We consider it to be reasonably stable, and welcome you to implament it,
+ but please be aware that breaking changes can come at any time with this component as such changes on beta
+ components does not necessitate a major version bump.
+
+
+
+
You can use EuiXYChart with EuiHistogramSeries to
displaying histogram charts.
diff --git a/src-docs/src/views/xy_chart_line/line_example.js b/src-docs/src/views/xy_chart_line/line_example.js
index 2eb461624412..7544d650bc14 100644
--- a/src-docs/src/views/xy_chart_line/line_example.js
+++ b/src-docs/src/views/xy_chart_line/line_example.js
@@ -1,14 +1,30 @@
-import React from 'react';
+import React, { Fragment } from 'react';
import { GuideSectionTypes } from '../../components';
import LineChartExample from './line';
import CustomDomainLineChartExample from './custom_domain_line';
import MultiLineChartExample from './multi_line';
import CurvedLineChartExample from './curved_line';
import CustomStyleLineChartExample from './custom_style_line';
-import { EuiCode, EuiLineSeries, EuiLink } from '../../../../src/components';
+import { EuiCode, EuiLineSeries, EuiLink, EuiCallOut, EuiSpacer } from '../../../../src/components';
export const XYChartLineExample = {
title: 'Line chart',
+ intro: (
+
+
+
+ This component is still in Beta. We consider it to be reasonably stable, and welcome you to implament it,
+ but please be aware that breaking changes can come at any time with this component as such changes on beta
+ components does not necessitate a major version bump.
+
+
+
+
+
+ ),
sections: [
{
title: 'Line chart',
diff --git a/src-docs/src/views/xy_chart_line/multi_line.js b/src-docs/src/views/xy_chart_line/multi_line.js
index ba918494afb5..4a2bed0e284a 100644
--- a/src-docs/src/views/xy_chart_line/multi_line.js
+++ b/src-docs/src/views/xy_chart_line/multi_line.js
@@ -2,7 +2,7 @@ import React from 'react';
import { EuiXYChart, EuiLineSeries } from '../../../../src/components';
-const DATA_A = [{ x: 0, y: 1 }, { x: 1, y: 1 }, { x: 2, y: 2 }, { x: 3, y: -1 }, { x: 5, y: 2 }];
+const DATA_A = [{ x: 0, y: 1 }, { x: 1.5, y: 1 }, { x: 2, y: 2 }, { x: 3, y: -1 }, { x: 5, y: 2 }];
const DATA_B = [{ x: 0, y: 3 }, { x: 1, y: 4 }, { x: 2, y: 1 }, { x: 3, y: 2 }, { x: 5, y: 5 }];
export default () => (
diff --git a/src/components/index.js b/src/components/index.js
index 08bcd251f436..8a6e790e1208 100644
--- a/src/components/index.js
+++ b/src/components/index.js
@@ -37,16 +37,8 @@ export {
} from './call_out';
export {
-<<<<<<< HEAD
EuiCard,
} from './card';
-=======
- EuiChart,
- EuiLine,
- EuiArea,
- EuiBar
-} from './chart';
->>>>>>> finish commit
export {
EuiCode,
@@ -316,6 +308,27 @@ export {
EuiToolTip,
} from './tool_tip';
+export {
+ EuiXYChart,
+ EuiXYChartUtils,
+ EuiXYChartAxisUtils,
+ EuiXYChartTextUtils,
+ EuiLineSeries,
+ EuiAreaSeries,
+ EuiBarSeries,
+ EuiHistogramSeries,
+ EuiVerticalBarSeries,
+ EuiHorizontalBarSeries,
+ EuiVerticalRectSeries,
+ EuiHorizontalRectSeries,
+ EuiDefaultAxis,
+ EuiXAxis,
+ EuiYAxis,
+ EuiCrosshairX,
+ EuiCrosshairY,
+ EuiLineAnnotation,
+} from './xy_chart';
+
export {
EuiHideFor,
EuiShowFor,
diff --git a/src/components/index.scss b/src/components/index.scss
index 430eed71e5aa..6338c413808b 100644
--- a/src/components/index.scss
+++ b/src/components/index.scss
@@ -11,7 +11,6 @@
@import 'breadcrumbs/index';
@import 'call_out/index';
@import 'card/index';
-@import 'chart/index';
@import 'code/index';
@import 'code_editor/index';
@import 'color_picker/index';
diff --git a/src/components/xy_chart/axis/default_axis.test.js b/src/components/xy_chart/axis/default_axis.test.js
index 14e4b04e930f..3ecf82f1ff29 100644
--- a/src/components/xy_chart/axis/default_axis.test.js
+++ b/src/components/xy_chart/axis/default_axis.test.js
@@ -9,7 +9,7 @@ import { ORIENTATION } from '../utils/chart_utils';
describe('EuiDefaultAxis', () => {
test('render default axis', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const component = mount(
{
expect(component.render()).toMatchSnapshot();
});
test('render rotated 90deg default axis', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const component = mount(
{
expect(component.find(EuiVerticalGrid)).toHaveLength(1);
expect(component.find(EuiHorizontalGrid)).toHaveLength(0);
expect(component.render()).toMatchSnapshot();
- })
+ });
});
diff --git a/src/components/xy_chart/axis/horizontal_grid.js b/src/components/xy_chart/axis/horizontal_grid.js
index 467ad65a290e..29b6856b157a 100644
--- a/src/components/xy_chart/axis/horizontal_grid.js
+++ b/src/components/xy_chart/axis/horizontal_grid.js
@@ -10,7 +10,7 @@ export class EuiHorizontalGrid extends PureComponent {
- )
+ );
}
}
diff --git a/src/components/xy_chart/axis/horizontal_grid.test.js b/src/components/xy_chart/axis/horizontal_grid.test.js
index 8e85335355d4..a9b3f1eee630 100644
--- a/src/components/xy_chart/axis/horizontal_grid.test.js
+++ b/src/components/xy_chart/axis/horizontal_grid.test.js
@@ -8,7 +8,7 @@ import { requiredProps } from '../../../test/required_props';
describe('EuiHorizontalGrid', () => {
test('render the horizontal grid', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const width = 600;
const component = mount(
{
);
- const horizontalGridComponent = component.find(EuiHorizontalGrid)
+ const horizontalGridComponent = component.find(EuiHorizontalGrid);
expect(horizontalGridComponent).toHaveLength(1);
const firstLineProps = horizontalGridComponent.find('line').at(0).props();
expect(firstLineProps.y1).toEqual(firstLineProps.y2);
diff --git a/src/components/xy_chart/axis/vertical_grid.js b/src/components/xy_chart/axis/vertical_grid.js
index d4759ab1597e..657e519c9afd 100644
--- a/src/components/xy_chart/axis/vertical_grid.js
+++ b/src/components/xy_chart/axis/vertical_grid.js
@@ -10,7 +10,7 @@ export class EuiVerticalGrid extends PureComponent {
- )
+ );
}
}
diff --git a/src/components/xy_chart/axis/vertical_grid.test.js b/src/components/xy_chart/axis/vertical_grid.test.js
index 7cad5fc76bc3..a4a21e18c03b 100644
--- a/src/components/xy_chart/axis/vertical_grid.test.js
+++ b/src/components/xy_chart/axis/vertical_grid.test.js
@@ -8,7 +8,7 @@ import { requiredProps } from '../../../test/required_props';
describe('EuiVerticalGrid', () => {
test('render the vertical grid', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const height = 200;
const component = mount(
{
);
- const verticalGridComponent = component.find(EuiVerticalGrid)
+ const verticalGridComponent = component.find(EuiVerticalGrid);
expect(verticalGridComponent).toHaveLength(1);
const firstLineProps = verticalGridComponent.find('line').at(0).props();
expect(firstLineProps.x1).toEqual(firstLineProps.x2);
diff --git a/src/components/xy_chart/axis/x_axis.test.js b/src/components/xy_chart/axis/x_axis.test.js
index 1e7e48677aa3..e46e74b9245b 100644
--- a/src/components/xy_chart/axis/x_axis.test.js
+++ b/src/components/xy_chart/axis/x_axis.test.js
@@ -8,7 +8,7 @@ import { requiredProps } from '../../../test/required_props';
describe('EuiXAxis', () => {
test('render the x axis', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const height = 200;
const component = mount(
{
test('render the y axis', () => {
- const data = [ { x:0, y: 1 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1 }, { x: 1, y: 2 }];
const height = 200;
const component = mount(
{
@@ -59,7 +59,7 @@ export class EuiCrosshairX extends AbstractSeries {
if (xType === SCALE.TIME || xType === SCALE.TIME_UTC) {
return new Date(x).toISOString(); // TODO add a props for time formatting
} else {
- return x
+ return x;
}
}
@@ -73,7 +73,7 @@ export class EuiCrosshairX extends AbstractSeries {
return {
title: 'X Value',
value,
- }
+ };
}
}
@@ -134,7 +134,7 @@ export class EuiCrosshairX extends AbstractSeries {
minDistance = newDistance;
value = item;
}
- globalMinDistance = Math.min(globalMinDistance, minDistance)
+ globalMinDistance = Math.min(globalMinDistance, minDistance);
});
if (!value) {
@@ -174,7 +174,7 @@ export class EuiCrosshairX extends AbstractSeries {
}
render() {
- const { values } = this.state
+ const { values } = this.state;
return (
- )
+ );
}
}
@@ -201,5 +201,5 @@ EuiCrosshairX.propTypes = {
* The ordered array of series names
*/
seriesNames: PropTypes.arrayOf(PropTypes.string).isRequired,
-}
+};
EuiCrosshairX.defaultProps = {};
diff --git a/src/components/xy_chart/crosshairs/crosshair_x.test.js b/src/components/xy_chart/crosshairs/crosshair_x.test.js
index 6be14ccd6213..4a8246a039db 100644
--- a/src/components/xy_chart/crosshairs/crosshair_x.test.js
+++ b/src/components/xy_chart/crosshairs/crosshair_x.test.js
@@ -8,7 +8,7 @@ import { requiredProps } from '../../../test/required_props';
import { Crosshair } from 'react-vis';
describe('EuiCrosshairX', () => {
test('render the X crosshair', () => {
- const data = [ { x:0, y: 1.5 }, { x:1, y: 2 }];
+ const data = [ { x: 0, y: 1.5 }, { x: 1, y: 2 }];
const component = mount(
{
component.find('rect').at(0).simulate('mousemove', { nativeEvent: { clientX: 50, clientY: 100 } });
expect(component.find(Crosshair).children()).toHaveLength(1);
- const crosshair = component.find('.rv-crosshair')
+ const crosshair = component.find('.rv-crosshair');
expect(crosshair).toHaveLength(1);
expect(crosshair.find('.rv-crosshair__inner__content .rv-crosshair__title__value').text()).toBe('0');
expect(crosshair.find('.rv-crosshair__inner__content .rv-crosshair__item__value').text()).toBe('1.5');
diff --git a/src/components/xy_chart/crosshairs/crosshair_y.js b/src/components/xy_chart/crosshairs/crosshair_y.js
index ab7354d3686c..108cd3207515 100644
--- a/src/components/xy_chart/crosshairs/crosshair_y.js
+++ b/src/components/xy_chart/crosshairs/crosshair_y.js
@@ -169,13 +169,13 @@ export class CrosshairY extends PureComponent {
{children ?
- children :
-
-
- {this._renderCrosshairTitle()}
- {this._renderCrosshairItems()}
+ children :
+
+
+ {this._renderCrosshairTitle()}
+ {this._renderCrosshairItems()}
+
-
}
@@ -234,28 +234,28 @@ export class EuiCrosshairY extends AbstractSeries {
}
this.setState({
values: []
- })
+ });
}
_formatYValue = (y) => {
const { yType } = this.props;
- if ( yType === SCALE.TIME || yType === SCALE.TIME_UTC) {
+ if (yType === SCALE.TIME || yType === SCALE.TIME_UTC) {
return new Date(y).toISOString(); // TODO add a props for time formatting
} else {
- return y
+ return y;
}
}
_titleFormat = (dataPoints = []) => {
if (dataPoints.length > 0) {
- const [ firstDataPoint ] = dataPoints
- const { originalValues } = firstDataPoint
+ const [ firstDataPoint ] = dataPoints;
+ const { originalValues } = firstDataPoint;
const value = (typeof originalValues.y0 === 'number')
? `${this._formatYValue(originalValues.y0)} to ${this._formatYValue(originalValues.y)}`
: this._formatYValue(originalValues.y);
return {
title: 'Y Value',
value,
- }
+ };
}
}
@@ -315,7 +315,7 @@ export class EuiCrosshairY extends AbstractSeries {
minDistance = newDistance;
value = item;
}
- globalMinDistance = Math.min(globalMinDistance, minDistance)
+ globalMinDistance = Math.min(globalMinDistance, minDistance);
});
if (!value) {
@@ -355,7 +355,7 @@ export class EuiCrosshairY extends AbstractSeries {
}
render() {
- const { values } = this.state
+ const { values } = this.state;
return (
- )
+ );
}
}
@@ -382,5 +382,5 @@ EuiCrosshairY.propTypes = {
* The ordered array of series names
*/
seriesNames: PropTypes.arrayOf(PropTypes.string).isRequired,
-}
+};
EuiCrosshairY.defaultProps = {};
diff --git a/src/components/xy_chart/crosshairs/crosshair_y.test.js b/src/components/xy_chart/crosshairs/crosshair_y.test.js
index 0b74298bdb33..6a580544dd20 100644
--- a/src/components/xy_chart/crosshairs/crosshair_y.test.js
+++ b/src/components/xy_chart/crosshairs/crosshair_y.test.js
@@ -9,7 +9,7 @@ import { requiredProps } from '../../../test/required_props';
describe('EuiCrosshairY', () => {
test('render the Y crosshair', () => {
- const data = [ { x:1.5, y: 0 }, { x:2, y: 1 }];
+ const data = [ { x: 1.5, y: 0 }, { x: 2, y: 1 }];
const component = mount(
{
component.find('rect').at(0).simulate('mousemove', { nativeEvent: { clientX: 100, clientY: 0 } });
expect(component.find(CrosshairY).children()).toHaveLength(1);
- const crosshair = component.find('.rv-crosshair')
+ const crosshair = component.find('.rv-crosshair');
expect(crosshair).toHaveLength(1);
expect(crosshair.find('.rv-crosshair__inner__content .rv-crosshair__title__value').text()).toBe('1');
expect(crosshair.find('.rv-crosshair__inner__content .rv-crosshair__item__value').text()).toBe('2');
diff --git a/src/components/xy_chart/selection_brush.js b/src/components/xy_chart/selection_brush.js
index 6b86fa7b353a..63c1f0d0b7c0 100644
--- a/src/components/xy_chart/selection_brush.js
+++ b/src/components/xy_chart/selection_brush.js
@@ -117,10 +117,10 @@ export class EuiSelectionBrush extends AbstractSeries {
onBrushing(drawAndRectAreas);
}
} else {
- this.setState(() => ({
- drawing: false,
- ...DEFAULT_AREAS,
- }));
+ this.setState(() => ({
+ drawing: false,
+ ...DEFAULT_AREAS,
+ }));
}
}
@@ -213,4 +213,4 @@ EuiSelectionBrush.defaultProps = {
orientation: HORIZONTAL,
color: 'black',
opacity: 0.2,
-}
+};
diff --git a/src/components/xy_chart/selection_brush.test.js b/src/components/xy_chart/selection_brush.test.js
index 786b7a515ac6..dd1bd5ce4b74 100644
--- a/src/components/xy_chart/selection_brush.test.js
+++ b/src/components/xy_chart/selection_brush.test.js
@@ -33,9 +33,15 @@ describe('EuiSelectionBrush', () => {
let selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.exists()).toBe(true);
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousedown', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 } });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousedown', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush).toMatchSnapshot();
@@ -68,9 +74,15 @@ describe('EuiSelectionBrush', () => {
);
let selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.exists()).toBe(true);
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top +50 } });
- component.find('svg').at(0).simulate('mousedown', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top +50 } });
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top +100 } });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousedown', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100
+ } });
selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush).toMatchSnapshot();
@@ -78,7 +90,9 @@ describe('EuiSelectionBrush', () => {
expect(selectionBrush.find('rect').at(0).props().y).toBe(50);
expect(selectionBrush.find('rect').at(0).props().width).toBe(600 - DEFAULT_MARGINS.left - DEFAULT_MARGINS.right);
expect(selectionBrush.find('rect').at(0).props().height).toBe(50);
- component.find('svg').at(0).simulate('mouseup', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top +100 } });
+ component.find('svg').at(0).simulate('mouseup', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.find('rect').at(0).props().x).toBe(0);
expect(selectionBrush.find('rect').at(0).props().y).toBe(0);
@@ -102,9 +116,15 @@ describe('EuiSelectionBrush', () => {
);
let selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.exists()).toBe(true);
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousedown', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 } });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousedown', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush).toMatchSnapshot();
@@ -112,7 +132,9 @@ describe('EuiSelectionBrush', () => {
expect(selectionBrush.find('rect').at(0).props().y).toBe(50);
expect(selectionBrush.find('rect').at(0).props().width).toBe(50);
expect(selectionBrush.find('rect').at(0).props().height).toBe(50);
- component.find('svg').at(0).simulate('mouseup', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 } });
+ component.find('svg').at(0).simulate('mouseup', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.find('rect').at(0).props().x).toBe(0);
expect(selectionBrush.find('rect').at(0).props().y).toBe(0);
@@ -138,10 +160,18 @@ describe('EuiSelectionBrush', () => {
);
let selectionBrush = component.find(EuiSelectionBrush);
expect(selectionBrush.exists()).toBe(true);
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousedown', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 } });
- component.find('svg').at(0).simulate('mousemove', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 } });
- component.find('svg').at(0).simulate('mouseup', { nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 } });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousedown', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 50, offsetY: DEFAULT_MARGINS.top + 50 }
+ });
+ component.find('svg').at(0).simulate('mousemove', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
+ component.find('svg').at(0).simulate('mouseup', {
+ nativeEvent: { offsetX: DEFAULT_MARGINS.left + 100, offsetY: DEFAULT_MARGINS.top + 100 }
+ });
selectionBrush = component.find(EuiSelectionBrush);
expect(onSelectionBrushEndMock.mock.calls.length).toBe(1);
const expectedBrush = {
@@ -158,7 +188,7 @@ describe('EuiSelectionBrush', () => {
y1: 100,
}
};
- expect(onSelectionBrushEndMock.mock.calls[0][0]).toEqual(expectedBrush)
+ expect(onSelectionBrushEndMock.mock.calls[0][0]).toEqual(expectedBrush);
});
test.skip(`get onSelectionBrushEnd call on ordinal x scale`, () => {
const data = [{ x: 0, y: 2 }, { x: 1, y: 4 }];
@@ -200,6 +230,6 @@ describe('EuiSelectionBrush', () => {
y1: 100,
}
};
- expect(onSelectionBrushEndMock.mock.calls[0][0]).toEqual(expectedBrush)
+ expect(onSelectionBrushEndMock.mock.calls[0][0]).toEqual(expectedBrush);
});
});
diff --git a/src/components/xy_chart/series/area_series.test.js b/src/components/xy_chart/series/area_series.test.js
index 98fe6d1b1480..4b63f09b5145 100644
--- a/src/components/xy_chart/series/area_series.test.js
+++ b/src/components/xy_chart/series/area_series.test.js
@@ -74,7 +74,7 @@ describe('EuiAreaSeries', () => {
- )
+ );
}
const runtime = benchmarkFunction(renderChart);
@@ -111,7 +111,7 @@ describe('EuiAreaSeries', () => {
))}
- )
+ );
}
const runtime = benchmarkFunction(renderChart);
diff --git a/src/components/xy_chart/series/bar_series.js b/src/components/xy_chart/series/bar_series.js
index c33a5c24c2b1..e9bfa306dccb 100644
--- a/src/components/xy_chart/series/bar_series.js
+++ b/src/components/xy_chart/series/bar_series.js
@@ -11,10 +11,10 @@ export class EuiBarSeries extends AbstractSeries {
isMouseOverValue: false,
}
static getParentConfig(attr, props) {
- const { _orientation } = props;
- return _orientation === ORIENTATION.HORIZONTAL
- ? HorizontalBarSeries.getParentConfig(attr)
- : VerticalBarSeries.getParentConfig(attr);
+ const { _orientation } = props;
+ return _orientation === ORIENTATION.HORIZONTAL
+ ? HorizontalBarSeries.getParentConfig(attr)
+ : VerticalBarSeries.getParentConfig(attr);
}
_onValueMouseOver = () => {
this.setState(() => ({ isMouseOverValue: true }));
diff --git a/src/components/xy_chart/series/histogram_series.js b/src/components/xy_chart/series/histogram_series.js
index a39f594403c9..a18a1e4cc0a7 100644
--- a/src/components/xy_chart/series/histogram_series.js
+++ b/src/components/xy_chart/series/histogram_series.js
@@ -10,10 +10,10 @@ export class EuiHistogramSeries extends AbstractSeries {
isMouseOverValue: false,
}
static getParentConfig(attr, props) {
- const { _orientation } = props;
- return _orientation === ORIENTATION.HORIZONTAL
- ? HorizontalRectSeries.getParentConfig(attr)
- : VerticalRectSeries.getParentConfig(attr);
+ const { _orientation } = props;
+ return _orientation === ORIENTATION.HORIZONTAL
+ ? HorizontalRectSeries.getParentConfig(attr)
+ : VerticalRectSeries.getParentConfig(attr);
}
_onValueMouseOver = () => {
this.setState(() => ({ isMouseOverValue: true }));
diff --git a/src/components/xy_chart/series/horizontal_bar_series.test.js b/src/components/xy_chart/series/horizontal_bar_series.test.js
index c19b6e9e65c4..a4634ec71563 100644
--- a/src/components/xy_chart/series/horizontal_bar_series.test.js
+++ b/src/components/xy_chart/series/horizontal_bar_series.test.js
@@ -23,20 +23,20 @@ describe('EuiHorizontalBarSeries', () => {
expect(component.find('.rv-xy-plot__series')).toHaveLength(1);
- const rects = component.find('.rv-xy-plot__series--bar rect')
+ const rects = component.find('.rv-xy-plot__series--bar rect');
expect(rects).toHaveLength(2);
- const firstRectProps = rects.at(0).props()
- expect(firstRectProps.x).toBeDefined()
- expect(firstRectProps.y).toBeDefined()
- expect(firstRectProps.width).toBeDefined()
- expect(firstRectProps.height).toBeDefined()
+ const firstRectProps = rects.at(0).props();
+ expect(firstRectProps.x).toBeDefined();
+ expect(firstRectProps.y).toBeDefined();
+ expect(firstRectProps.width).toBeDefined();
+ expect(firstRectProps.height).toBeDefined();
- const secondRectProps = rects.at(1).props()
- expect(secondRectProps.x).toBeDefined()
- expect(secondRectProps.y).toBeDefined()
- expect(secondRectProps.width).toBeDefined()
- expect(secondRectProps.height).toBeDefined()
+ const secondRectProps = rects.at(1).props();
+ expect(secondRectProps.x).toBeDefined();
+ expect(secondRectProps.y).toBeDefined();
+ expect(secondRectProps.width).toBeDefined();
+ expect(secondRectProps.height).toBeDefined();
expect(component.render()).toMatchSnapshot();
});
diff --git a/src/components/xy_chart/series/horizontal_rect_series.test.js b/src/components/xy_chart/series/horizontal_rect_series.test.js
index 2e8389748d4b..fdc5df469f84 100644
--- a/src/components/xy_chart/series/horizontal_rect_series.test.js
+++ b/src/components/xy_chart/series/horizontal_rect_series.test.js
@@ -23,20 +23,20 @@ describe('EuiHorizontalRectSeries', () => {
expect(component.find('.rv-xy-plot__series')).toHaveLength(1);
- const rects = component.find('.rv-xy-plot__series--rect rect')
+ const rects = component.find('.rv-xy-plot__series--rect rect');
expect(rects).toHaveLength(2);
- const firstRectProps = rects.at(0).props()
- expect(firstRectProps.x).toBeDefined()
- expect(firstRectProps.y).toBeDefined()
- expect(firstRectProps.width).toBeDefined()
- expect(firstRectProps.height).toBeDefined()
+ const firstRectProps = rects.at(0).props();
+ expect(firstRectProps.x).toBeDefined();
+ expect(firstRectProps.y).toBeDefined();
+ expect(firstRectProps.width).toBeDefined();
+ expect(firstRectProps.height).toBeDefined();
- const secondRectProps = rects.at(1).props()
- expect(secondRectProps.x).toBeDefined()
- expect(secondRectProps.y).toBeDefined()
- expect(secondRectProps.width).toBeDefined()
- expect(secondRectProps.height).toBeDefined()
+ const secondRectProps = rects.at(1).props();
+ expect(secondRectProps.x).toBeDefined();
+ expect(secondRectProps.y).toBeDefined();
+ expect(secondRectProps.width).toBeDefined();
+ expect(secondRectProps.height).toBeDefined();
expect(component.render()).toMatchSnapshot();
});
diff --git a/src/components/xy_chart/series/line_series.js b/src/components/xy_chart/series/line_series.js
index fff016674beb..047cf185d6c8 100644
--- a/src/components/xy_chart/series/line_series.js
+++ b/src/components/xy_chart/series/line_series.js
@@ -62,7 +62,7 @@ export class EuiLineSeries extends AbstractSeries {
/>
)}
- )
+ );
}
}
diff --git a/src/components/xy_chart/series/line_series.test.js b/src/components/xy_chart/series/line_series.test.js
index 104725cf33d5..6fc92066b53d 100644
--- a/src/components/xy_chart/series/line_series.test.js
+++ b/src/components/xy_chart/series/line_series.test.js
@@ -95,7 +95,7 @@ describe('EuiLineSeries', () => {
- )
+ );
}
const runtime = benchmarkFunction(renderChart);
@@ -132,7 +132,7 @@ describe('EuiLineSeries', () => {
))}