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

Plots not rendering with vegascope and json data transformer in altair #6

Open
chsafouane opened this issue Oct 21, 2019 · 1 comment

Comments

@chsafouane
Copy link

I'm using altair 3.2.0 from within vscode 1.39.2(the last version as of today). As I'm running code in a notebook within vscode, I use vegascope renderer. Everything seems to work fine.

Yet, when I set the data transformer in altair to json, I get plots that are blank. Only the names of the x-axis and y-axis appear on the plots.

For info, json data loader saves the plot dict (json) to a temporary file on disk. I've opened an issue in altair repo and I've got this answer from Jake Vanderplas: #1741 .

Here are some more info about my vscode version:
Version: 1.39.2 (user setup)
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:35:18.241Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763

@jpivarski
Copy link
Member

VegaScope doesn't interpret your Vega/Vega-Lite at all: it passes the JSON literal or URL representing your plot through to Vega/Vega-Lite running in your web browser. If your plot is a JSON literal with a Data directive that points outside of itself (i.e. "url", rather than "values"), then your web browser may be protecting you from Javascript (part of the Vega/Vega-Lite implementation) attempting to read data from your computer.

I don't know a way out of that conundrum—nothing in the Javascript itself (what the VegaScope package provides) should be allowed to break out of that sandbox. Maybe there's a setting to the left of your web browser's location bar that would let you manually allow this web page to access your disk?

Maybe the Python part of VegaScope, which runs a local web browser, can be made more promiscuous, because we know that there's only a local connection? If so, I don't know how to do it—I don't know a lot about web security. (VegaScope uses Python's built-in SimpleHTTPServer.)

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

No branches or pull requests

2 participants