Bubble size in Neo4j

回眸只為那壹抹淺笑 提交于 2019-12-04 09:48:32

问题


Is there a way to adjust the bubble size (or colour) of nodes in Neo4j in relation to a node property value? For example, if each node has a size: "xxx" property, how would I make each node scale to this size?

Is there a similar way to adjust relation lines? I know both nodes and relations can be adjusted to different colours or sizes all at once, but I can't figure out how to do this based on their properties.

I tried creating a custom GRASS file, but weird things happened. This is what I used:

node
{
    diameter: 50px;
    color: #A5ABB6;
    border-color: #9AA1AC;
    border-width: 2px;
    text-color-internal: #FFFFFF;
    font-size: 10px;
}

relationship
{
    color: #A5ABB6;
    shaft-width: 1px;
    font-size: 8px;
    padding: 3px;
    text-color-external: #000000;
    text-color-internal: #FFFFFF;
}

node.person
{
    /* Node diameter is based on value. */
    diameter: {value};
}

And this is what appears when I drag and drop it into the browser:

node {
  diameter: 50px;
  color: #A5ABB6;
  border-color: #9AA1AC;
  border-width: 2px;
  text-color-internal: #FFFFFF;
  font-size: 10px;
}

relationship {
  color: #A5ABB6;
  shaft-width: 1px;
  font-size: 8px;
  padding: 3px;
  text-color-external: #000000;
  text-color-internal: #FFFFFF;
}

node.person {
  /* Node diameter is based on value. */
    diameter: value;
  color: #68BDF6;
  border-color: #5CA8DB;
  text-color-internal: #FFFFFF;
  caption: '{person_name}';
}

; {
}

Not only does it add the caption can colours, and ignore the {value} variable, but it also adds the extra ;{} at the end. Nothing shows up in the graph window. Am I screwing up the syntax, or is this a bug?


回答1:


The neo4j browser can be configured to customize a node by one of its labels, and to customize a relationship by its type. See here and here for the 2 ways to do that.

However, the browser has no support for dynamic customization by property value.



来源:https://stackoverflow.com/questions/36522761/bubble-size-in-neo4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!