0
I created an example graph in Neo4j with a father and two children. I would like to know how to change the color of all nodes that have the level 1.
When I click on the node appears at the bottom to modify the size and color but the change affects everyone and not just the ones that have the value of level 1. Some images I found on the web show the nodes with different colors but I didn’t find how to apply this, neither via the interface nor using the py2neo(Python) lib I am using. My code is like this:
from py2neo import Graph, Path
from py2neo import Node
from py2neo import Relationship
graph = Graph('http://neo4j:senha_falsa@localhost:7474/db/data/')
graph.delete_all()
a = Node("Conta", email="[email protected]", name="Argos", nivel="0")
b = Node("Conta", email="[email protected]", name="Riana", nivel="1")
c = Node("Conta", email="[email protected]", name="Elias", nivel="1")
graph.create(Relationship(a, "PAI DE", b))
graph.create(Relationship(a, "PAI DE", c))
I wanted to know if there’s no way to pass size and color as attributes.
Bruno, so for me to have the desired effect inside the Neo4j Browser I need to at least set some attribute with a specific label to can change the color of all nodes that have that same label correct? Already solve my problem for now, I’ll read the link you sent and see if I can do something inside the code in python to perpetuate these visual settings. thank you
– rodrigorf
This, you will only be able to assign a color to nodes that have a label. Nodes with the same label will have the same color. The most you can do through Python is to create the nodes with the Abels. Arrange!
– Bruno Peres