SandDance icon indicating copy to clipboard operation
SandDance copied to clipboard

Pass Vega specification to Vega Editor for preview and edits

Open RandomFractals opened this issue 4 years ago • 4 comments

This is a feature request to improve online version of SandDance integration with online Vega Editor.

Synopsis:

Currently, SandDance online version has an option to Open Vega Editor for a chart in Chart Settings -> Tools section, Show Vega spec dialog. However, that dialog only links to online Vega Editor and doesn't pass the generated chart Vega spec for edits and preview in that tool.

Feature request:

Create compact Vega spec json string and Url encode generated Vega json for your chart using json-stringify-pretty-compact and lz-string libraries to pass it as a parameter to Vega Editor.

You can glean some info on how Vega Editor encodes vega specs in this vega-unfurl dev to post: https://dev.to/tarasnovak/vega-unfurl-take-2-5fnb

The general patern is: https://vega.github.io/editor/#/url/vega/<lz-vega-json-compact-compressed-string>

@danmarshall Let me know if you have questions about this integration proposal.

RandomFractals avatar Dec 15 '19 14:12 RandomFractals

Instead of passing via URL, please use the post message API like Vega Embed does.

domoritz avatar Dec 15 '19 17:12 domoritz

or that. in any case, would be much better than just opening vega editor with latest spec loaded in browser that has nothing to do with vega spec viewed in SandDance.

@domoritz thanks for your post tip on this!

RandomFractals avatar Dec 15 '19 17:12 RandomFractals

@danmarshall any updates on this?

RandomFractals avatar Oct 15 '20 18:10 RandomFractals

@RandomFractals not from me, but this is a good idea and I'd be happy to take a PR :)

danmarshall avatar Oct 15 '20 18:10 danmarshall