Option to ignore certain nodes in the graph

The graph viewer currently shows “TODO/DOING/NEXT” nodes which unnecessarily links pages which might not be related and create clutter. Currently the graph viewer has the option to ignore only “journal” nodes, I think this can be generalised further for removing ‘TODO/DOING’ and other nodes.

Edit: We can have an additional property like include_in_graph: true or something in the UI.

Hi,
do you consider this as solved?

With the current version you can filter out the “built-in pages” which no longer shows TODO and so on.

For me it’s no.
I think property like exclude_from_graph should be added for case like below.

When making pages like [[my page lists1]], [[my page lists2]] for listing many pages,
the all other pages ref the list pages, and there will be too many edges on the graph.

Like this case, someone can feel too many edges are bothering, and wants to hide some nodes on the graph.
Not only this example, there will be other cases for users who want to hide specific nodes.

So, the feature can be like 2 types.

  1. Add new page attribute for exclude_in_graph: true which is default false.
  2. On the graph view, add right-click popup on the node for hide the node
5 Likes

I need the same feature too.
My situation is I have some pages like [[tag structure]], [[templates]], [[content map]] which have so many tags in them. Then in the graph view, there will be so many useless edges and that bothers me a lot.
What I want is just like the feature you said, an attribute which can hide a node in graph view.

2 Likes

This would be essential for tags for definitions, like simply #definition. Useful for queries, but I don’t do it because it would mess up my graph.

Either an attribute would do, but personally I think a filter in the graph would be better. It would only require one action to filter 1000 links to [[definition]], instead of writing exclude_in_graph: true 1000 times like @the-jb is suggesting.

In fact, I vote for the suggestion exclude_in_graph or sth like that. I like the idea very much and think this should be an important feature for the graph view to be more usuful.
In your case, you do not need to write it 1000 times. Writing it just once in the [[definition]] page property is sufficient.
On the other hand, if implementing the filter on the graph level, one might need to go through a long long list of pages to click the ones to be neglected.

I changed my mind, you’re right. This is the way.

It might be useful if the nodes menu of the graph has a way to show which pages have the exclude_in_graph attribute, to set this to false again, or to add new pages for which the exclude_in_graph:: true property is added. This would compliment suggestion 2 of @the-jb :

Add new page attribute for exclude_in_graph: true which is default false.

But since Logseq is still new and the devs can only focus on so many things I would say that the suggestion quoted above is definitely enough.

+1 for this suggestion. It would be very helpful for pruning the graph.

1 Like

+1 from me too. exclude_in_graph would be a life-saving attribute.
I have a ton of pages >3k which all link to the same three base-nodes, this produces a lot of noise in the graph, excluding these pages from the graph would reduce the visual noise as well as the (I presume) the time it takes to render such a huge network of nodes.

My bad.
After delving a bit deeper in the GitHub repository, I found a commit that already implemented this feature. Should’ve checked beforehand.
The page attribute is now called exclude-from-graph-view

2 Likes

Can confirm this is now supported by the exclude-from-graph-view page property. It is documented in https://docs.logseq.com/#/page/built-in%20properties

1 Like

Hey there, sorry to reopen this thread but I am having issue hiding pages from the graph.
I added property:: exclude_in_graph: true as the first line of a page, but I still see the page in the graph.

@cldwalker, I tried following your link, but I can’t see anything about this in the documentation.

Thanks!

If I’m not mistaken, the syntax to use is: exclude-from-graph-view:: true . You should put this in the first block of the page in question. If that page already has properties in its first block, make sure to use shift+enter to create a new line without creating a new block for this property.

@pierat Hi. What TookiTheGreat said is correct. The updated page that documents this property is https://docs.logseq.com/#/page/built-in%20properties

2 Likes

Thanks both!

I tried both:
property:: exclude-from-graph-view: true
and
property:: exclude-from-graph-view:: true (with two ‘:’ signs before ‘true’)

But still, it doesn’t work: the graph shows that page.

Attached the screenshot…is there anything I am missing? Also, not sure whether that’s relevant but when I click away from the block (when I am not in edit mode), the second colon sign disappears - I see property: exclude-from-graph-view:: true.

I am using the latest version (0.8.16).

Thanks again.

We may have a misunderstanding here of what you are trying to achieve. Let me start with stating what I know about this property.

The page property exclude-from-graph-view is meant as a way to keep certain pages out of the graphical representation of your graph. This view is accessed through the menu item “Graph view” in the left-hand sidebar. To use this property, you have to place it in the first block under the page title, using the format: exclude-from-graph-view:: true. As for the second colon disappearing when you are not in edit mode; that is, indeed, the expected behaviour. To exclude pages with the “exclude-from-graph-view” property set to “true” you have to turn off the “Excluded pages” toggle switch you can find under the “Nodes” item in the top-right of this graph view. See image below.

That is all this property does. It won’t hide your page from your normal graph’s listings or views, only from the graphical view.

I hope this answers your question. If not, please let me know what exactly you are trying to achieve, so I may be better able to assist you.

Disclaimer: I am not a developer, just a fellow Logseq user trying to be helpful. My understanding of how things really work under the hood is very limited. I only know what I have experimented with myself.

1 Like

Thanks for the time you are taking helping me solving this issue, really appreciated.
You are correct, I am trying to hide a node (“Manuscripts”) from the Graph View. I have done the following:

  • I placed property:: exclude-from-graph-view: true in the fist block, as per my screenshot above
  • I opened the Graph View and turned off the “Excluded pages” toggle.

The node “Manuscripts” is still there, unfortunately :frowning:

Also, I noticed that every time I close and reopen Logseq the “Excluded pages” toggle is turned back on…

I think only the syntax: exclude-from-graph-view:: true will actually work - without the property:: in front.

As for the toggle switching back after a restart: there are a few more of those glitches in Logseq. You could report this as a bug and hope it gets resolved in the future.

Thanks, I tried only exclude-from-graph-view:: true but the note still shows in the graph view.

When the property line is in the first bullet point on your page, it should work. It works for me. If it doesn’t work for you, there may be a bug I am not aware of. Sorry, my expertise ends here. I apologise for not being able to help you further.