Skip to content

Commit

Permalink
fix storybook
Browse files Browse the repository at this point in the history
Signed-off-by: George Thomas <[email protected]>
  • Loading branch information
georgefst committed May 22, 2023
1 parent 579220f commit 1b698b5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
35 changes: 28 additions & 7 deletions src/components/TreeReactFlow/TreeReactFlow.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ export const Tree1: ComponentStory<typeof TreeReactFlow> = (
treeSized({
...args,
defs: [def1],
selection: { def: def1.name, node: { nodeType: "BodyNode", id: 100 } },
selection: {
tag: "SelectionDef",
contents: { def: def1.name, node: { nodeType: "BodyNode", meta: 100 } },
},
});
export const Tree2: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
Expand All @@ -100,45 +103,63 @@ export const Tree3: ComponentStory<typeof TreeReactFlow> = (
treeSized({
...args,
defs: [def3],
selection: { def: def3.name, node: { nodeType: "BodyNode", id: 301 } },
selection: {
tag: "SelectionDef",
contents: { def: def3.name, node: { nodeType: "BodyNode", meta: 301 } },
},
});
export const Tree4: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
) =>
treeSized({
...args,
defs: [def4],
selection: { def: def4.name, node: { nodeType: "BodyNode", id: 409 } },
selection: {
tag: "SelectionDef",
contents: { def: def4.name, node: { nodeType: "BodyNode", meta: 409 } },
},
});
export const Tree5: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
) =>
treeSized({
...args,
defs: [def5],
selection: { def: def5.name, node: { nodeType: "BodyNode", id: 503 } },
selection: {
tag: "SelectionDef",
contents: { def: def5.name, node: { nodeType: "BodyNode", meta: 503 } },
},
});
export const AllTrees: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
) =>
treeSized({
...args,
defs: [def1, def2, def3, def4, def5],
selection: { def: def3.name, node: { nodeType: "BodyNode", id: 301 } },
selection: {
tag: "SelectionDef",
contents: { def: def3.name, node: { nodeType: "BodyNode", meta: 301 } },
},
});
export const OddAndEven: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
) =>
treeSized({
...args,
defs: oddEvenDefs,
selection: { def: def5.name, node: { nodeType: "BodyNode", id: 5 } },
selection: {
tag: "SelectionDef",
contents: { def: def5.name, node: { nodeType: "BodyNode", meta: 5 } },
},
});
export const OddAndEvenMiscStyles: ComponentStory<typeof TreeReactFlow> = (
args: TreeReactFlowProps
) =>
treeSized({
...args,
defs: oddEvenDefsMiscStyles,
selection: { def: def5.name, node: { nodeType: "BodyNode", id: 5 } },
selection: {
tag: "SelectionDef",
contents: { def: def5.name, node: { nodeType: "BodyNode", meta: 5 } },
},
});
8 changes: 7 additions & 1 deletion src/components/TreeReactFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ export type TreeReactFlowProps = {
} & NodeParams;
export const defaultTreeReactFlowProps: Pick<
TreeReactFlowProps,
"treePadding" | "forestLayout" | "defParams" | "layout" | keyof NodeParams
| "treePadding"
| "forestLayout"
| "defParams"
| "layout"
| "typeDefs"
| keyof NodeParams
> = {
level: "Expert",
forestLayout: "Horizontal",
Expand All @@ -107,6 +112,7 @@ export const defaultTreeReactFlowProps: Pick<
type: WasmLayoutType.Tidy,
margins: { child: 25, sibling: 18 },
},
typeDefs: [],
};

const handle = (type: HandleType, position: Position) => (
Expand Down

0 comments on commit 1b698b5

Please sign in to comment.