@@ -256,17 +256,56 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
256
256
257
257
// Add tooltip interactions
258
258
nodes
259
- . on ( "mouseover" , function ( event , d ) {
260
- if ( tooltipRef . current && d . data . description ) {
261
- const tooltip = d3 . select ( tooltipRef . current ) ;
262
- tooltip . transition ( )
263
- . duration ( 200 )
264
- . style ( "opacity" , .9 ) ;
265
- tooltip . html ( d . data . description )
266
- . style ( "left" , ( event . pageX + 15 ) + "px" )
267
- . style ( "top" , ( event . pageY - 60 ) + "px" ) ;
259
+ . on ( "mouseover" , function ( event , d ) {
260
+ if ( tooltipRef . current ) {
261
+ let tooltipContent = '' ;
262
+
263
+ // Add description if available
264
+ if ( d . data . description ) {
265
+ tooltipContent += `<p>${ d . data . description } </p>` ;
268
266
}
269
- } )
267
+
268
+ // Add node status information
269
+ const nodeInfo = [ ] ;
270
+
271
+
272
+ if ( d . data . id === selectedNodeId ) {
273
+ nodeInfo . push ( `<span class="font-semibold text-blue-600 dark:text-blue-400">Selected Node</span>` ) ;
274
+ }
275
+
276
+ if ( nodeInfo . length > 0 ) {
277
+ tooltipContent += `<div class="mt-2">${ nodeInfo . join ( ' | ' ) } </div>` ;
278
+ }
279
+
280
+ // Add reward info if available
281
+ if ( typeof d . data . reward === 'number' ) {
282
+ tooltipContent += `<div class="mt-1">Reward: <span class="font-bold">${ d . data . reward . toFixed ( 2 ) } </span></div>` ;
283
+ }
284
+
285
+ // Add value info if available
286
+ if ( typeof d . data . value === 'number' ) {
287
+ tooltipContent += `<div>Value: <span class="font-bold">${ d . data . value . toFixed ( 2 ) } </span></div>` ;
288
+ }
289
+
290
+ // Add visits info if available
291
+ if ( typeof d . data . visits === 'number' ) {
292
+ tooltipContent += `<div>Visits: <span class="font-bold">${ d . data . visits } </span></div>` ;
293
+ }
294
+
295
+ // Add depth info if available
296
+ if ( typeof d . data . depth === 'number' ) {
297
+ tooltipContent += `<div>Depth: <span class="font-bold">${ d . data . depth } </span></div>` ;
298
+ }
299
+
300
+ const tooltip = d3 . select ( tooltipRef . current ) ;
301
+ tooltip . transition ( )
302
+ . duration ( 200 )
303
+ . style ( "opacity" , .9 ) ;
304
+ tooltip . html ( tooltipContent )
305
+ . style ( "left" , ( event . pageX + 15 ) + "px" )
306
+ . style ( "top" , ( event . pageY - 60 ) + "px" ) ;
307
+ }
308
+ } )
270
309
. on ( "mousemove" , function ( event ) {
271
310
if ( tooltipRef . current ) {
272
311
d3 . select ( tooltipRef . current )
@@ -310,10 +349,6 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
310
349
< span className = "w-3 h-3 rounded-full inline-block mr-1 bg-blue-500 dark:bg-blue-600" > </ span >
311
350
< span className = "text-gray-700 dark:text-gray-300" > Selected</ span >
312
351
</ div >
313
- < div className = "flex items-center" >
314
- < span className = "w-3 h-3 rounded-full inline-block mr-1 bg-gray-500 dark:bg-gray-600" > </ span >
315
- < span className = "text-gray-700 dark:text-gray-300" > Root</ span >
316
- </ div >
317
352
</ div >
318
353
</ div >
319
354
< div
0 commit comments