-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
stories.ts
62 lines (57 loc) · 1.28 KB
/
stories.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import type { Meta, StoryObj } from "@storybook/web-components";
import play from "./index";
import template from "./index.html?raw";
import source from "./index?raw";
type StoryArgs = {
order: number;
size: number;
clusters: number;
edgesRenderer: "edges-default" | "edges-fast";
};
const meta: Meta<StoryArgs> = {
id: "large-graphs",
title: "Examples",
argTypes: {
order: {
name: "Number of nodes",
defaultValue: 5000,
control: { type: "number", step: "100", min: "100" },
},
size: {
name: "Number of edges",
defaultValue: 10000,
control: { type: "number", step: "100", min: "100" },
},
clusters: {
name: "Number of clusters",
defaultValue: 3,
control: { type: "number", step: "1", min: "1" },
},
edgesRenderer: {
name: "Edges renderer",
defaultValue: "edge-default",
options: ["edges-default", "edges-fast"],
control: {
type: "radio",
},
},
},
};
export default meta;
type Story = StoryObj<StoryArgs>;
export const story: Story = {
name: "Performances showcase",
render: () => template,
play,
args: {
order: 5000,
size: 1000,
clusters: 3,
edgesRenderer: "edges-default",
},
parameters: {
storySource: {
source,
},
},
};