neo4jgrass

neo4j GRASS border color if attribute?


Is it possible to change a border color of a node if a attribute is present or not within the GRASS stylesheet? For example, if you have:

I would like the 2nd to have a red border.


Solution

  • Not presently. The GRASS styles are configured at the node label and relationship type level (so the styles apply to all nodes matching that label), not at the property level.

    One workaround would be to add an additional node label for nodes with the specific attribute:

    MATCH (n:Name) WHERE n.is_cool = "true"
    SET n:Cool
    

    So (y:Name {first: "brian", is_cool: true}) becomes (y:Name:Cool {first: "brian", is_cool: true}). That would allow you to define an additional style for node.Cool:

    node.Cool {
        border-color: #FF0000;
    }