@@ -6,7 +6,6 @@ import { pointRadial } from 'd3-shape';
6
6
import useForceUpdate from './useForceUpdate' ;
7
7
import LinkControls from './LinkControls' ;
8
8
import getLinkComponent from './getLinkComponent' ;
9
- import { chartDefaultProps } from 'react-google-charts/dist/default-props' ;
10
9
11
10
interface TreeNode {
12
11
name : string ;
@@ -61,13 +60,16 @@ export type LinkTypesProps = {
61
60
width : number ;
62
61
height : number ;
63
62
margin ?: { top : number ; right : number ; bottom : number ; left : number } ;
63
+ snapshots : any ;
64
64
} ;
65
65
66
66
export default function Example ( {
67
67
width : totalWidth ,
68
68
height : totalHeight ,
69
69
margin = defaultMargin ,
70
+ snapshots : snapshots ,
70
71
} : LinkTypesProps ) {
72
+ console . log ( 'snapshots passed in' , snapshots ) ;
71
73
const [ layout , setLayout ] = useState < string > ( 'cartesian' ) ;
72
74
const [ orientation , setOrientation ] = useState < string > ( 'horizontal' ) ;
73
75
const [ linkType , setLinkType ] = useState < string > ( 'diagonal' ) ;
@@ -114,8 +116,8 @@ export default function Example({
114
116
setStepPercent = { setStepPercent }
115
117
/>
116
118
< svg width = { totalWidth } height = { totalHeight } >
117
- < LinearGradient id = ' links-gradient' from = ' #fd9b93' to = ' #fe6e9e' />
118
- < rect width = { totalWidth } height = { totalHeight } rx = { 14 } fill = ' #242529' />
119
+ < LinearGradient id = " links-gradient" from = " #fd9b93" to = " #fe6e9e" />
120
+ < rect width = { totalWidth } height = { totalHeight } rx = { 14 } fill = " #242529" />
119
121
< Group top = { margin . top } left = { margin . left } >
120
122
< Tree
121
123
root = { hierarchy ( data , ( d ) => ( d . isExpanded ? null : d . children ) ) }
@@ -129,9 +131,9 @@ export default function Example({
129
131
key = { i }
130
132
data = { link }
131
133
percent = { stepPercent }
132
- stroke = ' rgb(254,110,158,0.6)'
133
- strokeWidth = '1'
134
- fill = ' none'
134
+ stroke = " rgb(254,110,158,0.6)"
135
+ strokeWidth = "1"
136
+ fill = " none"
135
137
/>
136
138
) ) }
137
139
@@ -172,7 +174,7 @@ export default function Example({
172
174
width = { width }
173
175
y = { - height / 2 }
174
176
x = { - width / 2 }
175
- fill = ' #272b4d'
177
+ fill = " #272b4d"
176
178
stroke = { node . data . children ? '#03c0dc' : '#26deb0' }
177
179
strokeWidth = { 1 }
178
180
strokeDasharray = { node . data . children ? '0' : '2,2' }
@@ -186,10 +188,10 @@ export default function Example({
186
188
/>
187
189
) }
188
190
< text
189
- dy = ' .33em'
191
+ dy = " .33em"
190
192
fontSize = { 9 }
191
- fontFamily = ' Arial'
192
- textAnchor = ' middle'
193
+ fontFamily = " Arial"
194
+ textAnchor = " middle"
193
195
style = { { pointerEvents : 'none' } }
194
196
fill = {
195
197
node . depth === 0
0 commit comments