Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link XYChart components to experimental directory #975

Merged
merged 3 commits into from
Jul 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Changed `EuiXYChart` components exports to `/experimental` subfolder ([#975](https://github.com/elastic/eui/pull/975))
- Added beta version of `EuiXYChart` and associated components ([#309](https://github.com/elastic/eui/pull/309))

**Bug fixes**
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/components/guide_section/guide_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ export class GuideSection extends Component {
const { code } = this.props.source.find(sourceObject => sourceObject.type === name);
const npmImports = code
.replace(/(from )'(..\/)+src\/components(\/?';)/, `from '@elastic/eui';`)
.replace(/(from )'(..\/)+src\/services(\/?';)/, `from '@elastic/eui/services';`);
.replace(/(from )'(..\/)+src\/services(\/?';)/, `from '@elastic/eui/lib/services';`)
.replace(/(from )'(..\/)+src\/experimental(\/?';)/, `from '@elastic/eui/lib/experimental';`);

return (
<div key={name} ref={name}>
Expand Down
8 changes: 5 additions & 3 deletions src-docs/src/views/xy_chart/complex.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { Fragment, Component } from 'react';

import {
EuiText,
EuiCodeBlock,
EuiSpacer,
EuiXYChart,
EuiBarSeries,
EuiAreaSeries,
EuiLineSeries,
} from '../../../../src/experimental';
import {
EuiText,
EuiCodeBlock,
EuiSpacer,
} from '../../../../src/components';

const barSeries = [];
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart/crosshair_sync.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { EuiSpacer, EuiXYChart, EuiBarSeries } from '../../../../src/components';
import { EuiSpacer } from '../../../../src/components';
import { EuiXYChart, EuiBarSeries } from '../../../../src/experimental';

// eslint-disable-next-line
export class ExampleCrosshair extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart/empty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

import { EuiXYChart } from '../../../../src/components';
import { EuiXYChart } from '../../../../src/experimental';

export default () => <EuiXYChart width={600} height={200} statusText="Missing data"/>;
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart/horizontal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
EuiAreaSeries,
EuiLineSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';
const { ORIENTATION } = EuiXYChartUtils;

const data = new Array(80).fill(0).map((d, i) => {
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart/multi_axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EuiXAxis,
EuiYAxis,
EuiXYChartAxisUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';
import { VISUALIZATION_COLORS } from '../../../../src/services';


Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart/xy_chart_example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Fragment } from 'react';
import { GuideSectionTypes } from '../../components';
import { EuiCode, EuiXYChart, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiCode, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiXYChart } from '../../../../src/experimental';
import ComplexChartExampleCode from './complex';
import EmptyExampleCode from './empty';
import MultiAxisChartExampleCode from './multi_axis';
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_area/area.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiAreaSeries } from '../../../../src/components';
import { EuiXYChart, EuiAreaSeries } from '../../../../src/experimental';

const DATA_A = [{ x: 0, y: 1 }, { x: 1, y: 1 }, { x: 2, y: 2 }, { x: 3, y: 1 }, { x: 5, y: 2 }];

Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart_area/area_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import AreaSeriesExample from './area';
import StackedAreaSeriesExample from './stacked_area';
import CurvedAreaExample from './curved_area';
import RangeAreaExample from './range_area';
import { EuiCode, EuiAreaSeries, EuiLink, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiCode, EuiLink, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiAreaSeries } from '../../../../src/experimental';

export const XYChartAreaExample = {
title: 'Area chart',
Expand Down
6 changes: 5 additions & 1 deletion src-docs/src/views/xy_chart_area/curved_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import {
EuiFormRow,
EuiSelect,
EuiSpacer,
} from '../../../../src/components';

import {
EuiXYChart,
EuiAreaSeries,
} from '../../../../src/components';
} from '../../../../src/experimental';


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_B = [{ x: 0, y: 3 }, { x: 1, y: 2 }, { x: 2, y: 4 }, { x: 3, y: 1 }, { x: 5, y: 3 }];
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_area/range_area.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiAreaSeries, EuiLineSeries } from '../../../../src/components';
import { EuiXYChart, EuiAreaSeries, EuiLineSeries } from '../../../../src/experimental';

const LINE_DATA = new Array(100).fill(0).map((d, i) => ({ x: i, y: Math.random() * 2 + 8 }));
const AREA_DATA = LINE_DATA.map(({ x, y })=> ({ x, y0: y - Math.random() - 2, y: y + Math.random() + 2 }));
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_area/stacked_area.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiAreaSeries } from '../../../../src/components';
import { EuiXYChart, EuiAreaSeries } from '../../../../src/experimental';

