-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1714 from silx-kit/up-storybook
Upgrade Storybook
- Loading branch information
Showing
4 changed files
with
1,010 additions
and
4,135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { | ||
Annotation, | ||
DataToHtml, | ||
DefaultInteractions, | ||
ResetZoomButton, | ||
SvgCircle, | ||
SvgElement, | ||
TooltipMesh, | ||
VisCanvas, | ||
} from '@h5web/lib'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Vector3 } from 'three'; | ||
|
||
import FillHeight from './decorators/FillHeight'; | ||
|
||
const meta = { | ||
decorators: [FillHeight], | ||
tags: ['autodocs', '!dev'], // use in `Stacking` doc page and hide from sidebar | ||
} satisfies Meta; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default = { | ||
render: () => ( | ||
<VisCanvas | ||
abscissaConfig={{ visDomain: [0, 41], showGrid: true }} | ||
ordinateConfig={{ visDomain: [0, 20], showGrid: true }} | ||
> | ||
<DefaultInteractions /> | ||
<ResetZoomButton /> | ||
<DataToHtml points={[new Vector3(20, 10), new Vector3(24, 10)]}> | ||
{(pt1, pt2) => ( | ||
<SvgElement> | ||
<SvgCircle coords={[pt1, pt2]} fill="lightblue" /> | ||
</SvgElement> | ||
)} | ||
</DataToHtml> | ||
<Annotation | ||
x={20} | ||
y={10} | ||
style={{ | ||
backgroundColor: 'lightgreen', | ||
padding: '1rem', | ||
whiteSpace: 'nowrap', | ||
}} | ||
> | ||
<p style={{ margin: 0 }}>HTML annotation</p> | ||
</Annotation> | ||
<TooltipMesh guides="both" renderTooltip={() => <>Tooltip</>} /> | ||
</VisCanvas> | ||
), | ||
} satisfies Story; |
Oops, something went wrong.