@@ -150,7 +150,7 @@ function Node({ node, snapshots, dispatch, bothObj}) {
150
150
const isParent = ! ! node . children ;
151
151
152
152
if ( isRoot ) return < RootNode node = { node } /> ;
153
- if ( selector ) return < SelectorNode node = { node } snapshots = { snapshots } bothObj = { bothObj } /> ;
153
+ if ( selector ) return < SelectorNode node = { node } snapshots = { snapshots } bothObj = { bothObj } dispatch = { dispatch } /> ;
154
154
155
155
return (
156
156
< Group top = { node . y } left = { node . x } >
@@ -160,12 +160,9 @@ function Node({ node, snapshots, dispatch, bothObj}) {
160
160
fill = { isParent ? orange : blue }
161
161
stroke = { isParent ? orange : blue }
162
162
onMouseEnter = { ( ) => {
163
- console . log ( bothObj )
164
- console . log ( clusterData )
165
- console . log ( snapshots [ 0 ] . recoilDomNode )
166
- console . log ( node . data . name )
167
- // console.log(snapshots[0].recoilDomNode[node.data.name])
168
- // dispatch(onHover(snapshots[0].recoilDomNode[node.data.name]))
163
+ for ( let i = 0 ; i < bothObj [ node . data . name ] . length ; i ++ ) {
164
+ dispatch ( onHover ( snapshots [ 0 ] . recoilDomNode [ bothObj [ node . data . name ] [ i ] ] ) )
165
+ }
169
166
} }
170
167
/>
171
168
) }
@@ -220,7 +217,6 @@ function RootNode({ node }) {
220
217
}
221
218
222
219
function SelectorNode ( { node, snapshots, dispatch, bothObj} ) {
223
- // const [dispatch] = useStoreContext();
224
220
return (
225
221
< Group top = { node . y } left = { node . x } >
226
222
{ node . depth !== 0 && (
@@ -229,12 +225,9 @@ function SelectorNode({ node, snapshots, dispatch, bothObj}) {
229
225
fill = { selectWhite }
230
226
stroke = { selectWhite }
231
227
onMouseEnter = { ( ) => {
232
- console . log ( bothObj )
233
- console . log ( clusterData )
234
- console . log ( snapshots [ 0 ] . recoilDomNode )
235
- console . log ( node . data . name )
236
- // console.log(snapshots[0].recoilDomNode[node.data.name])
237
- // dispatch(onHover(snapshots[0].recoilDomNode[node.data.name]))
228
+ for ( let i = 0 ; i < bothObj [ node . data . name ] . length ; i ++ ) {
229
+ dispatch ( onHover ( snapshots [ 0 ] . recoilDomNode [ bothObj [ node . data . name ] [ i ] ] ) )
230
+ }
238
231
} }
239
232
/>
240
233
) }
@@ -280,7 +273,8 @@ export default function AtomsRelationship({
280
273
281
274
let filtered = removeDup ( bothObj )
282
275
283
- const [ dispatch ] = useStoreContext ( ) ;
276
+ const [ { tabs, currentTab } , dispatch ] = useStoreContext ( ) ;
277
+
284
278
if ( ! initialFire ) {
285
279
clusterDataPopulate ( snapshots ) ;
286
280
}
@@ -316,7 +310,7 @@ export default function AtomsRelationship({
316
310
{ cluster . descendants ( ) . map ( ( node , i ) => (
317
311
< Node key = { `cluster-node-${ i } ` }
318
312
node = { node }
319
- bothObj = { bothObj }
313
+ bothObj = { filtered }
320
314
snapshots = { snapshots }
321
315
dispatch = { dispatch } />
322
316
) ) }
0 commit comments