esm7 / obsidian-map-view

Interactive map view for Obsidian.md
MIT License
546 stars 25 forks source link

New filter option allowing the user to control which notes the mapview is built from #241

Open IanLindsley opened 2 months ago

IanLindsley commented 2 months ago

This is a feature request. The idea would be to create various filters corresponding various subsets of notes in the vault. When the user selects one of filters, the mapview would be rebuilt only using the notes associated with the filter. The user would be able to create, modify, and delete filters from the ui.

I (@IanLindsley) worked with you on the edges functionality. I could take a shot at this and create a PR, or maybe you could add it to a future version if you have time/deem it useful. We need this for a use case at work, but I think it would be beneficial to users in general.

esm7 commented 2 months ago

Hi, if I understand correctly, what you are suggesting is a more friendly UI for the same functionality that can be achieved with path:... OR path:... OR path:... filters. Is this correct? How do you imagine this looking like, and how would it interact with the filter functionality that would probably power it behind the scenes?

IanLindsley commented 2 months ago

Wow!! I actually never noticed that filter box. It works perfectly for our use case. We can add tags to the appropriate notes and use the filter box. This issue can be closed. Thanks! Sorry for wasting your time with this @esm7.

IanLindsley commented 2 months ago

Now that I think about it, and after playing with it a bit more, it would still be nice if you could "save" filters/queries and give them a name. You will build the query path:... Or path... etc., and then have the option somewhere to "save this query" which would prompt you to give it a name. The user would need the means to edit and delete the saved filters as well. This could be done in the settings pane or somewhere in here:

image

Maybe it would be better to handle the managment of named filters completely in the settings pane? Neverthless, the functionality as it is works good enough for our use cases. This is a "nice-to-have" from our perspective, saving the time of having to manually type the filter again when switching back and forth.

esm7 commented 2 months ago

It sounds like you are describing the Presets functionality :smile: Are you familiar with clicking Save As under Presets in your screenshot? The only difference between that and what you're describing, is that a preset saves more than just the query. If that part is important, it would be easy to have more checkboxes to fine-tune what a preset includes, e.g. similarly to "include chosen map source" have "include zoom & pan", "include filters" etc.