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 timeUnit support #27

Open
kdorr opened this issue Aug 16, 2018 · 0 comments
Open

Add timeUnit support #27

kdorr opened this issue Aug 16, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@kdorr
Copy link
Collaborator

kdorr commented Aug 16, 2018

mpl-altair currently doesn't support conversion for Altair charts that use timeUnit aggregations.

Code for reproduction

This and other timeUnit transformations don't work:

from vega_datasets import data
seattle = data.seattle_weather()

chart = alt.Chart(seattle).mark_point().encode(
    alt.X('month(date)'), alt.Y('temp_max')
)
mplaltair.convert(chart)

Actual outcome

A NotImplementedError is raised for anything that has a timeUnit.

Expected outcome

Any plot with a timeUnit transformation should work.

This plot should look something like this:

timeunit_altair

Possible solution and notes

  • Manipulate the data in parse_chart.ChannelMetadata() so that the data reflects the timeUnit aggregation. (see parse_chart.ChannelMetadata._handle_timeUnit().)
  • Also note that timeUnit transformations can also be applied separately from timeUnit transformations in the encoding channel.
@kdorr kdorr added the enhancement New feature or request label Aug 16, 2018
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

1 participant