-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dendogram): add support for custom svg layers
- Loading branch information
Showing
6 changed files
with
46 additions
and
21 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
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 |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import { CommonProps, DendogramSvgProps } from './types' | ||
import { Node } from './Node' | ||
import { Link } from './Link' | ||
|
||
export const commonDefaultProps: any = { | ||
export const commonDefaultProps: Pick< | ||
CommonProps<any>, | ||
'identity' | 'layout' | 'isInteractive' | 'role' | 'animate' | 'motionConfig' | ||
> = { | ||
identity: 'id', | ||
layout: 'top-to-bottom', | ||
layers: ['links', 'nodes', 'labels'], | ||
isInteractive: true, | ||
role: 'img', | ||
animate: true, | ||
motionConfig: 'gentle', | ||
} | ||
|
||
export const svgDefaultProps = { | ||
export const svgDefaultProps: typeof commonDefaultProps & | ||
Required<Pick<DendogramSvgProps<any>, 'layers' | 'nodeComponent' | 'linkComponent'>> = { | ||
...commonDefaultProps, | ||
layers: ['links', 'nodes', 'labels'], | ||
nodeComponent: Node, | ||
linkComponent: Link, | ||
} |
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