You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been testing nexrender for few days and found out that sometimes "expression" works better than "value" and it allows you to somewhat simplify your script. For at least color and text this seems to work pretty well.
For color, instead of using something like "value": [0.137, 0.784, 0.125] (example from old thread) you could use "expression": "(hexToRgb('23c820'))" to achieve the same thing with hex color code.
And for text, instead of having, lets say three different blocks for font, text and color values, you could use
{
"type": "data",
"layerName": "my text field",
"property": "Source Text",
"expression": "style.setText('INSERT TEXT HERE').setFont('Arial-BoldItalicMT').setFillColor(hexToRgb('ffffff'))"
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Been testing nexrender for few days and found out that sometimes "expression" works better than "value" and it allows you to somewhat simplify your script. For at least color and text this seems to work pretty well.
For color, instead of using something like
"value": [0.137, 0.784, 0.125]
(example from old thread) you could use"expression": "(hexToRgb('23c820'))"
to achieve the same thing with hex color code.And for text, instead of having, lets say three different blocks for font, text and color values, you could use
Beta Was this translation helpful? Give feedback.
All reactions