cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Import a .grass file in neo4j

Hi,

I try to color the nodes based on properties, but when I open my database in neo4j, it shows the following error:

"Could not parse grass data:
'file:///style.grass'"

I save my style.grass file in the import folder of my project and add the line browser.post_connect_cmd=style 'file:///style.grass' in the neo4j.conf.

My style.grass contains the following:

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
caption: ""
}
node.Group {
caption: "{Company}"
color: "Gray"
}

node.T0_UseLegalEntity {
caption: "{Unit}"
color: "Gray"
}

node.T1_UnitAssetClass {
caption: "{AssetClass}"
diameter: 65px
color: "Gray"
}

node.T2_UseLegalEntityProductUseCode {
caption: "{Product}"
diameter: 50px
color: #8DCC93
border-color: #5db665
text-color-internal: #2A2C34
}

node.Zeroava {
caption: "{Product}"
color: "Dark Green"
border-color: #447666
text-color-internal: #FFFFFF
}

node.NA {
caption: "{Product}"
color: "Purple"
border-color: #d7a013
text-color-internal: #2A2C34
}

node.Noinvent {
caption: "{Product}"
color: "Yellow"
border-color: #d7a013
text-color-internal: #2A2C34
diameter: 65px
caption: "{InputCode}"
}

node.Outscopeandinvt {
caption: "{Product}"
color: "Blue"
border-color: #23b3d7
text-color-internal: #2A2C34
diameter: 50px
}

node.Nothingpending {
caption: "{Product}"
color: "Green"
border-color: #5db665
text-color-internal: #2A2C34
}

node.Pendinganalysis {
defaultCaption: ""
color: "Beige"
border-color: #c0a378
text-color-internal: #2A2C34
}

node.Outscope {
caption: "{Product}"
color: "Orange"
border-color: #f36924
text-color-internal: #FFFFFF
}

Where is the error? Could you help me to color the nodes based on property?

Thanks a lot!

2 REPLIES 2

For a start it looks like you are missing all the semicolons?

Example, from neo4j export I did just now

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;
  caption: "<type>";
}

Thanks Joel! I can modify the style in cypher.