Vinzent03 / obsidian-advanced-uri

Advanced modes for Obsidian URI
MIT License
765 stars 44 forks source link

Canvas navigation command [Feature request] #177

Closed shin0kaze closed 4 months ago

shin0kaze commented 5 months ago

Hi.

Can you add a command that will open canvas and focus a card by id or using canvas.zoomToBbox(minX, minY, maxX, maxY)?

Because, for now there is no simple way to navigate on a large canvas, this feature would be incredible.

Vinzent03 commented 4 months ago

What is your use case for this feature? Like how do you get the node id in your flow?

shin0kaze commented 4 months ago

The problem in the current obsidian version is that when you work with canvas nodes, you cannot have links between them. That becomes a problem when you need a link to a specific node in Canvas. Also, there are big canvases where some nodes mention others.

Considering the above, my use case is creating links in nodes like that: obsidian://advanced-uri?vault=<your-vault>&filepath=my-canvas-file&canvasnode=<node-id-in-canvas> Or if I need a link to a good canvas view: obsidian://advanced-uri?vault=<your-vault>&filepath=my-canvas-file&canvascoords=100,100,500,500

Then I can easily navigate between nodes and canvases.

shin0kaze commented 4 months ago

I would try to make a pull request, but cannot get how to move focus and view in canvas tab after opening a file.

Vinzent03 commented 4 months ago

Available now in 1.42.0 :tada: The usage is documented here https://publish.obsidian.md/advanced-uri-doc/Actions/Canvas