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

Graph visualisation: Ability to filter out or apply different decoration (css) to notes from subfolders #835

Open
michael-guimet opened this issue Nov 19, 2021 · 4 comments
Labels
foam-dataviz Related to data visualization

Comments

@michael-guimet
Copy link

michael-guimet commented Nov 19, 2021

On the Foam Graph:

A. Filter out subdirectories:
I would like to filter out (remove) the nodes for notes in particular subdirectories. Ideally with the same behaviour as tags today (UI checkbox activation / deactivation using the name of the folder f.e.)

B. Decorate subdirectory nodes:
If the above is not possible, I would like to differentiate the nodes for notes in particular subdirectories.


A. Filter out subfolders

If we have the folder structure:

foamDirectory
│  +--note4
+--folderA
│      +--note1
+-- folderB
       +--note2
       +--note3

When a user runs the command "Foam: Show Graph":

  • Initially all the notes and their relationships are shown
  • In the Graph filters, in addition to "tags" and "placeholders", users would also see checkboxes for "folderA" and "folderB", initially checked
  • The user could uncheck "folderA" and the graph would remove "note1", in the same way it removes tags
  • If all checkboxes where unchecked by the user, the "note4" would still show, as it is not a tag, nor a placeholder and is not in a subdirectory

B. Decorate subdirectory nodes

The idea is to be able to define types of notes just by the folder they are in, instead of using the syntax:

---
type: feature
---

Once the type is defined, css can be applied as it currently is for note types


I'm happy to elaborate further if this is of interest.

Thanks!

@Casyfill
Copy link

I don't know if that is a better way, but I am using some python scripts for that, and they can be added as pre-commit scripts (if you use git for versioning)

@riccardoferretti
Copy link
Collaborator

I am curious to see your script @Casyfill, sounds interesting.
The way I was originally thinking about it was to expose that via some sort of configuration/API, so that an actual piece of JS code can "decorate" the nodes (either the notes themselves, or when they are converted into the graph).
Basically it would be similar to what the python script does, but on the fly (and ephemerally)

@riccardoferretti riccardoferretti added the foam-dataviz Related to data visualization label Nov 13, 2022
@clux
Copy link

clux commented Jan 22, 2023

This seems like a very nice feature to have. Have played around with mass modifications through sed on all files in a folder to prepend a type: whatever, but it causes a lot of header pollution (given that you generally don't need headers in foam), and it feels a bit redundant. If the graphing lib had some kind of setting to populate types from $foldername then this would be very powerful zero configuration categorisation system (at least for people who use more than one folder).

Workaround with sed

style node type in foam.graph.style and mass modify with a one-off script:

cd recaps
sed -i '1 i\---\ntype: recap\n---\n' *.md

..then create your docs from templates with the type header set.

@janbechtold
Copy link

janbechtold commented Aug 29, 2023

I would also be very interested in this feature.
I save daily notes in a folder. These are merely temporary todos. I save Persistent Information outside this folder.
The daily notes are not connected and overcrowd the graph view.
The example functionality from Obsidian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
foam-dataviz Related to data visualization
Projects
None yet
Development

No branches or pull requests

5 participants