const dataA = [{ x: 0, y: 3 }, { x: 1, y: 2 }, { x: 2, y: 1 }, { x: 3, y: 2 }, { x: 4, y: 3 }];

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_axis/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EuiLineAnnotation,
EuiXYChartUtils,
EuiXYChartAxisUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const DATA_A = [
{ x: 0, y: 1 },
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_axis/simple_axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
EuiXYChart,
EuiXYChartAxisUtils,
EuiXYChartTextUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const DATA = [{ x: 0, y: 5 }, { x: 1, y: 3 }, { x: 2, y: 2 }, { x: 3, y: 3 }];

Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart_axis/xy_axis_example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Fragment } from 'react';
import { GuideSectionTypes } from '../../components';
import { EuiCode, EuiXAxis, EuiYAxis, EuiLineAnnotation, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiCode, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiXAxis, EuiYAxis, EuiLineAnnotation } from '../../../../src/experimental';
import SimpleAxisExampleCode from './simple_axis';
import AnnotationExampleCode from './annotations';

Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart_bar/bar_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import StackedVerticalBarSeriesExample from './stacked_vertical_bar_series';
import StackedHorizontalBarSeriesExample from './stacked_horizontal_bar_series';
import TimeSeriesExample from './time_series';

import { EuiBadge, EuiCallOut, EuiSpacer, EuiLink, EuiCode, EuiBarSeries } from '../../../../src/components';
import { EuiBadge, EuiCallOut, EuiSpacer, EuiLink, EuiCode } from '../../../../src/components';
import { EuiBarSeries } from '../../../../src/experimental';

export const XYChartBarExample = {
title: 'Bar charts',
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_bar/horizontal_bar_series.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiBarSeries, EuiXYChartUtils } from '../../../../src/components';
import { EuiXYChart, EuiBarSeries, EuiXYChartUtils } from '../../../../src/experimental';

