Skip to content

Commit 013b882

Browse files
committed
update node desc
1 parent f6a0c1f commit 013b882

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
33
<PropertyGroup>
4-
<Version>0.1.31</Version>
4+
<Version>0.1.32</Version>
55
<SKVersion>1.17.1</SKVersion>
66
</PropertyGroup>
77
</Project>

src/GraphRag.Net.Web/Pages/Graph/Graph.razor

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
<div id="app">
55
<div style="height:calc(100vh - 30px);width:100%;border:#eeeeee solid 1px;">
6-
<relation-graph ref="seeksRelationGraph" :options="graphOptions" />
6+
<relation-graph
7+
ref="seeksRelationGraph"
8+
:options="graphOptions"
9+
:on-node-click="onNodeClick" />
710
</div>
811
</div>
912

@@ -58,6 +61,9 @@
5861
// 处理错误
5962
console.error('请求出错:', error);
6063
});
64+
},
65+
onNodeClick(nodeObject, $event) {
66+
alert(nodeObject.data.desc);
6167
}
6268
}
6369
})

src/GraphRag.Net/Domain/Model/Graph/GraphViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public class NodesViewModel
1212
public string text { get; set; }
1313
public string color { get; set; } = "#43a2f1";
1414

15+
public NodesDataModel data { get; set; }=new NodesDataModel();
16+
}
17+
18+
public class NodesDataModel
19+
{
1520
public string desc { get; set; }
1621
}
1722

src/GraphRag.Net/Domain/Service/GraphService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ public GraphViewModel GetAllGraphs(string index)
5656
{
5757
id = n.Id,
5858
text = n.Name,
59-
desc=n.Desc
59+
data = new NodesDataModel()
60+
{
61+
desc = n.Desc.ConvertToString()
62+
}
6063
};
6164
//处理相同的Type用相同的颜色
6265
if (TypeColor.ContainsKey(n.Type))

0 commit comments

Comments
 (0)