Storybook: Convert final CSF stories (#24283)

* Convert BigValue and GraphLegend

* Convert last stories
This commit is contained in:
Tobias Skarhed
2020-05-05 15:42:36 +02:00
committed by GitHub
parent 428b4ae565
commit a2363f4d0c
8 changed files with 91 additions and 89 deletions

View File

@ -1,14 +1,17 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { select, text } from '@storybook/addon-knobs';
import { withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { GraphWithLegend, GraphWithLegendProps } from './GraphWithLegend';
import { LegendPlacement, LegendDisplayMode } from '../Legend/Legend';
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorMode } from '@grafana/data';
const GraphWithLegendStories = storiesOf('Visualizations/Graph/GraphWithLegend', module);
GraphWithLegendStories.addDecorator(withHorizontallyCenteredStory);
export default {
title: 'Visualizations/Graph',
component: GraphWithLegend,
decorator: [withCenteredStory],
};
const series: GraphSeriesXY[] = [
{
@ -104,7 +107,7 @@ const getStoriesKnobs = () => {
};
};
GraphWithLegendStories.add('default', () => {
export const graphWithLegend = () => {
const { legendPlacement, rightAxisSeries, renderLegendAsTable } = getStoriesKnobs();
const props: GraphWithLegendProps = {
series: series.map(s => {
@ -138,4 +141,4 @@ GraphWithLegendStories.add('default', () => {
};
return <GraphWithLegend {...props} />;
});
};