【问题标题】:neo4j GRASS border color if attribute?如果属性,neo4j GRASS 边框颜色?
【发布时间】:2016-03-24 21:21:30
【问题描述】:

如果GRASS 样式表中存在或不存在属性,是否可以更改节点的边框颜色?例如,如果您有:

  • (x:Name {first:"test"})
  • (y:Name {first:"brian" is_cool:"true"})

我希望第二个有红色边框。

【问题讨论】:

    标签: neo4j grass


    【解决方案1】:

    暂时没有。 GRASS 样式在节点标签和关系类型级别配置(因此样式适用于与该标签匹配的所有节点),而不是在属性级别。

    一种解决方法是为具有特定属性的节点添加额外的节点标签:

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

    所以(y:Name {first: "brian", is_cool: true}) 变成了(y:Name:Cool {first: "brian", is_cool: true})。这将允许您为node.Cool 定义一个额外的样式:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-08
      • 2020-07-21
      相关资源
      最近更新 更多