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

Refine data generator support #1660

Closed
jheer opened this issue Aug 15, 2019 · 1 comment · Fixed by #1667
Closed

Refine data generator support #1660

jheer opened this issue Aug 15, 2019 · 1 comment · Fixed by #1667

Comments

@jheer
Copy link
Member

jheer commented Aug 15, 2019

Vega-Lite supports data generators for geo spheres, geo graticules, and numeric sequences: https://vega.github.io/vega-lite/docs/data.html#data-generators

Altair includes auto-generated classes (e.g., alt.GraticuleGenerator, alt.GraticuleParams) corresponding to these features. However, passing a generator class as the data for a Chart can result in warning output:

UserWarning: data of type <class ‘altair.vegalite.v3.schema.core.SphereGenerator’> not recognized
warnings.warn(“data of type {} not recognized”.format(type(data)))

Moreover, code like alt.GraticuleGenerator(graticule=alt.GraticuleParams(...)) feels unnecessarily verbose. Perhaps a more concise syntax would be helpful? For example, merging the generator and params into a single call... For comparison, the Vega-Lite JavaScript API includes top-level methods for generators (vl.graticule()); https://observablehq.com/@vega/vega-lite-cartographic-projections provides an example of their use.

@jakevdp
Copy link
Collaborator

jakevdp commented Aug 15, 2019

Great suggestion! I think something like alt.graticule() or alt.data.graticule() would make sense.

What version were these added to Vega-Lite?

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

Successfully merging a pull request may close this issue.

2 participants