-
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.
Update StackedAreaChart to use tooltip portal
- Loading branch information
1 parent
131de48
commit 9b79230
Showing
8 changed files
with
196 additions
and
34 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
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
52 changes: 52 additions & 0 deletions
52
...-viz/src/components/StackedAreaChart/stories/playground/ExternalTooltipPortal.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,52 @@ | ||
import type {Story} from '@storybook/react'; | ||
|
||
import type {StackedAreaChartProps} from '../../StackedAreaChart'; | ||
import {StackedAreaChart} from '../../StackedAreaChart'; | ||
import {META} from '../meta'; | ||
import {DEFAULT_DATA, DEFAULT_PROPS} from '../data'; | ||
|
||
export default { | ||
...META, | ||
title: `${META.title}/Playground`, | ||
decorators: [], | ||
}; | ||
|
||
function Card(args: StackedAreaChartProps) { | ||
return ( | ||
<div | ||
style={{ | ||
height: 400, | ||
width: 400, | ||
background: 'white', | ||
borderRadius: '8px', | ||
padding: 10, | ||
}} | ||
> | ||
<StackedAreaChart {...args} theme="Uplift" /> | ||
</div> | ||
); | ||
} | ||
|
||
const Template: Story<StackedAreaChartProps> = ( | ||
args: StackedAreaChartProps, | ||
) => { | ||
return ( | ||
<div style={{overflow: 'auto'}}> | ||
<Card {...args} /> | ||
<div style={{height: 700, width: 10}} /> | ||
<div style={{display: 'flex', justifyContent: 'space-between'}}> | ||
<Card {...args} /> | ||
<Card {...args} /> | ||
<Card {...args} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const ExternalTooltipPortal: Story<StackedAreaChartProps> = | ||
Template.bind({}); | ||
|
||
ExternalTooltipPortal.args = { | ||
...DEFAULT_PROPS, | ||
data: DEFAULT_DATA, | ||
}; |
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