cancel
Showing results for 
Search instead for 
Did you mean: 

How to expend the color of nodes?

Zhao-YM
Node

My neo4j version is 3.5.30, there are only 12 color for nodes in different labels.

But I have more than 12 nodes in different labels, I want to show each nodes in different color.

Are there any ideas to expend the number of color in neo4j browser?

1 REPLY 1

giuseppe_villan
Graph Fellow

@Zhao-YM

You could add additional styling via :style command or importing a .grass file.
See here: css - Where can I find an overview of the syntax of the Neo4j GRASS language? - Stack Overflow

For example, if you want to add a background #0101FF and a border color "#9AA1AC" to node with label "Test", #6DCE9E to node with label "MySecondLabel2" and #00FF00 to relationship with type IS_RELATED_TO,
you could execute this query:

:style {
    "node.Test": {
        "color": "#0101FF",
        "border-color": "#9AA1AC"
    },
    "node.MySecondLabel2": {
        "color": "#6DCE9E"         
    },
    "relationship.IS_RELATED_TO": {
        "color": "#00FF00"
    }
}

or this query (without double-quotes and {} wrapping the style):

:style 

node.Test: {
  color: #A5ABB6;
  border-color: #9AA1AC;
}
node.MySecondLabel2 {
    color: #6DCE9E
}
relationship.IS_RELATED_TO {
    color: #00FF00
}

Alternatively, you can create a file style.grass, with the same syntax as above (without :style), and drag-and-drop it into your Neo4j Browser / Desktop window.

Unfortunately, I haven't found much documentation on grass syntax, other than the above link .