I have written up an observable showing that neither vega-embed
nor vega-lite
has the transformation fold
implemented and working.
I am lost on what the cause could be, there you go:
I have written up an observable showing that neither vega-embed
nor vega-lite
has the transformation fold
implemented and working.
I am lost on what the cause could be, there you go:
looking at the console you might need to use vega 4.2 and https://unpkg.com/vega-lite@3.0.0-rc3/build/vega-lite.min.js as the v. of vega lib you are using doesnāt recognize the fold transform. most likely was added in the latest release and why it works in vega editor.
see this fork with a fix using latest vega and vega-lit libs:
.@mbostock & @tom I think it would be beneficial to update those libs for devs using @observablehq/vega-lite@0.1 shorthand require on this site to experiment with vega.
I would also suggest you version using vega v. So, @observablehq/vega-lite@3.0 would refer to a shorthand vega-lite div setup for that lib.
Weāll update @observable/vega-lite when Vega-Lite 3.0 is released. Currently only a release candidate is available, and we canāt pin to 3.0 until it is released.
In the meantime, you can use require.alias to override the dependencies and get a different version. For example, to get the latest version:
vegalite = require.alias({
"vega": "vega@latest",
"vega-lite": "vega-lite@latest"
})("@observablehq/vega-lite")
donāt work in that notebook for some reason.
It works here:
It wonāt work if youāve already requireād @observablehq/vega-lite without configuring require.alias in your notebook, since in that case require will return the previously-loaded module from the cache (without the aliases). Possibly d3-require should have separate caches for require.alias; Iāll file an issue. This bug has now been fixed in d3-require.
perfect! now we have latest v and specific v. examples in place.
Thanks @mbostock!
Is this a similar issue ?
Error: Unrecognized function: isValid
is the message returned by a vega-lite spec when using vega-embed@3.
see test notebook
Switching to approches 1 and 3 as reported at @mbostock/hello-vega-lite/2 i.e. requiring vega and vega-lite in a function, works well.