-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
380 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/polaris-viz/src/components/BarChart/stories/FormattedValues.chromatic.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type {Story} from '@storybook/react'; | ||
|
||
import {META} from './meta'; | ||
|
||
import type {BarChartProps} from '../../../components'; | ||
|
||
import {DEFAULT_DATA, Template} from './data'; | ||
|
||
export default { | ||
...META, | ||
title: 'polaris-viz/Chromatic/Charts/BarChart', | ||
parameters: { | ||
...META.parameters, | ||
chromatic: {disableSnapshot: false}, | ||
}, | ||
}; | ||
|
||
export const FormattedValues: Story<BarChartProps> = Template.bind({}); | ||
|
||
FormattedValues.args = { | ||
data: DEFAULT_DATA, | ||
seriesNameFormatter: (value) => `Name: ${value}`, | ||
xAxisOptions: { | ||
labelFormatter: (value) => `xAxis: ${value}`, | ||
}, | ||
yAxisOptions: { | ||
labelFormatter: (value) => `yAxis: ${value}`, | ||
}, | ||
onError: (a, b) => { | ||
console.log({a, b}); | ||
}, | ||
}; | ||
|
||
export const FormattedValuesHorizontal: Story<BarChartProps> = Template.bind( | ||
{}, | ||
); | ||
|
||
FormattedValuesHorizontal.args = { | ||
data: DEFAULT_DATA, | ||
direction: 'horizontal', | ||
seriesNameFormatter: (value) => `Name: ${value}`, | ||
xAxisOptions: { | ||
labelFormatter: (value) => `xAxis: ${value}`, | ||
}, | ||
yAxisOptions: { | ||
labelFormatter: (value) => `yAxis: ${value}`, | ||
}, | ||
onError: (a, b) => { | ||
console.log({a, b}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/polaris-viz/src/components/ComboChart/stories/FormattedValues.chromatic.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type {Story} from '@storybook/react'; | ||
|
||
import {META} from './meta'; | ||
|
||
import type {ComboChartProps} from '../../../components'; | ||
|
||
import {DEFAULT_DATA, Template} from './data'; | ||
|
||
export default { | ||
...META, | ||
title: 'polaris-viz/Chromatic/Charts/ComboChart', | ||
parameters: { | ||
...META.parameters, | ||
chromatic: {disableSnapshot: false}, | ||
}, | ||
}; | ||
|
||
export const FormattedValues: Story<ComboChartProps> = Template.bind({}); | ||
|
||
FormattedValues.args = { | ||
data: DEFAULT_DATA, | ||
seriesNameFormatter: (value) => `Name: ${value}`, | ||
xAxisOptions: { | ||
labelFormatter: (value) => `xAxis: ${value}`, | ||
}, | ||
onError: (a, b) => { | ||
console.log({a, b}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.