0
votes

Very new to Cypher and Neo4j so please excuse my ignorance and misuse of terms. I am looking to change the label of a node from the ID to the property name (see image below). I used the following code to load the data from CSV.

load csv with headers from "file:///Goal.csv" as row
create (g:Goal) set g.name = row.goalName

Is there a way to change the label from the ID to the name property? I have tried the solution in the link below but it did not provide what I am looking for. Ultimately I would like the node to show the name information (i.e. reduce fuel, green, etc.)

Change node label in neo4j

Node graph - label as ID not name

1
You mean just in the Neo4j Browser visualisation, for the nodes to show the contents of the name property instead of the node ID?Pablissimo
you could give this a little read neo4j.com/developer/neo4j-browser scroll down to "Styling Neo4j Browser Visualization"Dave Bennett
Yes I would like to change the caption in the Browser visualization. I have looked at the styling as recommended, but am not setting where I can make the change. Is this something that can be done on import?Ryan Garnett

1 Answers

1
votes

Dave Bennett's comment's right - the docs will help show all the visualisation customisations you can do but for this specific case:

  • Click the node label above the graph visualisation you want to change - they're colour-coded
  • Choose a new caption field underneath the graph

In this graph, let's change the caption of the yellow 'Location' nodes:

enter image description here