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

Modifiable vega-lite? #35

Open
mroswell opened this issue Apr 6, 2021 · 2 comments
Open

Modifiable vega-lite? #35

mroswell opened this issue Apr 6, 2021 · 2 comments

Comments

@mroswell
Copy link
Sponsor

mroswell commented Apr 6, 2021

We'll leave learning vega-lite to the user, but I wasn't sure how to create an instance where I can tweak the chart format. I do see the little white circle that offers the ability to open in the vega-lite editor. But the chart there is blank. The only way it carries over the data is as a partial url in the json definition. Can anyone document how to get a live instance that's modifiable? For instance, tweaking color, size, or chart type or anything else that vega-lite offers... using our own data.

Hmm... looks like we just need to carry over the 'http://example.com' portion of the URL into the "url" value. (Though I've had mixed success with this. Usually getting "[Warning] Loading failed" even if the JSON url is accurate. My table has less than 550 records. I wonder if the incomplete URL version just somehow got cached somewhere along the line.)

UPDATE: I was missing the 's' after 'http' and the vega-lite editor didn't like that.

So it looks like we just have to carry over the full url, and we'd be able to edit the vega-lite chart to our heart's content.

@mroswell mroswell changed the title modifiable vega-lite? Modifiable vega-lite? Apr 6, 2021
@elgiad007
Copy link

Also doesn't work if you're using a local database that isn't exposed to the outside world (at least as far as I can tell). I would also love to see the ability to modify the format/configuration of the graph either through Vega editor or by passing values through metadata.json (even better, I think).

@mroswell
Copy link
Sponsor Author

This is a bug that could be fixed by replacing:
"url": "/covid/ny_times_us_counties.json?_shape=array&_shape=array",
with
"url": "https://covid-19.datasettes.com/covid/ny_times_us_counties.json?_shape=array&_shape=array",

on the https://vega.github.io/editor/#/ link at:
https://covid-19.datasettes.com/covid/ny_times_us_counties#g.mark=bar&g.x_column=state&g.x_type=ordinal&g.y_column=county&g.y_type=ordinal

But I'm having trouble figuring out where that would be done. Maybe it's somewhere in the vega-embed project... needing to inject the domain name in there. Can anyone find where the fix is for this?

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