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

docs: enable story source for current stories #557

Merged
merged 49 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f056b77
chore: add parsing action and split tooltipValues (#516)
markov00 Feb 13, 2020
2242fca
refactor: decouple legend and tooltip phase 1 (#491)
markov00 Feb 14, 2020
9cee43c
docs: add storysource addon and refactor scales
rshen91 Feb 19, 2020
8262d19
docs: fix filteredLabel ids (#552)
markov00 Feb 19, 2020
f084630
docs: clean up naming and text
rshen91 Feb 19, 2020
e3294fb
docs: separate annotation stories
rshen91 Feb 19, 2020
35e8d59
Merge remote-tracking branch 'upstream/master' into story-source
rshen91 Feb 19, 2020
a286ce7
docs: separate area stories
rshen91 Feb 19, 2020
5694f31
refactor: separate axis to separate stories
rshen91 Feb 19, 2020
d431230
refactor: separate bar chart stories to files
rshen91 Feb 19, 2020
4c3a6c5
refactor: separate grid stories to own files
rshen91 Feb 19, 2020
4377b4e
refactor: separate interactions stories into own file
rshen91 Feb 19, 2020
f27f0fa
refactor: separate legend stories
rshen91 Feb 19, 2020
8b3a2ea
refactor: separate line stories
rshen91 Feb 20, 2020
4429ce7
refactor: separate mixed stories
rshen91 Feb 20, 2020
1ed6957
refactor: decouple tooltip from XY chart (#553)
markov00 Feb 20, 2020
6f5ed7e
chore: merge commit
rshen91 Feb 20, 2020
bf5abc9
refactor: separate stylings
rshen91 Feb 20, 2020
b088b9e
refactor: separate rotations stories
rshen91 Feb 20, 2020
6aa3449
refactor: separate sunburst stories
rshen91 Feb 20, 2020
e380d7d
refactor: separate treemap stories
rshen91 Feb 20, 2020
2551270
fix: update test urls and fix webpack config to find new stories
rshen91 Feb 20, 2020
a57fb9f
fix: fixed webpack config to render charts and story source
rshen91 Feb 20, 2020
d25ba29
fix: fix typo in test
rshen91 Feb 20, 2020
d399e41
test: update some tests
rshen91 Feb 20, 2020
6da59fb
test: update file name
rshen91 Feb 20, 2020
b5d8489
fix: redux connect memo issue related to spec upserting (#563)
nickofthyme Feb 21, 2020
3071d93
Merge remote-tracking branch 'upstream/master' into story-source
rshen91 Feb 21, 2020
e553fb1
chore: merge commit
rshen91 Feb 21, 2020
a8236f6
Merge remote-tracking branch 'upstream/master' into story-source
rshen91 Feb 21, 2020
209344c
docs: change the way of loading stories
markov00 Feb 24, 2020
5f0e44f
docs: remove VRT baselines
markov00 Feb 24, 2020
1eb1986
docs: recovered baseline from master
markov00 Feb 24, 2020
dfadb5a
docs: renamed all.stories scales baselines
markov00 Feb 24, 2020
1aeb5c2
docs: fixed annotation stories
markov00 Feb 24, 2020
4efe3b2
docs: updated area vrt file names
markov00 Feb 24, 2020
968f7d7
test: fix axes stories
markov00 Feb 24, 2020
15e4ea6
test: fix bars stories
markov00 Feb 24, 2020
1feacdf
test: fix grids stories
markov00 Feb 24, 2020
8f2a635
test: fix interactions stories
markov00 Feb 24, 2020
21c1fc8
test: fix legend stories
markov00 Feb 24, 2020
fdcb192
test: fix remaining stories
markov00 Feb 24, 2020
03c227c
test: fixed remaining stories
markov00 Feb 24, 2020
6d791da
Merge branch 'master' into pr/557
markov00 Feb 24, 2020
cf5bfa3
fix: fix story-loader to load only stories
markov00 Feb 25, 2020
923fb33
docs: fix knobs or source default panel per story
markov00 Feb 25, 2020
0266642
chore: move panel ids to constants
markov00 Feb 25, 2020
3117a11
docs: cleaned md files
markov00 Feb 25, 2020
ba1f285
Merge branch 'master' into pr/557
markov00 Feb 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.exports = {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
},
settings: {
'import/resolver': {
Expand Down
10 changes: 5 additions & 5 deletions .playground/playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export class Playground extends React.Component<{}, { isSunburstShown: boolean }
<>
<div className="chart">
<Chart>
<Axis id="y1" position={Position.Left} title={'y1'} />
<Axis id="y2" domain={{ fit: true }} groupId="g2" position={Position.Right} title={'y2'} />
<Axis id="x" position={Position.Bottom} title={'x'} />
<Axis id="y1" position={Position.Left} title="y1" />
<Axis id="y2" domain={{ fit: true }} groupId="g2" position={Position.Right} title="y2" />
<Axis id="x" position={Position.Bottom} title="x" />
<LineSeries
id="line1"
xScaleType={ScaleType.Linear}
xAccessor={'x'}
xAccessor="x"
yAccessors={['y']}
splitSeriesAccessors={['g']}
data={data}
Expand All @@ -30,7 +30,7 @@ export class Playground extends React.Component<{}, { isSunburstShown: boolean }
id="line2"
groupId="g2"
xScaleType={ScaleType.Linear}
xAccessor={'x'}
xAccessor="x"
yAccessors={['y1']}
splitSeriesAccessors={['g']}
data={data}
Expand Down
1 change: 1 addition & 0 deletions .storybook/addons.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-knobs/register';
import '@storybook/addon-docs/register';
import '@storybook/addon-storysource/register';
4 changes: 2 additions & 2 deletions .storybook/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ addParameters({
},
info: {
inline: true,
source: true,
source: false,
propTables: false,
styles: {
infoBody: {
Expand All @@ -40,4 +40,4 @@ addParameters({
addDecorator(withKnobs);
addDecorator(withInfo);

configure(require.context('../stories', true, /\.tsx$/), module);
configure(require.context('../stories', true, /\.stories\.tsx?$/), module);
13 changes: 13 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ module.exports = async ({ config }) => {
exclude: /node_modules/,
});

config.module.rules.push({
test: /\.tsx?$/,
include: [path.resolve(__dirname, '../stories/')],
exclude: [path.resolve(__dirname, '../stories/utils')],
loaders: [
{
loader: require.resolve('@storybook/source-loader'),
options: { parser: 'typescript' },
},
],
enforce: 'pre',
});

// Replace default css rules with nonce
config.module.rules = config.module.rules.filter(({ test }) => !test.test('.css'));
config.module.rules.push({
Expand Down
26 changes: 13 additions & 13 deletions docs/charts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../src';
import React from 'react';
import { KIBANA_METRICS } from '../src/utils/data_samples/test_dataset_kibana';
import { arrayKnobs, getChartRotationKnob } from '../stories/common';
import { arrayKnobs, getChartRotationKnob } from '../stories/utils/knobs';
import { Icon } from '../src/components/icons/icon';

export default {
Expand All @@ -39,7 +39,7 @@ export const Basic = () => {
<Chart className={className}>
<BarSeries
id={specId}
name={'Simple bar series'}
name="Simple bar series"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍❤️💝💕

cry

xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor="x"
Expand All @@ -61,7 +61,7 @@ export const AreaBasic = () => {
const specId = toggleSpec ? 'areas1' : 'areas2';

return (
<Chart className={'story-chart'}>
<Chart className="story-chart">
<AreaSeries
id={specId}
xScaleType={ScaleType.Time}
Expand Down Expand Up @@ -104,7 +104,7 @@ export const lineBasicXDomainContinous = () => {
const axisPosition = isBottom ? Position.Bottom : Position.Top;

return (
<Chart className={'story-chart'}>
<Chart className="story-chart">
<Settings showLegend debug={boolean('debug', false)} rotation={getChartRotationKnob()} />
<LineAnnotation
id={getAnnotationId('anno_1')}
Expand All @@ -113,10 +113,10 @@ export const lineBasicXDomainContinous = () => {
style={style}
marker={<Icon type="alert" />}
/>
<Axis id={'horizontal'} position={axisPosition} title={'x-domain axis'} />
<Axis id={'vertical'} title={'y-domain axis'} position={Position.Left} />
<Axis id="horizontal" position={axisPosition} title="x-domain axis" />
<Axis id="vertical" title="y-domain axis" position={Position.Left} />
<BarSeries
id={'bars'}
id="bars"
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor="x"
Expand All @@ -138,19 +138,19 @@ export const lineBasicXDomainOrdinal = () => {
const dataValues = generateAnnotationData(arrayKnobs('annotation values', ['a', 'c']));

return (
<Chart className={'story-chart'}>
<Chart className="story-chart">
<Settings debug={boolean('debug', false)} rotation={getChartRotationKnob()} />
<LineAnnotation
id={'anno_1'}
id="anno_1"
domainType={AnnotationDomainTypes.XDomain}
dataValues={dataValues}
marker={<Icon type="alert" />}
/>
<Axis id={'top'} position={Position.Top} title={'x-domain axis (top)'} />
<Axis id={'bottom'} position={Position.Bottom} title={'x-domain axis (bottom)'} />
<Axis id={'left'} title={'y-domain axis'} position={Position.Left} />
<Axis id="top" position={Position.Top} title="x-domain axis (top)" />
<Axis id="bottom" position={Position.Bottom} title="x-domain axis (bottom)" />
<Axis id="left" title="y-domain axis" position={Position.Left} />
<BarSeries
id={'bars'}
id="bars"
xScaleType={ScaleType.Ordinal}
yScaleType={ScaleType.Linear}
xAccessor="x"
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function requireAllStories(basedir: string, directory: string) {
const stats = lstatSync(join(basedir, relativePath));
if (stats.isDirectory()) {
result = result.concat(enumerateFiles(basedir, relativePath));
} else if (/\.tsx$/.test(relativePath)) {
} else if (/\.stories\.tsx$/.test(relativePath)) {
result.push(relativePath);
}
});
Expand Down
8 changes: 4 additions & 4 deletions integration/tests/annotations-stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ describe('Annotations stories', () => {
describe('rotation', () => {
it('rotation - 0', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/annotations--test-line-annotation-single-value-histogram&knob-debug=&knob-chartRotation=0',
'http://localhost:9001/?path=/story/annotations-lines--single-bar-histogram&knob-debug=&knob-chartRotation=0',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

);
});
it('rotation - 90', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/annotations--test-line-annotation-single-value-histogram&knob-debug=&knob-chartRotation=90',
'http://localhost:9001/?path=/story/annotations-lines--single-bar-histogram&knob-debug=&knob-chartRotation=90',
);
});
it('rotation - negative 90', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/annotations--test-line-annotation-single-value-histogram&knob-debug=&knob-chartRotation=-90',
'http://localhost:9001/?path=/story/annotations-lines--single-bar-histogram&knob-debug=&knob-chartRotation=-90',
);
});
it('rotation - 180', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/annotations--test-line-annotation-single-value-histogram&knob-debug=&knob-chartRotation=180',
'http://localhost:9001/?path=/story/annotations-lines--single-bar-histogram&knob-debug=&knob-chartRotation=180',
);
});
});
Expand Down
12 changes: 6 additions & 6 deletions integration/tests/area-stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@ import { common } from '../page_objects';
describe('Area series stories', () => {
it('stacked as NOT percentage', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--stacked-as-percentage&knob-stacked as percentage=',
'http://localhost:9001/?path=/story/area-chart--stacked-percentage&knob-stacked as percentage=',
);
});
describe('accessorFormats', () => {
it('should show custom format', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--band-area-chart&knob-scale to extent=&knob-y0AccessorFormat= [min]&knob-y1AccessorFormat= [max]',
'http://localhost:9001/?path=/story/area-chart--band-area&knob-scale to extent=&knob-y0AccessorFormat= [min]&knob-y1AccessorFormat= [max]',
);
});
});
describe('scale to extents', () => {
describe('scaleyScaleToDataExtent is true', () => {
it('should show correct extents - Banded', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--stacked-band-area-chart&knob-scale to extent=true',
'http://localhost:9001/?path=/story/area-chart--stacked-band&knob-scale to extent=true',
);
});
it('should show correct extents - stacked', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--stacked-band-area-chart&knob-scale to extent=true',
'http://localhost:9001/?path=/story/area-chart--stacked-band&knob-scale to extent=true',
);
});
});
describe('scaleyScaleToDataExtent is false', () => {
it('should show correct extents - Banded', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--stacked-band-area-chart&knob-scale to extent=false',
'http://localhost:9001/?path=/story/area-chart--stacked-band&knob-scale to extent=false',
);
});
it('should show correct extents - stacked', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/area-chart--stacked-band-area-chart&knob-scale to extent=false',
'http://localhost:9001/?path=/story/area-chart--stacked-band&knob-scale to extent=false',
);
});
});
Expand Down
18 changes: 9 additions & 9 deletions integration/tests/axis-stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@ import { common } from '../page_objects';
describe('Axis stories', () => {
it('should render proper tick count', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--basic&knob-Tick Label Padding=0&knob-debug=&knob-Bottom overlap labels=&knob-Bottom overlap ticks=true&knob-Number of ticks on bottom=20&knob-Left overlap labels=&knob-Left overlap ticks=true&knob-Number of ticks on left=10',
'http://localhost:9001/?path=/story/axes--basic&knob-Tick Label Padding=0&knob-debug=&knob-Bottom overlap labels=&knob-Bottom overlap ticks=true&knob-Number of ticks on bottom=20&knob-Left overlap labels=&knob-Left overlap ticks=true&knob-Number of ticks on left=10',
);
});
it('should render proper tick count with showOverlappingLabels', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--basic&knob-Tick Label Padding=0&knob-debug=&knob-Bottom overlap labels_Bottom Axis=true&knob-Bottom overlap ticks_Bottom Axis=true&knob-Number of ticks on bottom_Bottom Axis=20&knob-Left overlap labels_Left Axis=&knob-Left overlap ticks_Left Axis=true&knob-Number of ticks on left_Left Axis=10',
'http://localhost:9001/?path=/story/axes--basic&knob-Tick Label Padding=0&knob-debug=&knob-Bottom overlap labels_Bottom Axis=true&knob-Bottom overlap ticks_Bottom Axis=true&knob-Number of ticks on bottom_Bottom Axis=20&knob-Left overlap labels_Left Axis=&knob-Left overlap ticks_Left Axis=true&knob-Number of ticks on left_Left Axis=10',
);
});
it('should render ticks with varied rotations', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
'http://localhost:9001/?path=/story/axes--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
);
});
it('should hide bottom axis', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=true&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
'http://localhost:9001/?path=/story/axes--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=true&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
);
});
it('should hide top axis', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=true&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
'http://localhost:9001/?path=/story/axes--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=true&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
);
});
it('should hide left axis', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=true&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
'http://localhost:9001/?path=/story/axes--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=true&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=&knob-debug=',
);
});
it('should hide right axis', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=true&knob-debug=',
'http://localhost:9001/?path=/story/axes--tick-label-rotation&knob-Tick Label Padding=0&knob-bottom axis tick label rotation=47&knob-hide bottom axis=&knob-left axis tick label rotation=-56&knob-hide left axis=&knob-top axis tick label rotation=-59&knob-hide top axis=&knob-right axis tick label rotation=30&knob-hide right axis=true&knob-debug=',
);
});
it('should render tick padding', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--w-many-tick-labels&knob-Tick Label Padding=60',
'http://localhost:9001/?path=/story/axes--many-tick-labels&knob-Tick Label Padding=60',
);
});
it('should render with domain constraints', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/axis--customizing-domain-limits-only-one-bound-defined&knob-left min=2&knob-xDomain max=2',
'http://localhost:9001/?path=/story/axes--custom-mixed&knob-left min=2&knob-xDomain max=2',
);
});
});
8 changes: 4 additions & 4 deletions integration/tests/line-stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ describe('Line series stories', () => {
describe('rotation', () => {
it('rotation - 0', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/line-chart--ordinal-w-axis&knob-chartRotation=0',
'http://localhost:9001/?path=/story/line-chart--ordinal-with-axis&knob-chartRotation=0',
);
});
it('rotation - 90', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/line-chart--ordinal-w-axis&knob-chartRotation=90',
'http://localhost:9001/?path=/story/line-chart--ordinal-with-axis&knob-chartRotation=90',
);
});
it('rotation - negative 90', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/line-chart--ordinal-w-axis&knob-chartRotation=-90',
'http://localhost:9001/?path=/story/line-chart--ordinal-with-axis&knob-chartRotation=-90',
);
});
it('rotation - 180', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/line-chart--ordinal-w-axis&knob-chartRotation=180',
'http://localhost:9001/?path=/story/line-chart--ordinal-with-axis&knob-chartRotation=180',
);
});
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@storybook/addon-info": "^5.2.8",
"@storybook/addon-knobs": "5.2.8",
"@storybook/addon-links": "^5.3.9",
"@storybook/addon-storysource": "^5.3.13",
"@storybook/preset-typescript": "^1.1.0",
"@storybook/react": "5.2.8",
"@storybook/source-loader": "^5.3.9",
Expand Down
2 changes: 1 addition & 1 deletion src/components/chart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Chart', () => {
it("should render 'No data to display' with settings but without series", () => {
const wrapper = render(
<Chart>
<Settings debug={true} rendering={'svg'} />
<Settings debug={true} rendering="svg" />
</Chart>,
);
expect(wrapper.text()).toContain('No data to display');
Expand Down
4 changes: 3 additions & 1 deletion src/components/chart_status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class ChartStatusComponent extends React.Component<ChartStatusStateProps> {
dispatchRenderChange = () => {
const { onRenderChange, rendered } = this.props;
if (onRenderChange) {
onRenderChange(rendered);
window.requestAnimationFrame(() => {
onRenderChange(rendered);
});
}
};
render() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/legend/legend.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Legend', () => {
id="areas"
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor={'x'}
xAccessor="x"
yAccessors={['y']}
splitSeriesAccessors={['g']}
data={data}
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('Legend', () => {
id="areas"
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor={'x'}
xAccessor="x"
yAccessors={['y']}
splitSeriesAccessors={['g']}
data={data}
Expand Down
Loading