After deeper investigation of node filtering functionality together with focusnodes mode, the verdict is that it is expected behavior.
Here is an explanation.
navigation.mode is set to "showall", then there is no focus nodes and that means that all nodes are in this context the same.
So node filtering in this case check all the nodes against conditions.
navigation.mode is set to "focusnodes", then in first place focused nodes are checked agains conditions and after that the rest of the nodes follow.
Take a look at the following diagram:
Nodes in orange are focusnodes.
Now if we add a condition where label should start with a letter "a", then nodes that are not related to matching focus nodes are hidden.
For instance if we check label to start with letter "n" (as we see there is a regular node that matches this condition), then no nodes will be visible because there is not a single focus node that starts with "n". If we would like to see "Nio" node then:
a) it has to be a focus node;
b) it has to be directly related to focus node that also starts with letter "n".
So even if the "regular" nodes starts with letter "a" and they are not directly related to focus node that starts with an "a" are hidden. Also if regular node is directly related to matching focus node but doesn't match with conditions itself, then it is hidden.
Further if we add a condition so that node label starts with "am", then we can see that there is at least one focus node matching this condition and also one "regular" node that is directly related to that focus node is displayed.
We understand that there might be cases where all the nodes should be checked agains the same conditions not just focus nodes.
So there are 2 options.
1. Use nodeStyleFunction() to style all matching nodes or change opacity to other nodes that doesn't match conditions.
- Change navigation.mode to "manual" - this mode allows developer to control nodes and links as he likes, meaning that developer can control when to display, hide or expand nodes.
I hope this clarifies node filtering together with focusnode mode.