You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by @NickCrews's idea in vega/altair#3188, vl-convert could potentially support converting Vega/Vega-Lite specifications to share URLs that are compatible with the Vega editor.
I haven't looked into the details, but @NickCrews mentioned that the editor is using the lz-string JavaScript library for URL-compatible compression. There is a Rust port of this library at https://docs.rs/lz-str/latest/lz_str/. If this library is compatible with the what the Vega editor needs, this might be a pretty easy and useful addition to vl-convert.
The text was updated successfully, but these errors were encountered:
I don't really understand how all the vega parts fit together, if this is added here, would it be accessible from altair?
Specifically, vega editor uses the LZstring.decompressFromEncodedURIComponent method. The python port I mentioned in the above issue did not have this flavor. But the rust port you linked does! So it might just work out of the box! I would just try passing some json to the rust lib and see if it works as a 10 minute prototype
This turned out to be pretty straightforward, so I opened a PR at #104. Regardless of what else happens with the Vega editor, this is a nice feature to have in VlConvert.
I don't really understand how all the vega parts fit together, if this is added here, would it be accessible from altair?
vl-convert-python is an optional dependency of Altair that we already use for PNG and SVG image export. We would probably want to have Altair provide a convenience chart.to_url() method, but it will be usable with vl-convert directly like this:
import vl_convert as vlc
vlc.vegalite_to_url(chart.to_json())
Inspired by @NickCrews's idea in vega/altair#3188, vl-convert could potentially support converting Vega/Vega-Lite specifications to share URLs that are compatible with the Vega editor.
I haven't looked into the details, but @NickCrews mentioned that the editor is using the lz-string JavaScript library for URL-compatible compression. There is a Rust port of this library at https://docs.rs/lz-str/latest/lz_str/. If this library is compatible with the what the Vega editor needs, this might be a pretty easy and useful addition to vl-convert.
The text was updated successfully, but these errors were encountered: