Good Morning @aaron-nimocks
I tried what you. were suggesting and it didn't work (assuming I did it wrong), I am including a simple example below to illustrate what I am trying to do, basically I want to symbols in the example below to be colored by the field chosen in the signal, so if "foo" is chosen they should be different colors if "bar" is chosen they should be the same color. Please advise, thank you!
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 200,
"height": 200,
"padding": 5,
"signals": [
{
"name": "color_picker",
"value": "foo",
"bind": {
"input": "select",
"options": [
"foo",
"bar"
],
"labels": [
"foo",
"bar"
]
}
}
],
"scales": [
{
"name": "color_by",
"type": "ordinal",
"domain":{
"data": "sample_data",
"field": {
"signal": "color_picker"
}
},
"range":{
"scheme": "category20c"
}
}
],
"data": [
{
"name": "sample_data",
"values": [
{
"foo": "VALUE_FOO",
"bar": "VALUE_BAR",
"xc" : 50,
"yc" : 50
},
{
"foo" : "VALUE_2",
"bar" : "VALUE_BAR",
"xc" : 100,
"yc" : 100
}
]
}
],
"legends": [
],
"marks": [
{
"name": "test",
"type": "symbol",
"from": {
"data": "sample_data"
},
"encode": {
"enter": {
"fill": {
"scale": "color_by",
"field": {
"signal": "color_picker"
}
}
},
"update":{
"shape":{
"value":"circle"
},
"size":{
"value":500
},
"xc": {
"field": "xc"
},
"yc": {
"field": "yc"
}
}
}
}
]
}