mirror of
https://github.com/grafana/grafana.git
synced 2025-09-18 06:53:04 +08:00
Storybook: Convert final CSF stories (#24283)
* Convert BigValue and GraphLegend * Convert last stories
This commit is contained in:
@ -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} />;
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user