4

I am new to neo4j and I am trying to edit the GraSS file so that I can display nodes and relationship in different colors. Basically what I want is, nodes to have different colors based on certain properties of the node.

For example there is a Person node and it has an attribute 'Gender' then I want all the nodes with value of 'Gender' as male to be red and all the nodes with value of 'Gender' as female to be green. Can I achieve this by editing GraSS (Graph Style Sheets)

Ganesh
  • 131
  • 2
  • 9
  • See http://stackoverflow.com/questions/21409282/edit-or-create-graph-style-sheets-for-webadmin for more information. – tstorms Mar 06 '14 at 08:48
  • 1
    That question talks about the procedure to edit a style sheet. My question is different. My question is about styling the nodes based on a property in the node. – Ganesh Mar 06 '14 at 19:04

1 Answers1

0

Use the stylesheet to edit the styles of a property. Lets say you have two types of relationships, negative and positive. You would like a green color for the positive relationship and a red color for the negative relationship. Here are basic styles to achieve the desired outcome.

relationship {
  color: #D4D6D7;
  shaft-width: 1px;
  font-size: 8px;
  padding: 3px;
  text-color-external: #000000;
  text-color-internal: #FFFFFF;
}
relationship.Negative {
  color: #FF0000; //Bright Red
  shaft-width: 1px;
  font-size: 8px;
  padding: 3px;
  text-color-external: #000000;
  text-color-internal: #FFFFFF;
}
relationship.Positive {
  color: #15FF00; //Bright Green
  shaft-width: 1px;
  font-size: 8px;
  padding: 3px;
  text-color-external: #000000;
  text-color-internal: #FFFFFF;
}
Nathan
  • 3,082
  • 1
  • 27
  • 42