0

I just installed Neo4j and played with it in Neo4j Browser. My first HelloWord example is like this:

CREATE (database:Database {name:"Neo4j", id:"18"})-[r:SAYS]->(message:Message {name:"Hello World!"})
RETURN database, message, r

The visualization below uses the 'name' properties to display the node without the labels "Database" and "Message". Is it possible to display Database and Message as the labels of the nodes, and 'name:Neo4j' and "name:Hello World!" as the properties?

enter image description here

The following is an example from the neo4j book, and I want to see whether such a graph can be displayed in the Neo4j Browser. This is a standard labelled property graph visualization. enter image description here

cybersam
  • 63,203
  • 6
  • 53
  • 76
user697911
  • 10,043
  • 25
  • 95
  • 169

1 Answers1

1

You can use GRASS. Here is an example. With the caption you can edit whats written on the nodes. Just make a file with *.grass and drag it into the browser. You can decide wich attribute to display like this: "{ATTRIBUTE}". "caption":": My name is:{NAME}" would result into a Node having this text on it: My name is: Yoshi. In the following i generally edit the nodes. with node.NODE i only adjust the style for the nodes with the label NODE.

"node":
{
    "diameter":"50px",
    "color":"#A5ABB6",
    "border-color":"#9AA1AC",
    "border-width":"2px",
    "text-color-internal":"#FFFFFF",
    "font-size":"12px"
},
"relationship":
{
    "color":"#A5ABB6",
    "shaft-width":"13px",
    "font-size":"8px",
    "padding":"3px",
    "text-color-external":"#000000",
    "text-color-internal":"#FFFFFF",
    "caption":"<type>"
},
"node.NODE":
{
    "color":"#FFD86E",
    "border-color":"#EDBA39",
    "text-color-internal":"#604A0E",
    "caption":"{NODE_ELID}",
    "diameter":"68px"
},

"relationship.CONNECTED_TO":
{   
    "color":"#FB95AF",
    "border-color":"#E0849B",
    "text-color-internal":"#FFFFFF",
    "caption":"{SEGMENT_LENGTH}"    
}

For your example you could use:

"node.MESSAGE": { "caption":"Message" }

Yoshi
  • 141
  • 2
  • 16
  • with "node.MESSAGE": { "caption":"Message" }, it only displays "Message" as the caption. What i want is "Message" as the label and "HelloWorld" as the attribute of the node. – user697911 Feb 06 '18 at 06:30
  • Please see the above diagram example. That's what i want. – user697911 Feb 06 '18 at 06:34
  • Like this? "node.MESSAGE": { "caption":"Message name:{NAME}" } – Yoshi Feb 06 '18 at 06:36
  • Its not possible to add this label like an actual label. You can only write directly onto the node. I recommend to use different colours for different labels. – Yoshi Feb 06 '18 at 06:42
  • did you see the graph I pasted in the original post? How was that graph made? – user697911 Feb 06 '18 at 07:03
  • For me it looks like they added the labels afterwards. Just look how the position varies. – Yoshi Feb 06 '18 at 07:04