Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying a preset to different local graphs without saving it as a snapshot of a note linked to its local graph #13

Closed
autonomygaps opened this issue Apr 30, 2023 · 9 comments

Comments

@autonomygaps
Copy link

I have a feature request that would make this plugin do something that Obsidian's "Bookmarks" doesn't do: to apply a preset to local graphs without saving it as a snapshot of a note linked to its local graph.

The new Bookmarks feature in Obsidian 1.2 makes it easy to save and manage graph presets. For the full-vault graph, that basically duplicates the functionality of this preset. As I understand it, the "Graph Presets" adds a way to save snapshots of a note linked to a local graph, with the relevant graph settings, which is great.

But what I've been missing for a long time - in a forum post in January 2021! – is the ability to apply specific graph settings to an open local graph. What currently happens is that if I save a preset that is based on a local graph and then try to apply those settings to the local graph of another note, it opens the pairing of the original note with its local graph. I just want to apply the settings, without opening a different note.

Is that possible already? Or is this a feature request you could take on?

@ycnmhd
Copy link
Owner

ycnmhd commented Apr 30, 2023

When a preset is applied to a local graph, it becomes bound to it (when the preset is applied later, it reopens the bound local graph, and then applies settings to it. This feature was requested by morecup).

To apply the preset to another local graph, you need to first unlink it from its current local graph:

  1. Using the action button.
    image

  2. Selecting a different local graph file from the preset settings.
    image

@autonomygaps
Copy link
Author

Thanks so much for your swift response! This is really going to be a game-changer for me, in combination with Bookmarks.

But I'm still struggling for how to deploy this in the following situation:

  1. I've been working on a new note and I've added a bunch of links.
  2. I open the local graph for that note, to start using the local graph settings to exploring related notes.
  3. But the settings for the local graph aren't right – nothing is set (usually, for a new note), or the colors are from another setting.
  4. What I want to do is apply the settings from one of my graph presets to the local graph of the current note.

Currently, at step 4, if I open the graph preset index, and right-click on one of my presets and select "apply preset" then the preset is saved as a preset that is bound to the current file. But I want to leave the preset unchanged, so that I can apply it to any new situation I'm in.
Is that already possible?

@ycnmhd
Copy link
Owner

ycnmhd commented Apr 30, 2023

Applying the preset to a local graph without binding it is currently not possible.

There are multiple possible implementations to address this:

  1. An "auto bind" global setting (to disable auto binding for all presets).
  2. An "auto bind" preset setting (scoped to preset).
  3. An "apply without binding" context menu option.
  4. Prevent binding if the control key is pressed.

Which implementation do you prefer?

@autonomygaps
Copy link
Author

Terrific! I think that option "2" would be best, but I would title the toggle "Apply without binding to current file". That would be clearest, I think.

How does this work for "update preset"? Does this automatically change the binding?

All options would be great, of course!

@ycnmhd
Copy link
Owner

ycnmhd commented Apr 30, 2023

I've added the toggle to preset settings in version 0.10.0.
The new setting affects both "apply preset" and "update preset".

The default value of this toggle can be set in the global settings (serves as the default value for newly created files, but does not affect existing presets)

@autonomygaps
Copy link
Author

autonomygaps commented Apr 30, 2023

Wow!!! That gives me exactly want I've been needing – for two and a half years! With Keyboard Shortcuts, I can also map onto a single keystroke "open local graph" and "apply graph preset - default local graph". What is also great about this is that it becomes easy to apply specific filtered local graphs to a note, revealing for example all notes with specific years in the filename or that contain particular names.

@autonomygaps
Copy link
Author

Just posted a comment about this to the Obsidian forum: https://forum.obsidian.md/t/adjustable-persistent-settings-from-local-graph/11195/38

@ycnmhd
Copy link
Owner

ycnmhd commented Apr 30, 2023

I'm glad this feature is helpful to you.

If you have any more suggestions, please don't hesitate.

@autonomygaps
Copy link
Author

autonomygaps commented Apr 30, 2023 via email

@ycnmhd ycnmhd closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants