|
|
@@ -25,7 +25,7 @@ const propertyData = computed(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const keyword = ref('');
|
|
|
+const keyword = ref('建筑工程');
|
|
|
|
|
|
let graph: Graph | null = null;
|
|
|
|
|
|
@@ -36,10 +36,7 @@ function find(request: Request) {
|
|
|
knowledgeGraphService.find(request).then((nodes) => {
|
|
|
graphDataManager.addSubjectNodes(nodes);
|
|
|
if (graph && nodes.length > 0) {
|
|
|
- graph.changeData(graphDataManager.getGraphData())
|
|
|
- graph.render()
|
|
|
- graph.layout()
|
|
|
- // graph.read(graphDataManager.getGraphData() as any)
|
|
|
+ graph.read(graphDataManager.getGraphData())
|
|
|
}
|
|
|
msgHandler()
|
|
|
}).catch(() => {
|
|
|
@@ -189,7 +186,7 @@ onMounted(() => {
|
|
|
const rect = document.getElementById("graph")?.getBoundingClientRect()
|
|
|
if (rect) {
|
|
|
graph = initGraph(rect.width, rect.height)
|
|
|
- findName("")
|
|
|
+ findName(keyword.value)
|
|
|
}
|
|
|
});
|
|
|
</script>
|