Sanqui / obsidian-persistent-graph

An Obsidian plugin for saving and restoring the positions of nodes on the global graph view
MIT License
107 stars 3 forks source link

Add save/restore buttons on graph view leaf #8

Open Sanqui opened 2 years ago

Sanqui commented 2 years ago

Instead of requiring the use of commands, add save/restore buttons alongside "Close" and "More options".

Method suggested by koala:

I think you'd be better off using addAction on the graph view leaf https://github.com/obsidianmd/obsidian-api/blob/d4b79f95ccf3838a305915a137a844250766d023/obsidian.d.ts#L1514 and storing a reference to each added button on your plugin. Then you can just call HTMLElement.detach() to remove it.