How can colorize multi label nodes with specific labels?

221 Views Asked by At

I have some node that have multi label. they create with codes like this:

    CREATE (a:Person:Student{name: 's1'})
    
    CREATE (b:Person:Teacher{name: 't1'})
    
    CREATE (a:Person:Employee{name: 'e1'})
    
    CREATE (b:Person:officer{name: 't1'})

I have about 300 labels.

I want colorize graph with not common label(Person), actuality I want teacher and student have different color .

How can I do that?

I think when I return the nodes, don't return all labels other than Person the problem be solve. Are there any way to do this?

1

There are 1 best solutions below

2
jose_bacoy On

In Neo4j browser wherein you can see the "colorized" data that you created. When you browse the nodes on the left panel (Database Information), you can see the labels for Teacher and Student. Click on Teacher and you will see the first 25 nodes for teachers. Then on your right panel, click on Teacher and you will see the different colors that you want. For older versions of Neo4j (3.5 or lower), the option to choose the color is at the bottom. I'm using the latest Neo4j version 4.4.

enter image description here

enter image description here

Bonus: You can also change the node size to small or BIG!