damn I just can't get it to work
Hmm... wanna throw a spec up on a vega editor url?
Well, I guess I can just use that gist
@ben.sless Oh; This turns out to be a very simple mistake. You put the transform in the encoding specification. It should be at the top level (or on the layer specification if you have multiple layers).
Yeah; Might be appropriate as a separate project frankly. But absolutely seems doable.
d'oh!
I knew it would end up being a silly mistake
I even read the logs but for some reason didn't put 2+2 together
THANK YOU!
You're quite welcome 🙂 I've been in the same place, so happy to help.
The problem with the schema it only tells me the path, not what the expected schema is
Maybe I'll use malli to translate the spec
That would be fantastic! I've thought about translating into spec or something like malli. That would be fantastic.
currently malli has no means to read consume json schemas, though, need to PR it
This is really one of the big challenges of getting used to vega/vega-lite early on. It's takes time to get a deep intuitive sense of what goes where. You see code in one situation, and in adapting it's usually not immediately obvious which pieces need to go where.
I'll just say that this does get better over time.
However, it's worth pointing out that the vega-editor can often be super helpful. In this case, you'll notice in the logs that you get [Warning]Â transform-encoding is dropped as transform is not a valid encoding channel.
Also, [Warning]Â Validation: /encoding must NOT have additional properties of #/additionalProperties
I really should try to add some better debugging information like this to Oz. I'm actually not sure how to though; I don't know that it's code in the vega/vega-lite, but might be using their json-schema to produce this stuff.
Here's my edits; All I changed other than moving transform around was switching to {:filter {:param :selection}}, but your expression approach should work as well (though I'm not sure if selection_rate would be the right way to access the currently selected value or not; would have to look in to that).