yhat / ggpy

ggplot port for python
http://yhat.github.io/ggpy/
BSD 2-Clause "Simplified" License
3.7k stars 573 forks source link

stats for geoms and geoms for stats #243

Closed has2k1 closed 10 years ago

has2k1 commented 10 years ago

In ggplot2 there is a conceptual relationship between geoms and stats. With this relationship comes the largely distinct responsibilities of geoms and stats. In short, stats transform the data and geoms plot/visualize/render the data.

Since a ggplot object must be "plottable" if it has at least one geom or stat added to it, then each stat should have a default geom responsible for the plotting. Likewise, the geoms use stats to make transformations if required.

As a result each geom has a default stat and each stat has a default geom, with stat='identity' if the no data transformation is done before the plotting.

To maintain the conceptual integrity, all stats delegate the plotting to the geoms. The benefit of this discipline in implementation is that any stat that takes less parameters can be applied to a geom provided that the stat after transformations can meet the requirements of the geom.

Direction towards this objective:

I am working on part of #175 where the 1st point should be taken care of. Given @JanSchulz's pending combined refactoring (#160 & #221) in PR #235, I lack a clearer picture on the 2nd and 3rd points and it seems prudent to wait and see how it (#235) shapes up.

Suggestions?

has2k1 commented 10 years ago

This is being taken care of.

jankatins commented 10 years ago

:-) You can also close them when the commit is in (or with "Closes: #243" in the commit message -> https://help.github.com/articles/closing-issues-via-commit-messages)