Skip to content

Commit ed35d21

Browse files
committed
visx typescript
1 parent 3c151d3 commit ed35d21

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ import getLinkComponent from './getLinkComponent';
1515
import { onHover, onHoverExit } from '../actions/actions'
1616
import { useStoreContext } from '../store'
1717

18+
const root = hierarchy({
19+
name: 'root',
20+
children: [
21+
{ name: 'child #1' },
22+
{
23+
name: 'child #2',
24+
children: [{ name: 'grandchild #1' }, { name: 'grandchild #2' }, { name: 'grandchild #3' }],
25+
},
26+
],
27+
});
28+
29+
interface TreeNode {
30+
name: string;
31+
isExpanded?: boolean;
32+
children?: TreeNode[];
33+
}
34+
35+
type HierarchyNode = HierarchyPointNode<TreeNode>;
36+
1837
const defaultMargin = { top: 30, left: 30, right: 30, bottom: 70 };
1938

2039
export type LinkTypesProps = {

0 commit comments

Comments
 (0)