@@ -216,10 +216,18 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
216
216
// Action node (default)
217
217
return theme === 'dark' ? "#4B5563" : "#E5E7EB" ;
218
218
} )
219
- . attr ( "stroke" , d => d . data . id === selectedNodeId
220
- ? theme === 'dark' ? "#93C5FD" : "#2563EB"
221
- : theme === 'dark' ? "#374151" : "#D1D5DB" )
222
- . attr ( "stroke-width" , d => d . data . id === selectedNodeId ? 3 : 2 ) ;
219
+ . attr ( "stroke" , d => {
220
+ if ( d . data . id === selectedNodeId ) {
221
+ return theme === 'dark' ? "#93C5FD" : "#2563EB" ;
222
+ }
223
+ return theme === 'dark' ? "#374151" : "#D1D5DB" ;
224
+ } )
225
+ . attr ( "stroke-width" , d => {
226
+ if ( d . data . id === selectedNodeId ) {
227
+ return 3 ;
228
+ }
229
+ return 2 ;
230
+ } ) ;
223
231
224
232
// Add node labels with tooltips
225
233
nodes . append ( "text" )
@@ -241,25 +249,11 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
241
249
. attr ( "font-weight" , "500" )
242
250
. attr ( "fill" , d => {
243
251
if ( d . data . id === selectedNodeId ) {
244
- return "#ff5722" ; // Orange for selected node
252
+ return theme === 'dark' ? "#93C5FD" : "#1D4ED8" ;
245
253
}
246
254
return theme === 'dark' ? "#FFFFFF" : "#111827" ;
247
255
} ) ;
248
256
249
- // Add reward values near nodes
250
- nodes . append ( "text" )
251
- . attr ( "dy" , "1.5em" )
252
- . attr ( "x" , d => d . children ? - 18 : 18 )
253
- . attr ( "text-anchor" , d => d . children ? "end" : "start" )
254
- . text ( d => {
255
- if ( typeof d . data . reward === 'number' ) {
256
- return `R: ${ d . data . reward . toFixed ( 2 ) } ` ;
257
- }
258
- return "" ;
259
- } )
260
- . attr ( "font-size" , "12px" )
261
- . attr ( "fill" , theme === 'dark' ? "#E5E7EB" : "#4B5563" ) ;
262
-
263
257
// Add tooltip interactions
264
258
nodes
265
259
. on ( "mouseover" , function ( event , d ) {
@@ -309,6 +303,18 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
309
303
</ svg >
310
304
Tree Visualization
311
305
</ h2 >
306
+
307
+ { /* Legend */ }
308
+ < div className = "mt-2 flex flex-wrap gap-2 text-xs" >
309
+ < div className = "flex items-center" >
310
+ < span className = "w-3 h-3 rounded-full inline-block mr-1 bg-blue-500 dark:bg-blue-600" > </ span >
311
+ < span className = "text-gray-700 dark:text-gray-300" > Selected</ span >
312
+ </ 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
+ </ div >
312
318
</ div >
313
319
< div
314
320
ref = { containerRef }
0 commit comments