Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/10930

Vanessa5fcd59146e04
diff --git a/app/src/layout/dock/Graph.ts b/app/src/layout/dock/Graph.ts
index f1d92c8236..4cfd3dcb97 100644
--- a/app/src/layout/dock/Graph.ts
+++ b/app/src/layout/dock/Graph.ts
@@ -551,6 +551,13 @@ export class Graph extends Model {
clearTimeout(this.timeout);
addScript(`${Constants.PROTYLE_CDN}/js/vis/vis-network.min.js?v=9.1.2`, "protyleVisScript").then(() => {
this.timeout = window.setTimeout(() => {
+ if (!this.graphData || !this.graphData.nodes || this.graphData.nodes.length === 0) {
+ if (this.network) {
+ this.network.destroy();
+ }
+ this.graphElement.firstElementChild.classList.add("fn__none");
+ return;
+ }
this.graphElement.firstElementChild.classList.remove("fn__none");
this.graphElement.firstElementChild.firstElementChild.setAttribute("style", "width:3%");
const config = window.siyuan.config.graph[this.type === "global" ? "global" : "local"];