Skip to content

Commit

Permalink
House-cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Jun 20, 2018
1 parent ec3862c commit 0509196
Show file tree
Hide file tree
Showing 51 changed files with 145 additions and 206 deletions.
24 changes: 13 additions & 11 deletions src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,6 @@ const navigation = [{
ToastExample,
ToolTipExample,
].map(example => createExample(example)),
}, {
name: 'Charts',
items: [
XYChartExample,
XYChartAxisExample,
XYChartLineExample,
XYChartAreaExample,
XYChartBarExample,
XYChartHistogramExample,
].map(example => createExample(example)),
}, {
name: 'Forms',
items: [
Expand All @@ -362,7 +352,19 @@ const navigation = [{
FilterGroupExample,
SearchBarExample,
].map(example => createExample(example)),
}, {
},
{
name: 'XY Charts',
items: [
XYChartExample,
XYChartAxisExample,
XYChartLineExample,
XYChartAreaExample,
XYChartBarExample,
XYChartHistogramExample,
].map(example => createExample(example)),
},
{
name: 'Utilities',
items: [
AccessibilityExample,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React from 'react';
import {
EuiXYChart,
EuiVerticalBarSeries,
EuiArea,
EuiLine,
EuiAreaSeries,
EuiLineSeries,
} from '../../../../src/components';

export default () => {
Expand All @@ -29,7 +29,7 @@ export default () => {
width={600}
height={200}
>
<EuiArea
<EuiAreaSeries
name="Quitters"
onClick={() => {
alert('clicked!');
Expand All @@ -54,7 +54,7 @@ export default () => {
data={data}
/>
))}
<EuiLine
<EuiLineSeries
name="Avg Winners"
data={[{ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }, { x: 3, y: 1 }, { x: 5, y: 2 }]}
color={'#db1374'}
Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions src-docs/src/views/xy_chart/example-auto-axis.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import {
EuiXYChart,
EuiLine,
EuiLineSeries,
EuiXAxis,
EuiYAxis,
EuiXYChartAxisUtils,
Expand All @@ -27,17 +27,17 @@ export default () => (
xType="ordinal"
showDefaultAxis={false}
>
<EuiLine
<EuiLineSeries
name="DATA A"
data={DATA_A}
yDomain={DATA_A_DOMAIN}
/>
<EuiLine
<EuiLineSeries
name="DATA B"
data={DATA_B}
yDomain={DATA_B_DOMAIN}
/>
<EuiLine
<EuiLineSeries
name="DATA C"
data={DATA_C}
yDomain={DATA_C_DOMAIN}
Expand Down
18 changes: 9 additions & 9 deletions src-docs/src/views/xy_chart/xy_chart_example.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { GuideSectionTypes } from '../../components';
import { EuiCode } from '../../../../src/components';
import ComplexChartExampleCode from './example-complex';
import EmptyExampleCode from './example-empty';
import MultiAxisChartExampleCode from './example_dual_axis';
import { ExampleCrosshair } from './example-crosshair';
import ComplexChartExampleCode from './complex';
import EmptyExampleCode from './empty';
import MultiAxisChartExampleCode from './multi_axis';
import { ExampleCrosshair } from './crosshair_sync';

export const XYChartExample = {
title: 'General',
Expand All @@ -15,15 +15,15 @@ export const XYChartExample = {
<div>
<p>
Use <EuiCode>EuiXYChart</EuiCode> to display line, bar, area, and stream charts. Note
that charts are composed with <EuiCode>EuiLine</EuiCode>, <EuiCode>EuiArea</EuiCode>,{' '}
that charts are composed with <EuiCode>EuiLineSeries</EuiCode>, <EuiCode>EuiAreaSeries</EuiCode>,{' '}
<EuiCode>EuiBar</EuiCode>, and <EuiCode>EuiStream</EuiCode> being child components.
</p>
</div>
),
source: [
{
type: GuideSectionTypes.JS,
code: require('!!raw-loader!./example-complex'),
code: require('!!raw-loader!./complex'),
},
{
type: GuideSectionTypes.HTML,
Expand All @@ -46,7 +46,7 @@ export const XYChartExample = {
source: [
{
type: GuideSectionTypes.JS,
code: require('!!raw-loader!./example-empty'),
code: require('!!raw-loader!./empty'),
},
{
type: GuideSectionTypes.HTML,
Expand All @@ -71,7 +71,7 @@ export const XYChartExample = {
source: [
{
type: GuideSectionTypes.JS,
code: require('!!raw-loader!./example-empty'),
code: require('!!raw-loader!./crosshair_sync'),
},
{
type: GuideSectionTypes.HTML,
Expand All @@ -94,7 +94,7 @@ export const XYChartExample = {
source: [
{
type: GuideSectionTypes.JS,
code: require('!!raw-loader!./example_dual_axis'),
code: require('!!raw-loader!./multi_axis'),
},
{
type: GuideSectionTypes.HTML,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/xy_chart_area/area.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import { EuiXYChart, EuiArea } from '../../../../src/components';
import { EuiXYChart, EuiAreaSeries } 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 }];

export default () => (
<EuiXYChart width={600} height={200}>
<EuiArea name="Users" data={DATA_A} />
<EuiAreaSeries name="Users" data={DATA_A} />
</EuiXYChart>
);
12 changes: 6 additions & 6 deletions 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,7 @@ import AreaSeriesExample from './area';
import StackedAreaSeriesExample from './stacked_area';
import CurvedAreaExample from './curved_area';

import { EuiCode, EuiArea, EuiLink } from '../../../../src/components';
import { EuiCode, EuiAreaSeries, EuiLink } from '../../../../src/components';

export const XYChartAreaExample = {
title: 'Area chart',
Expand All @@ -14,11 +14,11 @@ export const XYChartAreaExample = {
text: (
<div>
<p>
Use <EuiCode>EuiArea</EuiCode> to display area charts.
Use <EuiCode>EuiAreaSeries</EuiCode> to display area charts.
</p>
</div>
),
props: { EuiArea },
props: { EuiAreaSeries },
source: [
{
type: GuideSectionTypes.JS,
Expand All @@ -40,13 +40,13 @@ export const XYChartAreaExample = {
text: (
<div>
<p>
Use multiple <EuiCode>EuiArea</EuiCode> to display stacked area charts specifying the{' '}
Use multiple <EuiCode>EuiAreaSeries</EuiCode> to display stacked area charts specifying the{' '}
<EuiCode>stackBy:y</EuiCode> prop on the <EuiCode>EuiXYChart</EuiCode>
to enable stacking.
</p>
</div>
),
props: { EuiArea },
props: { EuiAreaSeries },
source: [
{
type: GuideSectionTypes.JS,
Expand Down Expand Up @@ -76,7 +76,7 @@ export const XYChartAreaExample = {
</p>
</div>
),
props: { EuiArea },
props: { EuiAreaSeries },
source: [
{
type: GuideSectionTypes.JS,
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/xy_chart_area/curved_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EuiSelect,
EuiSpacer,
EuiXYChart,
EuiArea,
EuiAreaSeries,
} 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 }];
Expand Down Expand Up @@ -52,8 +52,8 @@ export default class extends Component {
<EuiSpacer size="xl" />

<EuiXYChart width={600} height={200} stackBy="y">
<EuiArea name="Total Bytes A" data={DATA_A} curve={this.state.value} />
<EuiArea name="Total Bytes B" data={DATA_B} curve={this.state.value} />
<EuiAreaSeries name="Total Bytes A" data={DATA_A} curve={this.state.value} />
<EuiAreaSeries name="Total Bytes B" data={DATA_B} curve={this.state.value} />
</EuiXYChart>
</Fragment>
);
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/xy_chart_area/stacked_area.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';

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

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

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

export default () => (
<EuiXYChart width={600} height={200} stackBy="y">
<EuiArea name="Tag A" data={dataA} />
<EuiArea name="Tag B" data={dataB} />
<EuiAreaSeries name="Tag A" data={dataA} />
<EuiAreaSeries name="Tag B" data={dataB} />
</EuiXYChart>
);
4 changes: 2 additions & 2 deletions src-docs/src/views/xy_chart_axis/simple_axis.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {
EuiLine,
EuiLineSeries,
EuiXAxis,
EuiYAxis,
EuiXYChart,
Expand All @@ -17,7 +17,7 @@ function xAxisTickFormatter(value) {

export default () => (
<EuiXYChart width={600} height={200} xPadding={10} yPadding={10} showDefaultAxis={false}>
<EuiLine name="Total Bytes" data={DATA} />
<EuiLineSeries name="Total Bytes" data={DATA} />
<EuiYAxis title="Left Y Axis" tickLabelAngle={45} />
<EuiYAxis
title="Right Y Axis"
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/xy_chart_histogram/time_series.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';

import { EuiButton, EuiSpacer, EuiXYChart, EuiLine, EuiVerticalBarSeries } from '../../../../src/components';
import { EuiButton, EuiSpacer, EuiXYChart, EuiLineSeries, EuiVerticalBarSeries } from '../../../../src/components';

const timestamp = Date.now();
const ONE_HOUR = 3600000;
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class Example extends Component {
<EuiSpacer size="xl" />
<EuiXYChart width={600} height={200} xType="time">
{ data.map((d, i) => (<EuiVerticalBarSeries key={i} name={`Chart ${i}`} data={d} />))}
{ data.map((d, i) => (<EuiLine key={i} name={`Chart ${i}`} data={d} showLineMarks={false} />))}
{ data.map((d, i) => (<EuiLineSeries key={i} name={`Chart ${i}`} data={d} showLineMarks={false} />))}
</EuiXYChart>
</Fragment>
);
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/xy_chart_line/curved_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EuiSelect,
EuiSpacer,
EuiXYChart,
EuiLine,
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 }];
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class extends Component {
<EuiSpacer size="xl" />

<EuiXYChart width={600} height={200}>
<EuiLine name="Total Bytes" data={DATA_A} curve={this.state.value} />
<EuiLineSeries name="Total Bytes" data={DATA_A} curve={this.state.value} />
</EuiXYChart>
</Fragment>
);
Expand Down
4 changes: 2 additions & 2 deletions 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, EuiLine } from '../../../../src/components';
import { EuiXYChart, EuiLineSeries } from '../../../../src/components';

const X_DOMAIN = [-1, 6];
const Y_DOMAIN = [0, 3];
Expand All @@ -9,6 +9,6 @@ const DATA_A = [{ x: 0, y: 1 }, { x: 1, y: 1 }, { x: 2, y: 2 }, { x: 3, y: 1 },

export default () => (
<EuiXYChart width={600} height={200} yDomain={Y_DOMAIN} xDomain={X_DOMAIN}>
<EuiLine name="Total Bytes" data={DATA_A} />
<EuiLineSeries name="Total Bytes" data={DATA_A} />
</EuiXYChart>
);
4 changes: 2 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 @@ -6,7 +6,7 @@ import {
EuiRange,
EuiSpacer,
EuiXYChart,
EuiLine,
EuiLineSeries,
EuiCheckboxGroup,
} from '../../../../src/components';

Expand Down Expand Up @@ -100,7 +100,7 @@ export default class extends Component {
</EuiForm>
<EuiSpacer size="xl" />
<EuiXYChart width={600} height={200}>
<EuiLine
<EuiLineSeries
name="Total Bytes"
data={DATA_A}
lineSize={Number(lineSize)}
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/xy_chart_line/line.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

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

const DATA_A = [
{ x: 0, y: 1 },
Expand All @@ -13,6 +13,6 @@ const DATA_A = [

export default () => (
<EuiXYChart width={600} height={200}>
<EuiLine name="Total Bytes" data={DATA_A} />
<EuiLineSeries name="Total Bytes" data={DATA_A} />
</EuiXYChart>
);
Loading

0 comments on commit 0509196

Please sign in to comment.