Canvas: Links in Cards and Outgoing Arrows in Graph View

Hi, I am still a noob regarding using obsidian.
After seeing this request, I realized I could stop searching.

But for now, I’ve come up with a temporary solution.
To make it easier for myself, I’ve modified the plugin Advanced-canvas.
obsidian://show-plugin?id=advanced-canvas

If you want to add this functionality, for yourself,
Open ".obsidian/plugins/advanced-canvas/main.js "
And add the extra code after the line: “addPopupMenuOption(canvas, addLink, -1);”
You should then deactivate and reactivate the plugin. Hopefully, you will find a link button in the overlay, when you click the connection line between two pages.
link

    const addLink = createPopupMenuOption({
      id: "edge-style-option",
      label: "Add Link",
      icon: "link",
      callback: () => {
        var fromNode = selectedEdges[0].from.node,
        toNode = selectedEdges[0].to.node
        if ("file" in fromNode && "file" in toNode) {
          app.vault.append(app.vault.getAbstractFileByPath(fromNode.filePath), " [["+ toNode.file.basename +"]] ")
          app.vault.append(app.vault.getAbstractFileByPath(toNode.filePath), " [["+ fromNode.file.basename +"]] ")
        }
      }
    });
    addPopupMenuOption(canvas, addLink, -1);
2 Likes