Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add live vega spec preview? #3

Open
RandomFractals opened this issue Jan 8, 2019 · 10 comments
Open

add live vega spec preview? #3

RandomFractals opened this issue Jan 8, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@RandomFractals
Copy link
Owner

RandomFractals commented Jan 8, 2019

this is already set up in extension.ts workspace.onDidChangeTextDocument event handler, but I disabled it for alpha.

If updating preview on json spec save is not sufficient I can enable this feature in the next viewer release by adding some 1 min or so timer (configurable to your liking) for that whole json parser and render process not to fire on every char change (why I disabled it for now)

@RandomFractals RandomFractals added the enhancement New feature or request label Jan 8, 2019
@RandomFractals RandomFractals changed the title add live vega spec prevew? add live vega spec previeew? Jan 8, 2019
@RandomFractals RandomFractals changed the title add live vega spec previeew? add live vega spec preview? Jan 8, 2019
@RandomFractals
Copy link
Owner Author

I have not seen any requests for this feature and I don't like taxing code with even once a minute json spec updates that will most likely break a preview until they are complete.

so... closing this for now. save your json spec updates to refresh Vega preview.

@danmarshall
Copy link

I was just about to request this feature 😀. Perhaps the backend can do the following before updating the UI?:

  • watch the file for changes
  • validate as JSON
  • vega.parse for errors

If the above check out, finally render?

@RandomFractals
Copy link
Owner Author

might do all of the above in the next v. update ...

I'll reopen this for us to explore more :)

@danmarshall
Copy link

Great, thanks for re-opening!

Also, I didn't see the I need to rename my files to .vg.json for the refresh on save. Any chance on cracking the file and looking at $schema? Sorry to ask in this issue.

@RandomFractals
Copy link
Owner Author

yeah, Vega dev team pretty much set that standard for naming Vega and Vega-Lite spec json files in their examples that VV exposes too.

I'd rather we keep it that way and use $shema from vega(s) json specs only to decided what vega v. lib to load down the road. see #42 for more info on that. I need to add more notes from my slacks with Vega team to use schema ref. as well.

If you are using or expsoing Vega(s) json specs in SandDance too, I think it would be great if you switched to that json files naming convention too ...

@RandomFractals
Copy link
Owner Author

RandomFractals commented Nov 21, 2019

in short, VV looks for those extra vg/vl json filename extensions. try 'em! & all the examples that come with it :)

see this section in docs on that part for more info: https://github.com/RandomFractals/vscode-vega-viewer#vega-viewer-vscode-contributions

@danmarshall
Copy link

Great to know, I'm on board and will change my extensions to vg & vl 😀👍

@RandomFractals
Copy link
Owner Author

RandomFractals commented Nov 21, 2019

cool. yeah, use vg.json and vl.json for now. I threw .vg and .vl in the mix in my ext. just for fun. those might go away since we do watn vscode to treat them like any json files and for json schema validation to kick in without much lifting on our end.

@danmarshall
Copy link

Right, yes I meant .vg.json & .vl.json - I still need the .json for editing 😉

@RandomFractals
Copy link
Owner Author

RandomFractals commented Nov 21, 2019

@danmarshall let me know what you think of VV & that woman in the red dress :)

Hopefully, new tweet on VV & SandDance integration is forthcoming ...

by the by, I keep a steady dev log on VV on twitter. hit us up there: https://twitter.com/hashtag/vegaviewer?f=tweets&vertical=default&src=hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants