diff --git a/visual-tree-search-app/components/MessageLogPanel.tsx b/visual-tree-search-app/components/MessageLogPanel.tsx index dc3a880..134ade2 100644 --- a/visual-tree-search-app/components/MessageLogPanel.tsx +++ b/visual-tree-search-app/components/MessageLogPanel.tsx @@ -416,7 +416,9 @@ const MessageLogPanel: React.FC = ({ messages, messagesEnd
{getIcon(message)}
-
{message.description}
+
+ {message.description ? `Select ${message.description}` : 'Select the root node'} +
); diff --git a/visual-tree-search-app/components/MessageLogPanelLATS.tsx b/visual-tree-search-app/components/MessageLogPanelLATS.tsx index 03f2ad4..2ca3f8e 100644 --- a/visual-tree-search-app/components/MessageLogPanelLATS.tsx +++ b/visual-tree-search-app/components/MessageLogPanelLATS.tsx @@ -497,9 +497,8 @@ const MessageLogPanelLATS: React.FC = ({ messages, message
{getIcon(message)}
-
{message.description}
-
- Reason: {message.reason} +
+ {message.description ? `Select ${message.description}` : 'Select the root node'}
diff --git a/visual-tree-search-app/components/SimpleSearchVisual.tsx b/visual-tree-search-app/components/SimpleSearchVisual.tsx index 49669f3..c149823 100644 --- a/visual-tree-search-app/components/SimpleSearchVisual.tsx +++ b/visual-tree-search-app/components/SimpleSearchVisual.tsx @@ -256,17 +256,56 @@ const SimpleSearchVisual: React.FC = ({ messages }) => // Add tooltip interactions nodes - .on("mouseover", function(event, d) { - if (tooltipRef.current && d.data.description) { - const tooltip = d3.select(tooltipRef.current); - tooltip.transition() - .duration(200) - .style("opacity", .9); - tooltip.html(d.data.description) - .style("left", (event.pageX + 15) + "px") - .style("top", (event.pageY - 60) + "px"); + .on("mouseover", function(event, d) { + if (tooltipRef.current) { + let tooltipContent = ''; + + // Add description if available + if (d.data.description) { + tooltipContent += `

${d.data.description}

`; } - }) + + // Add node status information + const nodeInfo = []; + + + if (d.data.id === selectedNodeId) { + nodeInfo.push(`Selected Node`); + } + + if (nodeInfo.length > 0) { + tooltipContent += `
${nodeInfo.join(' | ')}
`; + } + + // Add reward info if available + if (typeof d.data.reward === 'number') { + tooltipContent += `
Reward: ${d.data.reward.toFixed(2)}
`; + } + + // Add value info if available + if (typeof d.data.value === 'number') { + tooltipContent += `
Value: ${d.data.value.toFixed(2)}
`; + } + + // Add visits info if available + if (typeof d.data.visits === 'number') { + tooltipContent += `
Visits: ${d.data.visits}
`; + } + + // Add depth info if available + if (typeof d.data.depth === 'number') { + tooltipContent += `
Depth: ${d.data.depth}
`; + } + + const tooltip = d3.select(tooltipRef.current); + tooltip.transition() + .duration(200) + .style("opacity", .9); + tooltip.html(tooltipContent) + .style("left", (event.pageX + 15) + "px") + .style("top", (event.pageY - 60) + "px"); + } + }) .on("mousemove", function(event) { if (tooltipRef.current) { d3.select(tooltipRef.current) @@ -310,10 +349,6 @@ const SimpleSearchVisual: React.FC = ({ messages }) => Selected
-
- - Root -