const { SCALE, ORIENTATION } = EuiXYChartUtils;
const data = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import React, { Component, Fragment } from 'react';
import {
EuiSpacer,
EuiButton,
} from '../../../../src/components';
import {
EuiXYChart,
EuiBarSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const { ORIENTATION, SCALE } = EuiXYChartUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import React, { Component, Fragment } from 'react';
import {
EuiSpacer,
EuiButton,
} from '../../../../src/components';

import {
EuiXYChart,
EuiBarSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const { SCALE } = EuiXYChartUtils;

Expand Down
4 changes: 3 additions & 1 deletion src-docs/src/views/xy_chart_bar/time_series.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import React, { Component, Fragment } from 'react';
import {
EuiButton,
EuiSpacer,
} from '../../../../src/components';
import {
EuiXYChart,
EuiLineSeries,
EuiBarSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const { SCALE } = EuiXYChartUtils;
const timestamp = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_bar/vertical_bar_series.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiBarSeries, EuiXYChartUtils } from '../../../../src/components';
import { EuiXYChart, EuiBarSeries, EuiXYChartUtils } from '../../../../src/experimental';
const { SCALE } = EuiXYChartUtils;
const data = [
{ x: 'A', y: 3 },
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_histogram/histogram_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
EuiCode,
EuiCallOut,
EuiLink,
EuiHistogramSeries,
} from '../../../../src/components';
import { EuiHistogramSeries } from '../../../../src/experimental';

export const XYChartHistogramExample = {
title: 'Histograms',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiHistogramSeries, EuiXYChartUtils } from '../../../../src/components';
import { EuiXYChart, EuiHistogramSeries, EuiXYChartUtils } from '../../../../src/experimental';

const data = [
{ x: 3, y: 0, y0: 1 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiHistogramSeries, EuiXYChartUtils } from '../../../../src/components';
import { EuiXYChart, EuiHistogramSeries, EuiXYChartUtils } from '../../../../src/experimental';

const dataA = [
{ y: 0, y0: 1, x: 1 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiHistogramSeries } from '../../../../src/components';
import { EuiXYChart, EuiHistogramSeries } from '../../../../src/experimental';

const dataA = [
{ x0: 0, x: 1, y: 1 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import React, { Component, Fragment } from 'react';
import {
EuiButton,
EuiSpacer,
} from '../../../../src/components';
import {
EuiXYChart,
EuiHistogramSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const { SCALE } = EuiXYChartUtils;
const timestamp = Date.now();
const ONE_HOUR = 3600000;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiHistogramSeries } from '../../../../src/components';
import { EuiXYChart, EuiHistogramSeries } from '../../../../src/experimental';

const data = [
{ x0: 0, x: 1, y: 1 },
Expand Down
4 changes: 3 additions & 1 deletion src-docs/src/views/xy_chart_line/curved_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import {
EuiFormRow,
EuiSelect,
EuiSpacer,
} from '../../../../src/components';
import {
EuiXYChart,
EuiLineSeries,
EuiXYChartUtils,
} from '../../../../src/components';
} from '../../../../src/experimental';

const {
LINEAR,
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_line/custom_domain_line.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiLineSeries } from '../../../../src/components';
import { EuiXYChart, EuiLineSeries } from '../../../../src/experimental';

const X_DOMAIN = [-1, 6];
const Y_DOMAIN = [0, 3];
Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/xy_chart_line/custom_style_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import {
EuiFormRow,
EuiRange,
EuiSpacer,
EuiXYChart,
EuiLineSeries,
EuiCheckboxGroup,
} from '../../../../src/components';
import {
EuiXYChart,
EuiLineSeries,
} from '../../../../src/experimental';

import makeId from '../../../../src/components/form/form_row/make_id';

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_line/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import {
EuiXYChart,
EuiLineSeries,
} from '../../../../src/components';
} from '../../../../src/experimental';

const DATA_A = [
{ x: 0, y: 1 },
Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/xy_chart_line/line_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiCode, EuiLink, EuiCallOut, EuiSpacer } from '../../../../src/components';
import { EuiLineSeries } from '../../../../src/experimental';

export const XYChartLineExample = {
title: 'Line chart',
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/xy_chart_line/multi_line.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { EuiXYChart, EuiLineSeries } from '../../../../src/components';
import { EuiXYChart, EuiLineSeries } from '../../../../src/experimental';

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 }];
Expand Down
22 changes: 0 additions & 22 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,29 +308,7 @@ 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,
} from './responsive';

20 changes: 20 additions & 0 deletions src/experimental/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export {
EuiXYChart,
EuiXYChartUtils,
EuiXYChartAxisUtils,
EuiXYChartTextUtils,
EuiLineSeries,
EuiAreaSeries,
EuiBarSeries,
EuiHistogramSeries,
EuiVerticalBarSeries,
EuiHorizontalBarSeries,
EuiVerticalRectSeries,
EuiHorizontalRectSeries,
EuiDefaultAxis,
EuiXAxis,
EuiYAxis,
EuiCrosshairX,
EuiCrosshairY,
EuiLineAnnotation,
} from '../components/xy_chart';
Loading