vscode-vega-viewer icon indicating copy to clipboard operation
vscode-vega-viewer copied to clipboard

refresh vega chart preview when local data file is changed and saved

Open stenzengel opened this issue 5 years ago β€’ 9 comments

Currently the preview is not updated, when the data file referenced via url is changed and saved.

The file seems already to be known, because it can be opened in the preview. Would it be possible to listen to its save events and refresh the preview accordingly?

Many thanks for this extension!

stenzengel avatar Jan 26 '20 14:01 stenzengel

I can do this for local data files, or just add a refresh button to reload referenced local and remote data ...

RandomFractals avatar Jan 26 '20 14:01 RandomFractals

Thanks for your quick feedback!

I prefer the first option, because I only use local data files.

Could you implement both? This would be the best solution for both local and remote data.

stenzengel avatar Jan 26 '20 15:01 stenzengel

yep! will do both in the next VV update.

Could you please provide some public feedback on this extension in marketplace?

I know that many Vega devs use it, yet the overall rating of it is super low for no good reason :)

https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-vega-viewer&ssr=false#review-details

Thanks!

RandomFractals avatar Jan 26 '20 15:01 RandomFractals

Thank you. I provided feedback in the marketplace.

stenzengel avatar Jan 26 '20 18:01 stenzengel

@stenzengel thanks for that feedback in store.

here is a pic of new refersh data UI and Vega Viewer toolbar now matching vscode theme colors. see #63 for more info on that ...

vega-viewer-refresh

I'll push new release with those changes tomorrow.

RandomFractals avatar Jan 27 '20 04:01 RandomFractals

@stenzengel actually, adding file watchers and automatically refreshing the chart on local data source changes might have some side effects when that data is live or log data.

I am going to close this for now with refresh data feature implemented.

RandomFractals avatar Jan 27 '20 05:01 RandomFractals

@RandomFractals: Thanks for the refresh button and for trying to implement an automatic refresh for local data files. I do not completely understand the side effects you described, in particular what you mean by "data is live or log data". Would it help to be able to disable automatic refresh for these cases? I.e. would it help to have a vs code setting or a toggle button in the vega chart preview to enable/disable automatic refresh for local data files? Another option would be to "debounce" multiple refresh requests, if they occur too often (e.g. with https://rxjs-dev.firebaseapp.com/api/operators/debounceTime)

stenzengel avatar Jan 28 '20 07:01 stenzengel

@stenzengel I was just being lazy and figured Refresh will suffice.

ok. I'll reopen it, add a setting to enable live data updates and add file watchers to do refresh on data file changes. No need for debounce, but thanks for that link :)

RandomFractals avatar Jan 28 '20 12:01 RandomFractals

@RandomFractals ;-) So am I: I'm too lazy to push the refresh button. But this seems to be one of the "three great virtues of a programmer"...

stenzengel avatar Jan 28 '20 12:01 stenzengel