diff --git a/hyperdb/templates/hypergraph_viewer.html b/hyperdb/templates/hypergraph_viewer.html index 2a4c0d8..820864d 100644 --- a/hyperdb/templates/hypergraph_viewer.html +++ b/hyperdb/templates/hypergraph_viewer.html @@ -170,6 +170,7 @@ if (!edgeSet.has(edgeId)) { edgeSet.add(edgeId); hyperData.edges.push({ + id: edgeId, source: a, target: b, ...edge, @@ -214,6 +215,9 @@ key: `bubble-sets-${key}`, type: "bubble-sets", members: nodes, + keywords: edge.keywords || "", + summary: edge.summary || "", + weight: edge.weight || nodes.length, ...createStyle(colors[i % colors.length]), }); } @@ -239,6 +243,19 @@ .join("; "); result += `
Description: ${desc}
`; } + //展示所有剩余属性 + Object.entries(item).forEach(([key, value]) => { + if ( + key !== "id" && + key !== "entity_name" && + key !== "entity_type" && + key !== "style" && + key !== "data" && + key !== "description" + ) { + result += `${key}: ${value}
`; + } + }); }); return result; }, @@ -320,16 +337,6 @@ console.log("Clicked node:", itemId); }); - // 添加节点悬停事件 - graph.on("node:pointerenter", (e) => { - const { itemId } = e; - const node = graph.getNodeData(itemId); - if (node && node.data) { - // 可以在这里显示tooltip - console.log("Node data:", node.data); - } - }); - // 添加窗口大小变化监听 const handleResize = () => { if (graphRef.current && containerRef.current) { @@ -491,12 +498,19 @@