|
| 1 | +import React from 'react' |
| 2 | +import { VisSingleContainer, VisChordDiagram } from '@unovis/react' |
| 3 | +import { ExampleViewerDurationProps } from '@src/components/ExampleViewer/index' |
| 4 | + |
| 5 | +export const title = 'Chord Diagram Zero Value Link' |
| 6 | +export const subTitle = 'External select node' |
| 7 | + |
| 8 | +const data = { |
| 9 | + nodes: Array(5).fill(0).map((_, i) => ({ id: String.fromCharCode(i + 65) })), |
| 10 | + links: [ |
| 11 | + { source: 'A', target: 'B', value: undefined }, |
| 12 | + { source: 'A', target: 'D', value: null }, |
| 13 | + { source: 'B', target: 'E', value: 0 }, |
| 14 | + { source: 'B', target: 'D', value: null }, |
| 15 | + { source: 'C', target: 'D', value: 0 }, |
| 16 | + { source: 'D', target: 'A', value: 1 }, |
| 17 | + { source: 'D', target: 'E', value: 0 }, |
| 18 | + ], |
| 19 | +} |
| 20 | + |
| 21 | +export const component = (props: ExampleViewerDurationProps): React.ReactNode => { |
| 22 | + return ( |
| 23 | + <> |
| 24 | + <VisSingleContainer data={data} height={600}> |
| 25 | + <VisChordDiagram |
| 26 | + nodeLabelAlignment='perpendicular' |
| 27 | + nodeLabel={React.useCallback((d: { id: string }) => `Segment ${d.id}`, [])} |
| 28 | + padAngle={0.75} |
| 29 | + duration={props.duration} |
| 30 | + /> |
| 31 | + </VisSingleContainer> |
| 32 | + </> |
| 33 | + ) |
| 34 | +} |
0 commit comments