neodash
neodash copied to clipboard
Display of nodes with Multiple Labels
Problem description
Starting point: there are nodes in the database that have several labels. We want to show a Graph report in NeoDash. Doing so, the colour scheme and the "Property Selection" are a bit confusing. All labels are listed in the Property Selection but the node (of course) has only one colour. I assume the last set label on the node is the dominant one which also determines the colour and which Property Selection prevails.
How to recreate
- Create a graphdb (local or Aura) and add one node using the following Cypher query:
CREATE (:Person:Actor:Director {name: "Tom Hanks"}) - Connect a NeoDash to this database.
- Create a new report choosing "Graph" as the Type and
as the query. Result:MATCH (a:Director) RETURN a
Now, choosing different properties to display on the Person or the Actor Property Selection will not prevail.
Solution proposal
- One solution could be to provide another item in the Advanced Settings where a user can state which labels should not be displayed (as a comma / semicolon-separated list?). In this case, I might want to "hide" the
Personlabel. - Another solution could be to only show the labels that the user queried for, e.g. in this case I wanted to see all Directors and did not care about Actors and Persons.
Advanced
It would be great in many cases to be able to set the colouring of the graph independent of the labels displayed in the Property Selection. If I have a db containing the following three nodes:
CREATE
(:Person:Director {name: "Tom Hanks"}),
(:Person:Actor {name: "Tom Cruise"}),
(:Person:Chef {name: "Gordon Ramsay"})
With the query
MATCH (a) RETURN a
I would want the nodes to be displayed in the three different colours (just as they are right now; see screenshot below) but I would want to only have the Person dropdown in the Property Selection while keeping the colour-to-label mapping as a legend somewhere.
Again, this could be a setting in the Advanced settings where users choose which labels are used for colouring and which labels appear in the Property Selection.
Comments
This problem becomes especially relevant if there are several graphs in a single database which are kept apart by label.