Skip to content

Commit 014d220

Browse files
authored
Local graph view support
1 parent fe728c6 commit 014d220

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

main.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ export default class GraphLinkTypesPlugin extends Plugin {
6060

6161
// Find the graph view leaf in the workspace
6262
findGraphLeaf(): WorkspaceLeaf | null {
63-
const graphLeaves: WorkspaceLeaf[] = this.app.workspace.getLeavesOfType('graph');
64-
// Ensure there is exactly one graph leaf open
65-
return graphLeaves.length === 1 ? graphLeaves[0] : null;
63+
let graphLeaves: WorkspaceLeaf[] = this.app.workspace.getLeavesOfType('graph');
64+
if (graphLeaves.length == 0) {
65+
graphLeaves = this.app.workspace.getLeavesOfType('localgraph');
66+
}
67+
// Ensure there is exactly one graph leaf open
68+
return graphLeaves.length > 0 ? graphLeaves[0] : null;
6669
}
67-
70+
6871
// Create or update text for a given link
6972
createTextForLink(renderer: any, link: any): void {
7073
// Get the text to display for the link

0 commit comments

Comments
 (0)