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

Refactor: Legends & fill #270

Closed
has2k1 opened this issue Apr 9, 2014 · 0 comments · Fixed by #271
Closed

Refactor: Legends & fill #270

has2k1 opened this issue Apr 9, 2014 · 0 comments · Fixed by #271

Comments

@has2k1
Copy link

has2k1 commented Apr 9, 2014

Legend information is created in the assign functions called by components.assign_visual_mapping and it is attached to the ggplot object to create
the legend dictionary.

{aesthetic: {visual_value: legend_key}}

# where
aesthetic := 'color' | 'linestyle' | 'marker' | 'size'
visual_value := color | linestyle | marker-character | size-value
legend_key := quantile

The refactoring would have the legend modified to

{aesthetic: (column_name, {visual_value: legend_key})}

# where
aesthetic := 'color' | 'fill' | 'linetype' | 'shape' | 'size' | 'alpha'
column_name := 'cat', 'cat2', 'factor(cyl)', ...
visual_value := color | fill-color | linetype | shape-character | size-value | alpha-value
legend_key := quantile

And no ggplot object would be passed, instead assign_visual_mapping would return the legend, so each layer would be able to control the legend, #211. The changes also include doing away with the matplotlib API names, this has cascading effects, https://github.com/yhat/ggplot/blob/master/ggplot/geoms/geom.py#L74. Changes would also be made to handle the fill mapping. Keeping the column name would allow for smarter legends later on, #89.

This is issue is in someway a blocker for #266.

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

Successfully merging a pull request may close this issue.

1 participant