-
Notifications
You must be signed in to change notification settings - Fork 25
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
4 changed files
with
58 additions
and
1 deletion.
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
53 changes: 53 additions & 0 deletions
53
packages/polaris-viz/src/components/FunnelChartNext/stories/Playground.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,53 @@ | ||
import type {Story} from '@storybook/react'; | ||
|
||
import type {FunnelChartNextProps} from '../../FunnelChartNext'; | ||
|
||
export default { | ||
...META, | ||
title: `${META.title}/Playground`, | ||
}; | ||
|
||
import {Template} from './data'; | ||
import {META} from './meta'; | ||
|
||
export const ZeroValues: Story<FunnelChartNextProps> = Template.bind({}); | ||
|
||
const yAxisOptions = { | ||
labelFormatter: (value) => { | ||
return new Intl.NumberFormat('en', { | ||
style: 'decimal', | ||
maximumFractionDigits: 2, | ||
}).format(Number(value)); | ||
}, | ||
}; | ||
|
||
ZeroValues.args = { | ||
data: [ | ||
{ | ||
data: [ | ||
{ | ||
value: 0, | ||
key: 'Sessions', | ||
}, | ||
{ | ||
value: 0, | ||
key: 'Sessions with cart addition', | ||
}, | ||
{ | ||
value: 0, | ||
key: 'Sessions that reached checkout', | ||
}, | ||
{ | ||
value: 0, | ||
key: 'Sessions that completed checkout', | ||
}, | ||
], | ||
name: 'Conversion rates', | ||
}, | ||
], | ||
yAxisOptions: yAxisOptions, | ||
tooltipLabels: { | ||
reached: 'Reached this step', | ||
dropped: 'Dropped off', | ||
}, | ||
}; |
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