cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
657
Views
0
Helpful
2
Replies

How to set the icon color?

mspoerr
Level 4
Level 4

Hello,

I would like to set the node icon color with a JSON attribute. Is this possible?

Thanks,

Mathias

1 Accepted Solution

Accepted Solutions

alzverev
Cisco Employee
Cisco Employee

Hi Mathias,

If you pass color as a property of a node in JSON (say, this property is 'color'), the data goes to node's model. That is, you should define node's color in one of explicit ways.

The easiest way around this is to put this piece of code into topology config:

'nodeConfig': {

  'color': 'model.color'

}

- Alex

View solution in original post

2 Replies 2

alzverev
Cisco Employee
Cisco Employee

Hi Mathias,

If you pass color as a property of a node in JSON (say, this property is 'color'), the data goes to node's model. That is, you should define node's color in one of explicit ways.

The easiest way around this is to put this piece of code into topology config:

'nodeConfig': {

  'color': 'model.color'

}

- Alex

Hi Alex,

thank you very much for the hint. I included the color attribure in JSON, but did not enhance the nodeConfig... Now everything is fine.

/Mathias