Given this spec,
{
"description": "A scatterplot showing horsepower and miles per gallons.",
"data": {"url": "data/cars.json"},
"mark": "point",
"encoding": {
"x": {"field": "Horsepower", "type": "quantitative"},
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
"color": {"bin": "true", "field": "Acceleration", "type": "quantitative"}
},
"config": {"numberFormat": "d"}
}
The output bin transform contains this weird output
{
"0": "t",
"1": "r",
"2": "u",
"3": "e",
"type": "bin",
"field": "Acceleration",
"as": ["bin_Acceleration_start","bin_Acceleration_end"],
"extent": {"signal": "Acceleration_extent"},
"maxbins": 10
}
This is probably contributing to the validation fail.
Lol.
{
"0": "L",
"1": "o",
"2": "l",
"3": "."
}
The spec is incorrect. bin has to be true, not "true".
{
"description": "A scatterplot showing horsepower and miles per gallons.",
"data": {"url": "data/cars.json"},
"mark": "point",
"encoding": {
"x": {"field": "Horsepower", "type": "quantitative"},
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
"color": {"bin": true, "field": "Acceleration", "type": "quantitative"}
},
"config": {"numberFormat": "d"}
}
Oh god ><"
@jheer
{
"description": "A scatterplot showing horsepower and miles per gallons.",
"data": {"url": "data/cars.json"},
"mark": "point",
"encoding": {
"x": {"field": "Horsepower", "type": "quantitative"},
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
"color": {"bin": "Lol.", "field": "Acceleration", "type": "quantitative"}
},
"config": {"numberFormat": "d"}
}
in fact generates
{
"0": "L",
"1": "o",
"2": "l",
"3": ".",
"type": "bin",
"field": "Acceleration",
"as": ["bin_Acceleration_start","bin_Acceleration_end"],
"extent": {"signal": "Acceleration_extent"},
"maxbins": 10
},
The reason for this behavior is this line in the code typeof bin === 'boolean' ? {} : bin. But our schema does not allow strings and won't accept the spec above. Just add "$schema": "https://vega.github.io/schema/vega-lite/v2.json", and you see that vscode complains.

Most helpful comment