I have a JS API 4x web application that uses a Feature Layer that is populated client-side by data coming from a web socket. I am trying to use the ColorExpression to vary the color on the symbol.
const colorExpression = `
var color = $feature.color;
var code = Decode(color, '#990000', 0, '#006600', 1, '#000000', 2);
return code;
`;
breadcrumbRenderer.visualVariables = [{
type: "rotation",
field: "heading",
rotationType: "geographic"
},{
type: "color",
valueExpression: colorExpression,
stops: [
{ value: 0, color: "#990000"},
{ value: 1, color: "#006600"},
{ value: 2, color: "#000000"}
]
}]
The rotation variable works fine but the color variable is ignored, with everything showing up in the default color. If I use something like "0" for valueExpression then it would render in the 0 color, but for some reason my Arcade Expression is not recognized. Can someone help?